arch/microblaze/mm/init.c
Source file repositories/reference/linux-study-clean/arch/microblaze/mm/init.c
File Facts
- System
- Linux kernel
- Corpus path
arch/microblaze/mm/init.c- Extension
.c- Size
- 6928 bytes
- Lines
- 260
- Domain
- Architecture Layer
- Bucket
- arch/microblaze
- 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.
Dependency Surface
linux/dma-map-ops.hlinux/memblock.hlinux/init.hlinux/kernel.hlinux/mm.hlinux/initrd.hlinux/of_fdt.hlinux/pagemap.hlinux/pfn.hlinux/slab.hlinux/swap.hlinux/export.hasm/page.hasm/mmu_context.hasm/pgalloc.hasm/sections.hasm/tlb.hasm/fixmap.h
Detected Declarations
function highmem_initfunction arch_zone_limits_initfunction paging_initfunction setup_memoryfunction mem_initfunction page_is_ramfunction mm_cmdline_setupfunction mmu_init_hwfunction mmu_initexport memory_startexport memory_sizeexport min_low_pfnexport max_low_pfn
Annotated Snippet
if (maxmem && memory_size > maxmem) {
memory_size = maxmem;
memblock.memory.regions[0].size = memory_size;
}
}
}
/*
* MMU_init_hw does the chip-specific initialization of the MMU hardware.
*/
static void __init mmu_init_hw(void)
{
/*
* The Zone Protection Register (ZPR) defines how protection will
* be applied to every page which is a member of a given zone. At
* present, we utilize only two of the zones.
* The zone index bits (of ZSEL) in the PTE are used for software
* indicators, except the LSB. For user access, zone 1 is used,
* for kernel access, zone 0 is used. We set all but zone 1
* to zero, allowing only kernel access as indicated in the PTE.
* For zone 1, we set a 01 binary (a value of 10 will not work)
* to allow user access as indicated in the PTE. This also allows
* kernel access as indicated in the PTE.
*/
__asm__ __volatile__ ("ori r11, r0, 0x10000000;" \
"mts rzpr, r11;"
: : : "r11");
}
/*
* MMU_init sets up the basic memory mappings for the kernel,
* including both RAM and possibly some I/O regions,
* and sets up the page tables and the MMU hardware ready to go.
*/
/* called from head.S */
asmlinkage void __init mmu_init(void)
{
unsigned int kstart, ksize;
if ((u32) memblock.memory.regions[0].size < 0x400000) {
pr_emerg("Memory must be greater than 4MB\n");
machine_restart(NULL);
}
if ((u32) memblock.memory.regions[0].size < kernel_tlb) {
pr_emerg("Kernel size is greater than memory node\n");
machine_restart(NULL);
}
/* Find main memory where the kernel is */
memory_start = (u32) memblock.memory.regions[0].base;
lowmem_size = memory_size = (u32) memblock.memory.regions[0].size;
if (lowmem_size > CONFIG_LOWMEM_SIZE) {
lowmem_size = CONFIG_LOWMEM_SIZE;
#ifndef CONFIG_HIGHMEM
memory_size = lowmem_size;
#endif
}
mm_cmdline_setup(); /* FIXME parse args from command line - not used */
/*
* Map out the kernel text/data/bss from the available physical
* memory.
*/
kstart = __pa(CONFIG_KERNEL_START); /* kernel start */
/* kernel size */
ksize = PAGE_ALIGN(((u32)_end - (u32)CONFIG_KERNEL_START));
memblock_reserve(kstart, ksize);
#if defined(CONFIG_BLK_DEV_INITRD)
/* Remove the init RAM disk from the available memory. */
if (initrd_start) {
unsigned long size;
size = initrd_end - initrd_start;
memblock_reserve(__virt_to_phys(initrd_start), size);
}
#endif /* CONFIG_BLK_DEV_INITRD */
/* Initialize the MMU hardware */
mmu_init_hw();
/* Map in all of RAM starting at CONFIG_KERNEL_START */
mapin_ram();
/* Extend vmalloc and ioremap area as big as possible */
#ifdef CONFIG_HIGHMEM
ioremap_base = ioremap_bot = PKMAP_BASE;
Annotation
- Immediate include surface: `linux/dma-map-ops.h`, `linux/memblock.h`, `linux/init.h`, `linux/kernel.h`, `linux/mm.h`, `linux/initrd.h`, `linux/of_fdt.h`, `linux/pagemap.h`.
- Detected declarations: `function highmem_init`, `function arch_zone_limits_init`, `function paging_init`, `function setup_memory`, `function mem_init`, `function page_is_ram`, `function mm_cmdline_setup`, `function mmu_init_hw`, `function mmu_init`, `export memory_start`.
- Atlas domain: Architecture Layer / arch/microblaze.
- 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.