arch/csky/mm/init.c
Source file repositories/reference/linux-study-clean/arch/csky/mm/init.c
File Facts
- System
- Linux kernel
- Corpus path
arch/csky/mm/init.c- Extension
.c- Size
- 3724 bytes
- Lines
- 150
- Domain
- Architecture Layer
- Bucket
- arch/csky
- 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.
Dependency Surface
linux/bug.hlinux/module.hlinux/init.hlinux/signal.hlinux/sched.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/types.hlinux/pagemap.hlinux/ptrace.hlinux/mman.hlinux/mm.hlinux/highmem.hlinux/memblock.hlinux/swap.hlinux/proc_fs.hlinux/pfn.hlinux/initrd.hasm/setup.hasm/cachectl.hasm/dma.hasm/pgalloc.hasm/mmu_context.hasm/sections.hasm/tlb.hasm/cacheflush.h
Detected Declarations
function free_initmemfunction pgd_initfunction mmu_initfunction fixrange_initfunction fixaddr_initexport invalid_pte_table
Annotated Snippet
if (pmd_none(*pmd)) {
pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
if (!pte)
panic("%s: Failed to allocate %lu bytes align=%lx\n",
__func__, PAGE_SIZE,
PAGE_SIZE);
set_pmd(pmd, __pmd(__pa(pte)));
BUG_ON(pte != pte_offset_kernel(pmd, 0));
}
vaddr += PMD_SIZE;
}
k = 0;
}
j = 0;
}
}
void __init fixaddr_init(void)
{
unsigned long vaddr;
vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
fixrange_init(vaddr, vaddr + PMD_SIZE, swapper_pg_dir);
}
static const pgprot_t protection_map[16] = {
[VM_NONE] = PAGE_NONE,
[VM_READ] = PAGE_READ,
[VM_WRITE] = PAGE_READ,
[VM_WRITE | VM_READ] = PAGE_READ,
[VM_EXEC] = PAGE_READ,
[VM_EXEC | VM_READ] = PAGE_READ,
[VM_EXEC | VM_WRITE] = PAGE_READ,
[VM_EXEC | VM_WRITE | VM_READ] = PAGE_READ,
[VM_SHARED] = PAGE_NONE,
[VM_SHARED | VM_READ] = PAGE_READ,
[VM_SHARED | VM_WRITE] = PAGE_WRITE,
[VM_SHARED | VM_WRITE | VM_READ] = PAGE_WRITE,
[VM_SHARED | VM_EXEC] = PAGE_READ,
[VM_SHARED | VM_EXEC | VM_READ] = PAGE_READ,
[VM_SHARED | VM_EXEC | VM_WRITE] = PAGE_WRITE,
[VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_WRITE
};
DECLARE_VM_GET_PAGE_PROT
Annotation
- Immediate include surface: `linux/bug.h`, `linux/module.h`, `linux/init.h`, `linux/signal.h`, `linux/sched.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`.
- Detected declarations: `function free_initmem`, `function pgd_init`, `function mmu_init`, `function fixrange_init`, `function fixaddr_init`, `export invalid_pte_table`.
- Atlas domain: Architecture Layer / arch/csky.
- 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.