arch/loongarch/mm/hugetlbpage.c
Source file repositories/reference/linux-study-clean/arch/loongarch/mm/hugetlbpage.c
File Facts
- System
- Linux kernel
- Corpus path
arch/loongarch/mm/hugetlbpage.c- Extension
.c- Size
- 1420 bytes
- Lines
- 67
- Domain
- Architecture Layer
- Bucket
- arch/loongarch
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs.hlinux/mm.hlinux/hugetlb.hlinux/pagemap.hlinux/err.hlinux/sysctl.hasm/mman.hasm/tlb.hasm/tlbflush.h
Detected Declarations
function Copyrightfunction pmd_to_entrylo
Annotated Snippet
if (p4d_present(p4dp_get(p4d))) {
pud = pud_offset(p4d, addr);
if (pud_present(pudp_get(pud)))
pmd = pmd_offset(pud, addr);
}
}
return (!pmd || pmd_none(pmdp_get(pmd))) ? NULL : (pte_t *) pmd;
}
uint64_t pmd_to_entrylo(unsigned long pmd_val)
{
uint64_t val;
/* PMD as PTE. Must be huge page */
if (!pmd_leaf(__pmd(pmd_val)))
panic("%s", __func__);
val = pmd_val ^ _PAGE_HUGE;
val |= ((val & _PAGE_HGLOBAL) >>
(_PAGE_HGLOBAL_SHIFT - _PAGE_GLOBAL_SHIFT));
return val;
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/mm.h`, `linux/hugetlb.h`, `linux/pagemap.h`, `linux/err.h`, `linux/sysctl.h`, `asm/mman.h`, `asm/tlb.h`.
- Detected declarations: `function Copyright`, `function pmd_to_entrylo`.
- Atlas domain: Architecture Layer / arch/loongarch.
- 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.