arch/x86/platform/efi/memmap.c
Source file repositories/reference/linux-study-clean/arch/x86/platform/efi/memmap.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/platform/efi/memmap.c- Extension
.c- Size
- 6330 bytes
- Lines
- 248
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- 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/init.hlinux/kernel.hlinux/efi.hlinux/io.hasm/early_ioremap.hasm/efi.hlinux/memblock.hlinux/slab.h
Detected Declarations
function __efi_memmap_alloc_earlyfunction __efi_memmap_alloc_latefunction __efi_memmap_freefunction mm_initfunction efi_memmap_installfunction efi_memmap_split_countfunction efi_memmap_split_count
Annotated Snippet
if ((start < m_start && m_start < end) && m_end < end) {
/* first part */
md->num_pages = (m_start - md->phys_addr) >>
EFI_PAGE_SHIFT;
/* middle part */
new += old_memmap->desc_size;
memcpy(new, old, old_memmap->desc_size);
md = new;
md->attribute |= m_attr;
md->phys_addr = m_start;
md->num_pages = (m_end - m_start + 1) >>
EFI_PAGE_SHIFT;
/* last part */
new += old_memmap->desc_size;
memcpy(new, old, old_memmap->desc_size);
md = new;
md->phys_addr = m_end + 1;
md->num_pages = (end - m_end) >>
EFI_PAGE_SHIFT;
}
if ((start < m_start && m_start < end) &&
(end <= m_end)) {
/* first part */
md->num_pages = (m_start - md->phys_addr) >>
EFI_PAGE_SHIFT;
/* latter part */
new += old_memmap->desc_size;
memcpy(new, old, old_memmap->desc_size);
md = new;
md->phys_addr = m_start;
md->num_pages = (end - md->phys_addr + 1) >>
EFI_PAGE_SHIFT;
md->attribute |= m_attr;
}
}
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/efi.h`, `linux/io.h`, `asm/early_ioremap.h`, `asm/efi.h`, `linux/memblock.h`, `linux/slab.h`.
- Detected declarations: `function __efi_memmap_alloc_early`, `function __efi_memmap_alloc_late`, `function __efi_memmap_free`, `function mm_init`, `function efi_memmap_install`, `function efi_memmap_split_count`, `function efi_memmap_split_count`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source 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.