/usr/src/linux-headers-5.15.0-190/arch/sparc/include/asm
NameSizeModeActions
adi.h1380644editdlrm
adi_64.h8120644editdlrm
agp.h4340644editdlrm
apb.h10820644editdlrm
asm-offsets.h350644editdlrm
asm-prototypes.h7290644editdlrm
asm.h11010644editdlrm
asmmacro.h11830644editdlrm
atomic.h2190644editdlrm
atomic_32.h17600644editdlrm
atomic_64.h18490644editdlrm
auxio.h3100644editdlrm
auxio_32.h26150644editdlrm
auxio_64.h32530644editdlrm
backoff.h27560644editdlrm
barrier.h2230644editdlrm
barrier_32.h1600644editdlrm
barrier_64.h20040644editdlrm
bbc.h99960644editdlrm
bitext.h6310644editdlrm
bitops.h2190644editdlrm
bitops_32.h28530644editdlrm
bitops_64.h16750644editdlrm
btext.h1450644editdlrm
bug.h5880644editdlrm
cache.h6300644editdlrm
cacheflush.h3730644editdlrm
cacheflush_32.h19510644editdlrm
cacheflush_64.h25570644editdlrm
cachetlb_32.h8820644editdlrm
chafsr.h97100644editdlrm
checksum.h3310644editdlrm
checksum_32.h57910644editdlrm
checksum_64.h38550644editdlrm
chmctrl.h80960644editdlrm
clock.h2310644editdlrm
clocksource.h4070644editdlrm
cmpxchg.h2230644editdlrm
cmpxchg_32.h24830644editdlrm
cmpxchg_64.h52880644editdlrm
compat.h38900644editdlrm
compat_signal.h5650644editdlrm
contregs.h19410644editdlrm
cpudata.h3780644editdlrm
cpudata_32.h7290644editdlrm
cpudata_64.h11530644editdlrm
cpu_type.h5790644editdlrm
current.h9910644editdlrm
dcr.h7280644editdlrm
dcu.h15200644editdlrm
delay.h2150644editdlrm
delay_32.h9070644editdlrm
delay_64.h4030644editdlrm
device.h5650644editdlrm
dma-mapping.h3360644editdlrm
dma.h49890644editdlrm
ebus_dma.h10980644editdlrm
ecc.h44480644editdlrm
eeprom.h2540644editdlrm
elf.h2070644editdlrm
elf_32.h32670644editdlrm
elf_64.h68480644editdlrm
estate.h22870644editdlrm
extable.h7230644editdlrm
fb.h6800644editdlrm
fbio.h23150644editdlrm
fhc.h45330644editdlrm
floppy.h2190644editdlrm
floppy_32.h97960644editdlrm
floppy_64.h193920644editdlrm
fpumacro.h7100644editdlrm
ftrace.h8010644editdlrm
futex.h2150644editdlrm
futex_32.h820644editdlrm
futex_64.h21600644editdlrm
hardirq.h2230644editdlrm
hardirq_32.h3340644editdlrm
hardirq_64.h4120644editdlrm
head.h2110644editdlrm
head_32.h26170644editdlrm
head_64.h21840644editdlrm
hibernate.h4210644editdlrm
highmem.h19660644editdlrm
hugetlb.h15920644editdlrm
hvtramp.h7820644editdlrm
hw_irq.h880644editdlrm
hypervisor.h1176490644editdlrm
ide.h22220644editdlrm
idprom.h6560644editdlrm
intr_queue.h7940644editdlrm
io-unit.h24690644editdlrm
io.h6200644editdlrm
ioctls.h3580644editdlrm
iommu-common.h14450644editdlrm
iommu.h2150644editdlrm
iommu_32.h58650644editdlrm
iommu_64.h24890644editdlrm
io_32.h34300644editdlrm
io_64.h110760644editdlrm
irq.h2070644editdlrm
irqflags.h2270644editdlrm
irqflags_32.h10580644editdlrm
irqflags_64.h19520644editdlrm
irq_32.h5260644editdlrm
irq_64.h31050644editdlrm
jump_label.h10360644editdlrm
Kbuild1770644editdlrm
kdebug.h2190644editdlrm
kdebug_32.h20410644editdlrm
kdebug_64.h3930644editdlrm
kgdb.h10140644editdlrm
kprobes.h14100644editdlrm
ldc.h44750644editdlrm
leon.h78440644editdlrm
leon_amba.h82800644editdlrm
leon_pci.h5120644editdlrm
lsu.h10620644editdlrm
machines.h15400644editdlrm
mbus.h29960644editdlrm
mc146818rtc.h2980644editdlrm
mc146818rtc_32.h6990644editdlrm
mc146818rtc_64.h6890644editdlrm
mdesc.h30660644editdlrm
memctrl.h3110644editdlrm
mman.h26330644editdlrm
mmu.h2070644editdlrm
mmu_32.h2090644editdlrm
mmu_64.h39670644editdlrm
mmu_context.h2390644editdlrm
mmu_context_32.h10820644editdlrm
mmu_context_64.h54810644editdlrm
mmzone.h3630644editdlrm
mxcc.h44290644editdlrm
nmi.h3540644editdlrm
ns87303.h32990644editdlrm
obio.h64100644editdlrm
openprom.h74750644editdlrm
oplib.h2150644editdlrm
oplib_32.h60620644editdlrm
oplib_64.h83570644editdlrm
page.h2740644editdlrm
page_32.h38260644editdlrm
page_64.h47530644editdlrm
parport.h58190644editdlrm
pbm.h15050644editdlrm
pci.h13670644editdlrm
pcic.h59040644editdlrm
pcr.h18930644editdlrm
percpu.h2190644editdlrm
percpu_32.h1680644editdlrm
percpu_64.h5410644editdlrm
perf_event.h8020644editdlrm
pgalloc.h2230644editdlrm
pgalloc_32.h18230644editdlrm
pgalloc_64.h27640644editdlrm
pgtable.h2230644editdlrm
pgtable_32.h110210644editdlrm
pgtable_64.h323690644editdlrm
pgtsrmmu.h48790644editdlrm
pil.h11090644editdlrm
processor.h2310644editdlrm
processor_32.h28360644editdlrm
processor_64.h75770644editdlrm
prom.h17760644editdlrm
psr.h14140644editdlrm
ptrace.h42940644editdlrm
qrwlock.h2050644editdlrm
qspinlock.h2150644editdlrm
ross.h56550644editdlrm
sbi.h34250644editdlrm
scratchpad.h5470644editdlrm
seccomp.h2250644editdlrm
sections.h2890644editdlrm
setup.h15520644editdlrm
sfafsr.h32160644editdlrm
sfp-machine.h2390644editdlrm
sfp-machine_32.h69540644editdlrm
sfp-machine_64.h31780644editdlrm
shmparam.h2270644editdlrm
shmparam_32.h2530644editdlrm
shmparam_64.h3060644editdlrm
sigcontext.h26160644editdlrm
signal.h3510644editdlrm
smp.h2070644editdlrm
smp_32.h33680644editdlrm
smp_64.h17910644editdlrm
sparsemem.h2950644editdlrm
spinlock.h2270644editdlrm
spinlock_32.h43240644editdlrm
spinlock_64.h4090644editdlrm
spinlock_types.h5490644editdlrm
spitfire.h99670644editdlrm
stacktrace.h1660644editdlrm
starfire.h4180644editdlrm
string.h12540644editdlrm
string_32.h4050644editdlrm
string_64.h4090644editdlrm
sunbpp.h33460644editdlrm
swift.h31470644editdlrm
switch_to.h2310644editdlrm
switch_to_32.h36160644editdlrm
switch_to_64.h26400644editdlrm
syscall.h34640644editdlrm
syscalls.h2990644editdlrm
termbits.h1980644editdlrm
termios.h50630644editdlrm
thread_info.h2390644editdlrm
thread_info_32.h37730644editdlrm
thread_info_64.h81950644editdlrm
timer.h2150644editdlrm
timer_32.h12110644editdlrm
timer_64.h24480644editdlrm
timex.h2150644editdlrm
timex_32.h2660644editdlrm
timex_64.h4230644editdlrm
tlb.h2070644editdlrm
tlbflush.h2270644editdlrm
tlbflush_32.h6210644editdlrm
tlbflush_64.h17760644editdlrm
tlb_32.h1380644editdlrm
tlb_64.h10560644editdlrm
topology.h2270644editdlrm
topology_32.h1700644editdlrm
topology_64.h15460644editdlrm
traps.h5770644editdlrm
trap_block.h67860644editdlrm
tsb.h124570644editdlrm
tsunami.h18900644editdlrm
ttable.h208270644editdlrm
turbosparc.h38660644editdlrm
uaccess.h3900644editdlrm
uaccess_32.h70320644editdlrm
uaccess_64.h61420644editdlrm
unistd.h17970644editdlrm
upa.h38080644editdlrm
uprobes.h13040644editdlrm
user.h1020644editdlrm
vaddrs.h20660644editdlrm
vdso.h4910644editdlrm
vga.h9640644editdlrm
viking.h83410644editdlrm
vio.h120970644editdlrm
visasm.h15440644editdlrm
vmalloc.h930644editdlrm
vvar.h15770644editdlrm
winmacro.h47670644editdlrm
xor.h2070644editdlrm
xor_32.h70860644editdlrm
xor_64.h21560644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/arch/sparc/include/asm/pgtable_32.h (11021B)
/* SPDX-License-Identifier: GPL-2.0 */ #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 #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 __ASSEMBLY__ #include #include #include #include #include #include #include #include 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; /* xwr */ #define __P000 PAGE_NONE #define __P001 PAGE_READONLY #define __P010 PAGE_COPY #define __P011 PAGE_COPY #define __P100 PAGE_READONLY #define __P101 PAGE_READONLY #define __P110 PAGE_COPY #define __P111 PAGE_COPY #define __S000 PAGE_NONE #define __S001 PAGE_READONLY #define __S010 PAGE_SHARED #define __S011 PAGE_SHARED #define __S100 PAGE_READONLY #define __S101 PAGE_READONLY #define __S110 PAGE_SHARED #define __S111 PAGE_SHARED /* 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; /* * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc.. */ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) /* * 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) { srmmu_swap((unsigned long *)ptep, pte_val(pteval)); } #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) static inline int srmmu_device_memory(unsigned long x) { return ((x & 0xF0000000) != 0); } static inline struct page *pmd_page(pmd_t pmd) { if (srmmu_device_memory(pmd_val(pmd))) BUG(); return pfn_to_page((pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4)); } static inline unsigned long __pmd_page(pmd_t pmd) { unsigned long v; if (srmmu_device_memory(pmd_val(pmd))) BUG(); v = pmd_val(pmd) & SRMMU_PTD_PMASK; return (unsigned long)__nocache_va(v << 4); } static inline unsigned long pmd_page_vaddr(pmd_t pmd) { unsigned long v = pmd_val(pmd) & SRMMU_PTD_PMASK; return (unsigned long)__nocache_va(v << 4); } static inline pmd_t *pud_pgtable(pud_t pud) { if (srmmu_device_memory(pud_val(pud))) { return (pmd_t *)~0; } else { unsigned long v = pud_val(pud) & SRMMU_PTD_PMASK; return (pmd_t *)__nocache_va(v << 4); } } static inline int pte_present(pte_t pte) { return ((pte_val(pte) & SRMMU_ET_MASK) == SRMMU_ET_PTE); } static inline int pte_none(pte_t pte) { return !pte_val(pte); } static inline void __pte_clear(pte_t *ptep) { set_pte(ptep, __pte(0)); } static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { __pte_clear(ptep); } static inline int pmd_bad(pmd_t pmd) { return (pmd_val(pmd) & SRMMU_ET_MASK) != SRMMU_ET_PTD; } static inline int pmd_present(pmd_t pmd) { return ((pmd_val(pmd) & SRMMU_ET_MASK) == SRMMU_ET_PTD); } static inline int pmd_none(pmd_t pmd) { return !pmd_val(pmd); } static inline void pmd_clear(pmd_t *pmdp) { set_pte((pte_t *)&pmd_val(*pmdp), __pte(0)); } static inline int pud_none(pud_t pud) { return !(pud_val(pud) & 0xFFFFFFF); } static inline int pud_bad(pud_t pud) { return (pud_val(pud) & SRMMU_ET_MASK) != SRMMU_ET_PTD; } static inline int pud_present(pud_t pud) { return ((pud_val(pud) & SRMMU_ET_MASK) == SRMMU_ET_PTD); } static inline void pud_clear(pud_t *pudp) { set_pte((pte_t *)pudp, __pte(0)); } /* * The following only work if pte_present() is true. * Undefined behaviour if not.. */ static inline int pte_write(pte_t pte) { return pte_val(pte) & SRMMU_WRITE; } static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SRMMU_DIRTY; } static inline int pte_young(pte_t pte) { return pte_val(pte) & SRMMU_REF; } static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~SRMMU_WRITE); } static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~SRMMU_DIRTY); } static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~SRMMU_REF); } static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | SRMMU_WRITE); } static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | SRMMU_DIRTY); } static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | SRMMU_REF); } #define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) static inline unsigned long pte_pfn(pte_t pte) { if (srmmu_device_memory(pte_val(pte))) { /* Just return something that will cause * pfn_valid() to return false. This makes * copy_one_pte() to just directly copy to * PTE over. */ return ~0UL; } return (pte_val(pte) & SRMMU_PTE_PMASK) >> (PAGE_SHIFT-4); } #define pte_page(pte) pfn_to_page(pte_pfn(pte)) /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) { return __pte((page_to_pfn(page) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); } static inline pte_t mk_pte_phys(unsigned long page, pgprot_t pgprot) { return __pte(((page) >> 4) | pgprot_val(pgprot)); } static inline pte_t mk_pte_io(unsigned long page, pgprot_t pgprot, int space) { return __pte(((page) >> 4) | (space << 28) | pgprot_val(pgprot)); } #define pgprot_noncached pgprot_noncached static inline pgprot_t pgprot_noncached(pgprot_t prot) { pgprot_val(prot) &= ~pgprot_val(__pgprot(SRMMU_CACHE)); return prot; } static pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { return __pte((pte_val(pte) & SRMMU_CHG_MASK) | pgprot_val(newprot)); } /* only used by the huge vmap code, should never be called */ #define pud_page(pud) NULL struct seq_file; void mmu_info(struct seq_file *m); /* Fault handler stuff... */ #define FAULT_CODE_PROT 0x1 #define FAULT_CODE_WRITE 0x2 #define FAULT_CODE_USER 0x4 #define update_mmu_cache(vma, address, ptep) do { } while (0) void srmmu_mapiorange(unsigned int bus, unsigned long xpa, unsigned long xva, unsigned int len); void srmmu_unmapiorange(unsigned long virt_addr, unsigned int len); /* Encode and de-code a swap entry */ static inline unsigned long __swp_type(swp_entry_t entry) { return (entry.val >> SRMMU_SWP_TYPE_SHIFT) & SRMMU_SWP_TYPE_MASK; } static inline unsigned long __swp_offset(swp_entry_t entry) { return (entry.val >> SRMMU_SWP_OFF_SHIFT) & SRMMU_SWP_OFF_MASK; } static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset) { return (swp_entry_t) { (type & SRMMU_SWP_TYPE_MASK) << SRMMU_SWP_TYPE_SHIFT | (offset & SRMMU_SWP_OFF_MASK) << SRMMU_SWP_OFF_SHIFT }; } #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) static inline unsigned long __get_phys (unsigned long addr) { switch (sparc_cpu_model){ case sun4m: case sun4d: return ((srmmu_get_pte (addr) & 0xffffff00) << 4); default: return 0; } } static inline int __get_iospace (unsigned long addr) { switch (sparc_cpu_model){ case sun4m: case sun4d: return (srmmu_get_pte (addr) >> 28); default: return -1; } } extern unsigned long *sparc_valid_addr_bitmap; /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define kern_addr_valid(addr) \ (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap)) /* * For sparc32&64, the pfn in io_remap_pfn_range() carries in * its high 4 bits. These macros/functions put it there or get it from there. */ #define MK_IOSPACE_PFN(space, pfn) (pfn | (space << (BITS_PER_LONG - 4))) #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) #define GET_PFN(pfn) (pfn & 0x0fffffffUL) int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, unsigned long, pgprot_t); static inline int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot) { unsigned long long offset, space, phys_base; offset = ((unsigned long long) GET_PFN(pfn)) << PAGE_SHIFT; space = GET_IOSPACE(pfn); phys_base = offset | (space << 32ULL); return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot); } #define io_remap_pfn_range io_remap_pfn_range #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ ({ \ int __changed = !pte_same(*(__ptep), __entry); \ if (__changed) { \ set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ flush_tlb_page(__vma, __address); \ } \ __changed; \ }) #endif /* !(__ASSEMBLY__) */ #define VMALLOC_START _AC(0xfe600000,UL) #define VMALLOC_END _AC(0xffc00000,UL) /* We provide our own get_unmapped_area to cope with VA holes for userland */ #define HAVE_ARCH_UNMAPPED_AREA #define pmd_pgtable(pmd) ((pgtable_t)__pmd_page(pmd)) #endif /* !(_SPARC_PGTABLE_H) */