arch/sparc/include/asm/pgtable_32.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/pgtable_32.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/pgtable_32.h- Extension
.h- Size
- 10482 bytes
- Lines
- 427
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/const.hasm-generic/pgtable-nopud.hlinux/spinlock.hlinux/mm_types.hasm/types.hasm/pgtsrmmu.hasm/vaddrs.hasm/oplib.hasm/cpu_type.h
Detected Declarations
struct vm_area_structstruct pagestruct seq_filefunction srmmu_swapfunction set_ptefunction srmmu_device_memoryfunction pmd_pfnfunction __pmd_pagefunction pmd_page_vaddrfunction pte_presentfunction pte_nonefunction __pte_clearfunction pte_clearfunction pmd_badfunction pmd_presentfunction pmd_nonefunction pmd_clearfunction pud_nonefunction pud_badfunction pud_presentfunction pud_clearfunction pte_presentfunction pte_dirtyfunction pte_youngfunction pte_wrprotectfunction pte_mkcleanfunction pte_mkoldfunction pte_mkwrite_novmafunction pte_mkdirtyfunction pte_mkyoungfunction pfn_ptefunction pte_pfnfunction mk_pte_physfunction mk_pte_iofunction pgprot_noncachedfunction pte_modifyfunction __swp_typefunction __swp_offsetfunction __swp_entryfunction pte_swp_exclusivefunction pte_swp_mkexclusivefunction pte_swp_clear_exclusivefunction __get_physfunction __get_iospacefunction io_remap_pfn_range_pfn
Annotated Snippet
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
/* asm/pgtable.h: Defines and functions used to work
* with Sparc page tables.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
#include <linux/const.h>
#define PMD_SHIFT 18
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1))
#define PMD_ALIGN(__addr) (((__addr) + ~PMD_MASK) & PMD_MASK)
#define PGDIR_SHIFT 24
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PGDIR_MASK (~(PGDIR_SIZE-1))
#define PGDIR_ALIGN(__addr) (((__addr) + ~PGDIR_MASK) & PGDIR_MASK)
#ifndef __ASSEMBLER__
#include <asm-generic/pgtable-nopud.h>
#include <linux/spinlock.h>
#include <linux/mm_types.h>
#include <asm/types.h>
#include <asm/pgtsrmmu.h>
#include <asm/vaddrs.h>
#include <asm/oplib.h>
#include <asm/cpu_type.h>
struct vm_area_struct;
struct page;
void load_mmu(void);
unsigned long calc_highpages(void);
unsigned long __init bootmem_init(unsigned long *pages_avail);
#define pte_ERROR(e) __builtin_trap()
#define pmd_ERROR(e) __builtin_trap()
#define pgd_ERROR(e) __builtin_trap()
#define PTRS_PER_PTE 64
#define PTRS_PER_PMD 64
#define PTRS_PER_PGD 256
#define USER_PTRS_PER_PGD PAGE_OFFSET / PGDIR_SIZE
#define PTE_SIZE (PTRS_PER_PTE*4)
#define PAGE_NONE SRMMU_PAGE_NONE
#define PAGE_SHARED SRMMU_PAGE_SHARED
#define PAGE_COPY SRMMU_PAGE_COPY
#define PAGE_READONLY SRMMU_PAGE_RDONLY
#define PAGE_KERNEL SRMMU_PAGE_KERNEL
/* Top-level page directory - dummy used by init-mm.
* srmmu.c will assign the real one (which is dynamically sized) */
#define swapper_pg_dir NULL
void paging_init(void);
extern unsigned long ptr_in_current_pgd;
/* First physical page can be anywhere, the following is needed so that
* va-->pa and vice versa conversions work properly without performance
* hit for all __pa()/__va() operations.
*/
extern unsigned long phys_base;
extern unsigned long pfn_base;
/*
* In general all page table modifications should use the V8 atomic
* swap instruction. This insures the mmu and the cpu are in sync
* with respect to ref/mod bits in the page tables.
*/
static inline unsigned long srmmu_swap(unsigned long *addr, unsigned long value)
{
__asm__ __volatile__("swap [%2], %0" :
"=&r" (value) : "0" (value), "r" (addr) : "memory");
return value;
}
/* Certain architectures need to do special things when pte's
* within a page table are directly modified. Thus, the following
* hook is made available.
*/
static inline void set_pte(pte_t *ptep, pte_t pteval)
Annotation
- Immediate include surface: `linux/const.h`, `asm-generic/pgtable-nopud.h`, `linux/spinlock.h`, `linux/mm_types.h`, `asm/types.h`, `asm/pgtsrmmu.h`, `asm/vaddrs.h`, `asm/oplib.h`.
- Detected declarations: `struct vm_area_struct`, `struct page`, `struct seq_file`, `function srmmu_swap`, `function set_pte`, `function srmmu_device_memory`, `function pmd_pfn`, `function __pmd_page`, `function pmd_page_vaddr`, `function pte_present`.
- 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.