arch/m68k/mm/motorola.c
Source file repositories/reference/linux-study-clean/arch/m68k/mm/motorola.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/mm/motorola.c- Extension
.c- Size
- 12988 bytes
- Lines
- 513
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/signal.hlinux/sched.hlinux/mm.hlinux/swap.hlinux/kernel.hlinux/string.hlinux/types.hlinux/init.hlinux/memblock.hlinux/gfp.hasm/setup.hlinux/uaccess.hasm/page.hasm/pgalloc.hasm/machdep.hasm/io.hasm/atari_stram.hasm/sections.h
Detected Declarations
function nocache_pagefunction cache_pagefunction onfunction mmu_page_dtorfunction init_pointer_tablefunction free_pointer_tablefunction kernel_page_tablefunction kernel_ptr_tablefunction map_nodefunction paging_initexport mm_cachebits
Annotated Snippet
switch (type) {
case TABLE_PTE:
/*
* m68k doesn't have SPLIT_PTE_PTLOCKS for not having
* SMP.
*/
pagetable_pte_ctor(mm, ptdesc);
break;
case TABLE_PMD:
pagetable_pmd_ctor(mm, ptdesc);
break;
case TABLE_PGD:
pagetable_pgd_ctor(ptdesc);
break;
}
mmu_page_ctor(pt_addr);
new = PD_PTABLE(pt_addr);
PD_MARKBITS(new) = ptable_mask(type) - 1;
list_add_tail(new, dp);
return (pmd_t *)pt_addr;
}
for (tmp = 1, off = 0; (mask & tmp) == 0; tmp <<= 1, off += ptable_size(type))
;
PD_MARKBITS(dp) = mask & ~tmp;
if (!PD_MARKBITS(dp)) {
/* move to end of list */
list_move_tail(dp, &ptable_list[type]);
}
return ptdesc_address(PD_PTDESC(dp)) + off;
}
int free_pointer_table(void *table, int type)
{
ptable_desc *dp;
unsigned long ptable = (unsigned long)table;
unsigned long pt_addr = ptable & PAGE_MASK;
unsigned int mask = 1U << ((ptable - pt_addr)/ptable_size(type));
dp = PD_PTABLE(pt_addr);
if (PD_MARKBITS (dp) & mask)
panic ("table already free!");
PD_MARKBITS (dp) |= mask;
if (PD_MARKBITS(dp) == ptable_mask(type)) {
/* all tables in ptdesc are free, free ptdesc */
list_del(dp);
mmu_page_dtor((void *)pt_addr);
pagetable_dtor_free(virt_to_ptdesc((void *)pt_addr));
return 1;
} else if (ptable_list[type].next != dp) {
/*
* move this descriptor to the front of the list, since
* it has one or more free tables.
*/
list_move(dp, &ptable_list[type]);
}
return 0;
}
/* size of memory already mapped in head.S */
extern __initdata unsigned long m68k_init_mapped_size;
extern unsigned long availmem;
static pte_t *last_pte_table __initdata = NULL;
static pte_t * __init kernel_page_table(void)
{
pte_t *pte_table = last_pte_table;
if (PAGE_ALIGNED(last_pte_table)) {
pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
if (!pte_table) {
panic("%s: Failed to allocate %lu bytes align=%lx\n",
__func__, PAGE_SIZE, PAGE_SIZE);
}
clear_page(pte_table);
mmu_page_ctor(pte_table);
last_pte_table = pte_table;
}
last_pte_table += PTRS_PER_PTE;
Annotation
- Immediate include surface: `linux/module.h`, `linux/signal.h`, `linux/sched.h`, `linux/mm.h`, `linux/swap.h`, `linux/kernel.h`, `linux/string.h`, `linux/types.h`.
- Detected declarations: `function nocache_page`, `function cache_page`, `function on`, `function mmu_page_dtor`, `function init_pointer_table`, `function free_pointer_table`, `function kernel_page_table`, `function kernel_ptr_table`, `function map_node`, `function paging_init`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.