arch/powerpc/include/asm/nohash/pgtable.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/nohash/pgtable.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/nohash/pgtable.h- Extension
.h- Size
- 10524 bytes
- Lines
- 389
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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
asm/nohash/64/pgtable.hasm/nohash/32/pgtable.hlinux/page_table_check.h
Detected Declarations
function pte_huge_sizefunction pte_updatefunction ptep_test_and_clear_youngfunction ptep_set_wrprotectfunction ptep_get_and_clearfunction pte_clearfunction __ptep_set_access_flagsfunction pte_mkwrite_novmafunction pte_mkdirtyfunction pte_mkyoungfunction pte_wrprotectfunction pte_mkexecfunction pte_writefunction pte_dirtyfunction pte_specialfunction pte_nonefunction pte_hashptefunction pte_cifunction pte_execfunction pte_presentfunction pte_hw_validfunction pte_youngfunction pte_readfunction pte_access_permittedfunction pte_user_accessible_pagefunction pfn_ptefunction pte_exprotectfunction pte_mkcleanfunction pte_mkoldfunction pte_mkspecialfunction pte_mkhugefunction pte_modifyfunction pte_swp_exclusivefunction pte_swp_mkexclusivefunction pte_swp_clear_exclusivefunction __set_pte_at
Annotated Snippet
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }
static inline bool pte_hashpte(pte_t pte) { return false; }
static inline bool pte_ci(pte_t pte) { return pte_val(pte) & _PAGE_NO_CACHE; }
static inline bool pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
static inline int pte_present(pte_t pte)
{
return pte_val(pte) & _PAGE_PRESENT;
}
static inline bool pte_hw_valid(pte_t pte)
{
return pte_val(pte) & _PAGE_PRESENT;
}
static inline int pte_young(pte_t pte)
{
return pte_val(pte) & _PAGE_ACCESSED;
}
/*
* Don't just check for any non zero bits in __PAGE_READ, since for book3e
* and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in
* _PAGE_READ. Need to explicitly match _PAGE_BAP_UR bit in that case too.
*/
#ifndef pte_read
static inline bool pte_read(pte_t pte)
{
return (pte_val(pte) & _PAGE_READ) == _PAGE_READ;
}
#endif
/*
* We only find page table entry in the last level
* Hence no need for other accessors
*/
#define pte_access_permitted pte_access_permitted
static inline bool pte_access_permitted(pte_t pte, bool write)
{
/*
* A read-only access is controlled by _PAGE_READ bit.
* We have _PAGE_READ set for WRITE
*/
if (!pte_present(pte) || !pte_read(pte))
return false;
if (write && !pte_write(pte))
return false;
return true;
}
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
{
return pte_present(pte) && !is_kernel_addr(addr);
}
/* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*
* Even if PTEs can be unsigned long long, a PFN is always an unsigned
* long for now.
*/
static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
pgprot_val(pgprot)); }
/* Generic modifiers for PTE bits */
static inline pte_t pte_exprotect(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_EXEC);
}
static inline pte_t pte_mkclean(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_DIRTY);
}
static inline pte_t pte_mkold(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_ACCESSED);
}
static inline pte_t pte_mkspecial(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_SPECIAL);
}
Annotation
- Immediate include surface: `asm/nohash/64/pgtable.h`, `asm/nohash/32/pgtable.h`, `linux/page_table_check.h`.
- Detected declarations: `function pte_huge_size`, `function pte_update`, `function ptep_test_and_clear_young`, `function ptep_set_wrprotect`, `function ptep_get_and_clear`, `function pte_clear`, `function __ptep_set_access_flags`, `function pte_mkwrite_novma`, `function pte_mkdirty`, `function pte_mkyoung`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.