arch/powerpc/include/asm/book3s/32/pgtable.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/book3s/32/pgtable.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/book3s/32/pgtable.h- Extension
.h- Size
- 18717 bytes
- Lines
- 614
- 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.
- 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
asm-generic/pgtable-nopmd.hasm/pgtable-masks.hasm/kasan.hlinux/sched.hlinux/threads.hlinux/page_table_check.h
Detected Declarations
function pmd_clearfunction flush_hash_entryfunction pte_updatefunction __ptep_test_and_clear_youngfunction ptep_get_and_clearfunction ptep_set_wrprotectfunction __ptep_set_access_flagsfunction PTEsfunction pte_swp_mkexclusivefunction pte_swp_clear_exclusivefunction pte_readfunction pte_writefunction pte_dirtyfunction pte_youngfunction pte_specialfunction pte_nonefunction pte_execfunction pte_presentfunction pte_hw_validfunction pte_hashptefunction pte_cifunction pte_access_permittedfunction pte_user_accessible_pagefunction pfn_ptefunction pte_wrprotectfunction pte_exprotectfunction pte_mkcleanfunction pte_mkoldfunction pte_mkexecfunction pte_mkptefunction pte_mkwrite_novmafunction pte_mkdirtyfunction pte_mkyoungfunction pte_mkspecialfunction pte_mkhugefunction pte_modifyfunction yetfunction pgprot_noncachedfunction pgprot_noncached_wcfunction pgprot_cachedfunction pgprot_cached_wthrufunction pgprot_cached_noncoherentfunction pgprot_writecombine
Annotated Snippet
static inline int pte_dirty(pte_t pte) { return !!(pte_val(pte) & _PAGE_DIRTY); }
static inline int pte_young(pte_t pte) { return !!(pte_val(pte) & _PAGE_ACCESSED); }
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_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 bool pte_hashpte(pte_t pte)
{
return !!(pte_val(pte) & _PAGE_HASHPTE);
}
static inline bool pte_ci(pte_t pte)
{
return !!(pte_val(pte) & _PAGE_NO_CACHE);
}
/*
* 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_wrprotect(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_WRITE);
}
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_mkexec(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_EXEC);
}
static inline pte_t pte_mkpte(pte_t pte)
Annotation
- Immediate include surface: `asm-generic/pgtable-nopmd.h`, `asm/pgtable-masks.h`, `asm/kasan.h`, `linux/sched.h`, `linux/threads.h`, `linux/page_table_check.h`.
- Detected declarations: `function pmd_clear`, `function flush_hash_entry`, `function pte_update`, `function __ptep_test_and_clear_young`, `function ptep_get_and_clear`, `function ptep_set_wrprotect`, `function __ptep_set_access_flags`, `function PTEs`, `function pte_swp_mkexclusive`, `function pte_swp_clear_exclusive`.
- 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.