arch/sparc/include/asm/pgtable_64.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/pgtable_64.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/pgtable_64.h- Extension
.h- Size
- 33300 bytes
- Lines
- 1176
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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-nop4d.hlinux/compiler.hlinux/const.hasm/types.hasm/spitfire.hasm/asi.hasm/adi.hasm/page.hasm/processor.hlinux/sched.hasm/tlbflush.h
Detected Declarations
struct seq_filestruct vm_area_structfunction pfn_ptefunction pfn_pmdfunction pte_pfnfunction pte_modifyfunction pmd_modifyfunction pgprot_noncachedfunction pte_dirtyfunction pte_writefunction __pte_default_huge_maskfunction pte_mkhugefunction is_default_hugetlb_ptefunction is_hugetlb_pmdfunction is_hugetlb_pudfunction pmd_mkhugefunction is_hugetlb_ptefunction __pte_mkhwwritefunction pte_mkdirtyfunction pte_mkcleanfunction pte_mkwrite_novmafunction pte_wrprotectfunction pte_mkoldfunction pte_mkyoungfunction pte_mkspecialfunction pte_mkmcdfunction pte_mknotmcdfunction pte_youngfunction pte_execfunction pte_presentfunction pte_accessiblefunction pte_specialfunction pmd_leaffunction pmd_pfnfunction pmd_writefunction pmd_dirtyfunction pmd_youngfunction pmd_trans_hugefunction pmd_mkoldfunction pmd_wrprotectfunction pmd_mkdirtyfunction pmd_mkcleanfunction pmd_mkyoungfunction pmd_mkwrite_novmafunction pmd_pgprotfunction pmd_presentfunction set_pmd_atfunction pmd_set
Annotated Snippet
#ifndef _SPARC64_PGTABLE_H
#define _SPARC64_PGTABLE_H
/* This file contains the functions and defines necessary to modify and use
* the SpitFire page tables.
*/
#include <asm-generic/pgtable-nop4d.h>
#include <linux/compiler.h>
#include <linux/const.h>
#include <asm/types.h>
#include <asm/spitfire.h>
#include <asm/asi.h>
#include <asm/adi.h>
#include <asm/page.h>
#include <asm/processor.h>
/* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB).
* The page copy blockops can use 0x6000000 to 0x8000000.
* The 8K TSB is mapped in the 0x8000000 to 0x8400000 range.
* The 4M TSB is mapped in the 0x8400000 to 0x8800000 range.
* The PROM resides in an area spanning 0xf0000000 to 0x100000000.
* The vmalloc area spans 0x100000000 to 0x200000000.
* Since modules need to be in the lowest 32-bits of the address space,
* we place them right before the OBP area from 0x10000000 to 0xf0000000.
* There is a single static kernel PMD which maps from 0x0 to address
* 0x400000000.
*/
#define TLBTEMP_BASE _AC(0x0000000006000000,UL)
#define TSBMAP_8K_BASE _AC(0x0000000008000000,UL)
#define TSBMAP_4M_BASE _AC(0x0000000008400000,UL)
#define MODULES_VADDR _AC(0x0000000010000000,UL)
#define MODULES_LEN _AC(0x00000000e0000000,UL)
#define MODULES_END _AC(0x00000000f0000000,UL)
#define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL)
#define HI_OBP_ADDRESS _AC(0x0000000100000000,UL)
#define VMALLOC_START _AC(0x0000000100000000,UL)
#define VMEMMAP_BASE VMALLOC_END
/* PMD_SHIFT determines the size of the area a second-level page
* table can map
*/
#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3))
#define PMD_SIZE (_AC(1,UL) << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1))
#define PMD_BITS (PAGE_SHIFT - 3)
/* PUD_SHIFT determines the size of the area a third-level page
* table can map
*/
#define PUD_SHIFT (PMD_SHIFT + PMD_BITS)
#define PUD_SIZE (_AC(1,UL) << PUD_SHIFT)
#define PUD_MASK (~(PUD_SIZE-1))
#define PUD_BITS (PAGE_SHIFT - 3)
/* PGDIR_SHIFT determines what a fourth-level page table entry can map */
#define PGDIR_SHIFT (PUD_SHIFT + PUD_BITS)
#define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT)
#define PGDIR_MASK (~(PGDIR_SIZE-1))
#define PGDIR_BITS (PAGE_SHIFT - 3)
#if (MAX_PHYS_ADDRESS_BITS > PGDIR_SHIFT + PGDIR_BITS)
#error MAX_PHYS_ADDRESS_BITS exceeds what kernel page tables can support
#endif
#if (PGDIR_SHIFT + PGDIR_BITS) != 53
#error Page table parameters do not cover virtual address space properly.
#endif
#if (PMD_SHIFT != HPAGE_SHIFT)
#error PMD_SHIFT must equal HPAGE_SHIFT for transparent huge pages.
#endif
#ifndef __ASSEMBLER__
extern unsigned long VMALLOC_END;
#define vmemmap ((struct page *)VMEMMAP_BASE)
#include <linux/sched.h>
#include <asm/tlbflush.h>
bool kern_addr_valid(unsigned long addr);
/* Entries per page directory level. */
#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3))
#define PTRS_PER_PMD (1UL << PMD_BITS)
#define PTRS_PER_PUD (1UL << PUD_BITS)
#define PTRS_PER_PGD (1UL << PGDIR_BITS)
Annotation
- Immediate include surface: `asm-generic/pgtable-nop4d.h`, `linux/compiler.h`, `linux/const.h`, `asm/types.h`, `asm/spitfire.h`, `asm/asi.h`, `asm/adi.h`, `asm/page.h`.
- Detected declarations: `struct seq_file`, `struct vm_area_struct`, `function pfn_pte`, `function pfn_pmd`, `function pte_pfn`, `function pte_modify`, `function pmd_modify`, `function pgprot_noncached`, `function pte_dirty`, `function pte_write`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.