/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
mips
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/mips/include/asm
mkdir
upload
Name
Size
Mode
Actions
dec/
-
0755
rm
fw/
-
0755
rm
ip32/
-
0755
rm
mach-ar7/
-
0755
rm
mach-ath25/
-
0755
rm
mach-ath79/
-
0755
rm
mach-au1x00/
-
0755
rm
mach-bcm47xx/
-
0755
rm
mach-bcm63xx/
-
0755
rm
mach-bmips/
-
0755
rm
mach-cavium-octeon/
-
0755
rm
mach-cobalt/
-
0755
rm
mach-db1x00/
-
0755
rm
mach-dec/
-
0755
rm
mach-generic/
-
0755
rm
mach-ingenic/
-
0755
rm
mach-ip22/
-
0755
rm
mach-ip27/
-
0755
rm
mach-ip28/
-
0755
rm
mach-ip30/
-
0755
rm
mach-ip32/
-
0755
rm
mach-jazz/
-
0755
rm
mach-lantiq/
-
0755
rm
mach-loongson2ef/
-
0755
rm
mach-loongson32/
-
0755
rm
mach-loongson64/
-
0755
rm
mach-malta/
-
0755
rm
mach-n64/
-
0755
rm
mach-netlogic/
-
0755
rm
mach-pic32/
-
0755
rm
mach-ralink/
-
0755
rm
mach-rc32434/
-
0755
rm
mach-rm/
-
0755
rm
mach-sibyte/
-
0755
rm
mach-tx39xx/
-
0755
rm
mach-tx49xx/
-
0755
rm
mach-vr41xx/
-
0755
rm
mips-boards/
-
0755
rm
netlogic/
-
0755
rm
octeon/
-
0755
rm
pci/
-
0755
rm
sgi/
-
0755
rm
sibyte/
-
0755
rm
sn/
-
0755
rm
txx9/
-
0755
rm
vdso/
-
0755
rm
vr41xx/
-
0755
rm
xtalk/
-
0755
rm
abi.h
853
0644
edit
dl
rm
addrspace.h
4039
0644
edit
dl
rm
amon.h
409
0644
edit
dl
rm
arch_hweight.h
792
0644
edit
dl
rm
asm-eva.h
7343
0644
edit
dl
rm
asm-offsets.h
35
0644
edit
dl
rm
asm-prototypes.h
228
0644
edit
dl
rm
asm.h
6688
0644
edit
dl
rm
asmmacro-32.h
2529
0644
edit
dl
rm
asmmacro-64.h
1254
0644
edit
dl
rm
asmmacro.h
14639
0644
edit
dl
rm
atomic.h
8299
0644
edit
dl
rm
barrier.h
3507
0644
edit
dl
rm
bcache.h
2086
0644
edit
dl
rm
bitops.h
10914
0644
edit
dl
rm
bitrev.h
608
0644
edit
dl
rm
bmips-spaces.h
268
0644
edit
dl
rm
bmips.h
3097
0644
edit
dl
rm
bootinfo.h
4928
0644
edit
dl
rm
branch.h
2503
0644
edit
dl
rm
break.h
787
0644
edit
dl
rm
bug.h
759
0644
edit
dl
rm
bugs.h
640
0644
edit
dl
rm
cache.h
527
0644
edit
dl
rm
cacheflush.h
4863
0644
edit
dl
rm
cacheops.h
3801
0644
edit
dl
rm
cdmm.h
3761
0644
edit
dl
rm
cevt-r4k.h
823
0644
edit
dl
rm
checksum.h
5743
0644
edit
dl
rm
clocksource.h
273
0644
edit
dl
rm
cmp.h
492
0644
edit
dl
rm
cmpxchg.h
8880
0644
edit
dl
rm
compat-signal.h
640
0644
edit
dl
rm
compat.h
3866
0644
edit
dl
rm
compiler.h
2669
0644
edit
dl
rm
cop2.h
1812
0644
edit
dl
rm
cpu-features.h
22752
0644
edit
dl
rm
cpu-info.h
6303
0644
edit
dl
rm
cpu-type.h
4256
0644
edit
dl
rm
cpu.h
16955
0644
edit
dl
rm
cpufeature.h
510
0644
edit
dl
rm
debug.h
447
0644
edit
dl
rm
delay.h
841
0644
edit
dl
rm
div64.h
2223
0644
edit
dl
rm
dma-direct.h
255
0644
edit
dl
rm
dma-mapping.h
365
0644
edit
dl
rm
dma.h
10161
0644
edit
dl
rm
dmi.h
547
0644
edit
dl
rm
ds1287.h
333
0644
edit
dl
rm
dsemul.h
3595
0644
edit
dl
rm
dsp.h
1747
0644
edit
dl
rm
edac.h
839
0644
edit
dl
rm
elf.h
15559
0644
edit
dl
rm
elfcore-compat.h
841
0644
edit
dl
rm
errno.h
429
0644
edit
dl
rm
eva.h
796
0644
edit
dl
rm
exec.h
579
0644
edit
dl
rm
extable.h
241
0644
edit
dl
rm
fb.h
372
0644
edit
dl
rm
fixmap.h
2219
0644
edit
dl
rm
floppy.h
1609
0644
edit
dl
rm
fpregdef.h
2726
0644
edit
dl
rm
fpu.h
7332
0644
edit
dl
rm
fpu_emulator.h
4844
0644
edit
dl
rm
ftrace.h
2659
0644
edit
dl
rm
futex.h
5241
0644
edit
dl
rm
ginvt.h
1056
0644
edit
dl
rm
gio_device.h
1411
0644
edit
dl
rm
gt64120.h
19218
0644
edit
dl
rm
hardirq.h
544
0644
edit
dl
rm
hazards.h
8673
0644
edit
dl
rm
highmem.h
1741
0644
edit
dl
rm
hpet.h
1974
0644
edit
dl
rm
hugetlb.h
2165
0644
edit
dl
rm
hw_irq.h
475
0644
edit
dl
rm
i8259.h
2440
0644
edit
dl
rm
ide.h
330
0644
edit
dl
rm
idle.h
727
0644
edit
dl
rm
inst.h
2398
0644
edit
dl
rm
io.h
17334
0644
edit
dl
rm
irq.h
2408
0644
edit
dl
rm
irqflags.h
4206
0644
edit
dl
rm
irq_cpu.h
427
0644
edit
dl
rm
irq_gt641xx.h
2074
0644
edit
dl
rm
irq_regs.h
540
0644
edit
dl
rm
isa-rev.h
556
0644
edit
dl
rm
isadep.h
603
0644
edit
dl
rm
jazz.h
8192
0644
edit
dl
rm
jazzdma.h
2826
0644
edit
dl
rm
jump_label.h
1571
0644
edit
dl
rm
Kbuild
414
0644
edit
dl
rm
kdebug.h
303
0644
edit
dl
rm
kexec.h
1490
0644
edit
dl
rm
kgdb.h
1222
0644
edit
dl
rm
kprobes.h
1727
0644
edit
dl
rm
kvm_host.h
30488
0644
edit
dl
rm
kvm_types.h
184
0644
edit
dl
rm
linkage.h
306
0644
edit
dl
rm
llsc.h
923
0644
edit
dl
rm
local.h
5473
0644
edit
dl
rm
maar.h
4270
0644
edit
dl
rm
machine.h
2795
0644
edit
dl
rm
mc146818-time.h
3779
0644
edit
dl
rm
mc146818rtc.h
450
0644
edit
dl
rm
mips-cm.h
16857
0644
edit
dl
rm
mips-cpc.h
5766
0644
edit
dl
rm
mips-cps.h
6494
0644
edit
dl
rm
mips-gic.h
12387
0644
edit
dl
rm
mips-r2-to-r6-emul.h
2095
0644
edit
dl
rm
mipsmtregs.h
11171
0644
edit
dl
rm
mipsprom.h
2146
0644
edit
dl
rm
mipsregs.h
96792
0644
edit
dl
rm
mips_mt.h
707
0644
edit
dl
rm
mmiowb.h
197
0644
edit
dl
rm
mmu.h
555
0644
edit
dl
rm
mmu_context.h
6205
0644
edit
dl
rm
mmzone.h
427
0644
edit
dl
rm
module.h
2388
0644
edit
dl
rm
msa.h
7525
0644
edit
dl
rm
msc01_ic.h
6709
0644
edit
dl
rm
paccess.h
3140
0644
edit
dl
rm
page.h
7610
0644
edit
dl
rm
pci.h
3902
0644
edit
dl
rm
perf_event.h
336
0644
edit
dl
rm
pgalloc.h
2571
0644
edit
dl
rm
pgtable-32.h
8149
0644
edit
dl
rm
pgtable-64.h
9709
0644
edit
dl
rm
pgtable-bits.h
7852
0644
edit
dl
rm
pgtable.h
18529
0644
edit
dl
rm
pm-cps.h
1515
0644
edit
dl
rm
pm.h
3871
0644
edit
dl
rm
prefetch.h
2148
0644
edit
dl
rm
processor.h
11321
0644
edit
dl
rm
prom.h
696
0644
edit
dl
rm
ptrace.h
5582
0644
edit
dl
rm
r4k-timer.h
604
0644
edit
dl
rm
r4kcache.h
11373
0644
edit
dl
rm
reboot.h
440
0644
edit
dl
rm
reg.h
26
0644
edit
dl
rm
regdef.h
2693
0644
edit
dl
rm
rtlx.h
2148
0644
edit
dl
rm
seccomp.h
810
0644
edit
dl
rm
setup.h
941
0644
edit
dl
rm
sgialib.h
1743
0644
edit
dl
rm
sgiarcs.h
14022
0644
edit
dl
rm
shmparam.h
352
0644
edit
dl
rm
sigcontext.h
1060
0644
edit
dl
rm
signal.h
1042
0644
edit
dl
rm
sim.h
2070
0644
edit
dl
rm
smp-cps.h
998
0644
edit
dl
rm
smp-ops.h
2476
0644
edit
dl
rm
smp.h
3696
0644
edit
dl
rm
sni.h
7495
0644
edit
dl
rm
socket.h
1377
0644
edit
dl
rm
sparsemem.h
486
0644
edit
dl
rm
spinlock.h
822
0644
edit
dl
rm
spinlock_types.h
188
0644
edit
dl
rm
spram.h
261
0644
edit
dl
rm
stackframe.h
11157
0644
edit
dl
rm
stackprotector.h
1177
0644
edit
dl
rm
stacktrace.h
2199
0644
edit
dl
rm
string.h
692
0644
edit
dl
rm
switch_to.h
4455
0644
edit
dl
rm
sync.h
7823
0644
edit
dl
rm
syscall.h
3703
0644
edit
dl
rm
termios.h
2933
0644
edit
dl
rm
thread_info.h
6640
0644
edit
dl
rm
time.h
1617
0644
edit
dl
rm
timex.h
2937
0644
edit
dl
rm
tlb.h
613
0644
edit
dl
rm
tlbdebug.h
403
0644
edit
dl
rm
tlbex.h
977
0644
edit
dl
rm
tlbflush.h
1683
0644
edit
dl
rm
tlbmisc.h
320
0644
edit
dl
rm
topology.h
619
0644
edit
dl
rm
traps.h
1229
0644
edit
dl
rm
txx9irq.h
743
0644
edit
dl
rm
txx9pio.h
592
0644
edit
dl
rm
txx9tmr.h
1625
0644
edit
dl
rm
types.h
459
0644
edit
dl
rm
uaccess.h
16450
0644
edit
dl
rm
uasm.h
9578
0644
edit
dl
rm
unaligned-emul.h
26856
0644
edit
dl
rm
unistd.h
1860
0644
edit
dl
rm
unroll.h
2860
0644
edit
dl
rm
uprobes.h
1141
0644
edit
dl
rm
vdso.h
1469
0644
edit
dl
rm
vermagic.h
2372
0644
edit
dl
rm
vga.h
1291
0644
edit
dl
rm
vmalloc.h
90
0644
edit
dl
rm
vpe.h
2843
0644
edit
dl
rm
war.h
2282
0644
edit
dl
rm
watch.h
827
0644
edit
dl
rm
wbflush.h
694
0644
edit
dl
rm
yamon-dt.h
1717
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/mips/include/asm/pgtable.h
(18529B)
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2003 Ralf Baechle */ #ifndef _ASM_PGTABLE_H #define _ASM_PGTABLE_H #include <linux/mm_types.h> #include <linux/mmzone.h> #ifdef CONFIG_32BIT #include <asm/pgtable-32.h> #endif #ifdef CONFIG_64BIT #include <asm/pgtable-64.h> #endif #include <asm/cmpxchg.h> #include <asm/io.h> #include <asm/pgtable-bits.h> #include <asm/cpu-features.h> struct mm_struct; struct vm_area_struct; #define PAGE_SHARED vm_get_page_prot(VM_READ|VM_WRITE|VM_SHARED) #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ _PAGE_GLOBAL | _page_cachable_default) #define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT) #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) /* * If _PAGE_NO_EXEC is not defined, we can't do page protection for * execute, and consider it to be the same as read. Also, write * permissions imply read permissions. This is the closest we can get * by reasonable means.. */ /* * Dummy values to fill the table in mmap.c * The real values will be generated at runtime */ #define __P000 __pgprot(0) #define __P001 __pgprot(0) #define __P010 __pgprot(0) #define __P011 __pgprot(0) #define __P100 __pgprot(0) #define __P101 __pgprot(0) #define __P110 __pgprot(0) #define __P111 __pgprot(0) #define __S000 __pgprot(0) #define __S001 __pgprot(0) #define __S010 __pgprot(0) #define __S011 __pgprot(0) #define __S100 __pgprot(0) #define __S101 __pgprot(0) #define __S110 __pgprot(0) #define __S111 __pgprot(0) extern unsigned long _page_cachable_default; extern void __update_cache(unsigned long address, pte_t pte); /* * ZERO_PAGE is a global shared page that is always zero; used * for zero-mapped memory areas etc.. */ extern unsigned long empty_zero_page; extern unsigned long zero_page_mask; #define ZERO_PAGE(vaddr) \ (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) #define __HAVE_COLOR_ZERO_PAGE extern void paging_init(void); /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd)) #define __pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) #ifndef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_page(pmd) __pmd_page(pmd) #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #define pmd_page_vaddr(pmd) pmd_val(pmd) #define htw_stop() \ do { \ unsigned long __flags; \ \ if (cpu_has_htw) { \ local_irq_save(__flags); \ if(!raw_current_cpu_data.htw_seq++) { \ write_c0_pwctl(read_c0_pwctl() & \ ~(1 << MIPS_PWCTL_PWEN_SHIFT)); \ back_to_back_c0_hazard(); \ } \ local_irq_restore(__flags); \ } \ } while(0) #define htw_start() \ do { \ unsigned long __flags; \ \ if (cpu_has_htw) { \ local_irq_save(__flags); \ if (!--raw_current_cpu_data.htw_seq) { \ write_c0_pwctl(read_c0_pwctl() | \ (1 << MIPS_PWCTL_PWEN_SHIFT)); \ back_to_back_c0_hazard(); \ } \ local_irq_restore(__flags); \ } \ } while(0) static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval); #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) #ifdef CONFIG_XPA # define pte_none(pte) (!(((pte).pte_high) & ~_PAGE_GLOBAL)) #else # define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) #endif #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) #define pte_no_exec(pte) ((pte).pte_low & _PAGE_NO_EXEC) static inline void set_pte(pte_t *ptep, pte_t pte) { ptep->pte_high = pte.pte_high; smp_wmb(); ptep->pte_low = pte.pte_low; #ifdef CONFIG_XPA if (pte.pte_high & _PAGE_GLOBAL) { #else if (pte.pte_low & _PAGE_GLOBAL) { #endif pte_t *buddy = ptep_buddy(ptep); /* * Make sure the buddy is global too (if it's !none, * it better already be global) */ if (pte_none(*buddy)) { if (!IS_ENABLED(CONFIG_XPA)) buddy->pte_low |= _PAGE_GLOBAL; buddy->pte_high |= _PAGE_GLOBAL; } } } static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { pte_t null = __pte(0); htw_stop(); /* Preserve global status for the pair */ if (IS_ENABLED(CONFIG_XPA)) { if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL) null.pte_high = _PAGE_GLOBAL; } else { if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL) null.pte_low = null.pte_high = _PAGE_GLOBAL; } set_pte_at(mm, addr, ptep, null); htw_start(); } #else #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) #define pte_no_exec(pte) (pte_val(pte) & _PAGE_NO_EXEC) /* * 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) { *ptep = pteval; #if !defined(CONFIG_CPU_R3K_TLB) if (pte_val(pteval) & _PAGE_GLOBAL) { pte_t *buddy = ptep_buddy(ptep); /* * Make sure the buddy is global too (if it's !none, * it better already be global) */ # if defined(CONFIG_PHYS_ADDR_T_64BIT) && !defined(CONFIG_CPU_MIPS32) cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL); # else cmpxchg(&buddy->pte, 0, _PAGE_GLOBAL); # endif } #endif } static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { htw_stop(); #if !defined(CONFIG_CPU_R3K_TLB) /* Preserve global status for the pair */ if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL) set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL)); else #endif set_pte_at(mm, addr, ptep, __pte(0)); htw_start(); } #endif static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) { if (!pte_present(pteval)) goto cache_sync_done; if (pte_present(*ptep) && (pte_pfn(*ptep) == pte_pfn(pteval))) goto cache_sync_done; __update_cache(addr, pteval); cache_sync_done: set_pte(ptep, pteval); } /* * (pmds are folded into puds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) #ifndef __PAGETABLE_PMD_FOLDED /* * (puds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0) #endif #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1) #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) /* * We used to declare this array with size but gcc 3.3 and older are not able * to find that this expression is a constant, so the size is dropped. */ extern pgd_t swapper_pg_dir[]; /* * Platform specific pte_special() and pte_mkspecial() definitions * are required only when ARCH_HAS_PTE_SPECIAL is enabled. */ #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL) #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) static inline int pte_special(pte_t pte) { return pte.pte_low & _PAGE_SPECIAL; } static inline pte_t pte_mkspecial(pte_t pte) { pte.pte_low |= _PAGE_SPECIAL; return pte; } #else static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; } static inline pte_t pte_mkspecial(pte_t pte) { pte_val(pte) |= _PAGE_SPECIAL; return pte; } #endif #endif /* CONFIG_ARCH_HAS_PTE_SPECIAL */ /* * The following only work if pte_present() is true. * Undefined behaviour if not.. */ #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } static inline pte_t pte_wrprotect(pte_t pte) { pte.pte_low &= ~_PAGE_WRITE; if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low &= ~_PAGE_SILENT_WRITE; pte.pte_high &= ~_PAGE_SILENT_WRITE; return pte; } static inline pte_t pte_mkclean(pte_t pte) { pte.pte_low &= ~_PAGE_MODIFIED; if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low &= ~_PAGE_SILENT_WRITE; pte.pte_high &= ~_PAGE_SILENT_WRITE; return pte; } static inline pte_t pte_mkold(pte_t pte) { pte.pte_low &= ~_PAGE_ACCESSED; if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low &= ~_PAGE_SILENT_READ; pte.pte_high &= ~_PAGE_SILENT_READ; return pte; } static inline pte_t pte_mkwrite(pte_t pte) { pte.pte_low |= _PAGE_WRITE; if (pte.pte_low & _PAGE_MODIFIED) { if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low |= _PAGE_SILENT_WRITE; pte.pte_high |= _PAGE_SILENT_WRITE; } return pte; } static inline pte_t pte_mkdirty(pte_t pte) { pte.pte_low |= _PAGE_MODIFIED; if (pte.pte_low & _PAGE_WRITE) { if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low |= _PAGE_SILENT_WRITE; pte.pte_high |= _PAGE_SILENT_WRITE; } return pte; } static inline pte_t pte_mkyoung(pte_t pte) { pte.pte_low |= _PAGE_ACCESSED; if (!(pte.pte_low & _PAGE_NO_READ)) { if (!IS_ENABLED(CONFIG_XPA)) pte.pte_low |= _PAGE_SILENT_READ; pte.pte_high |= _PAGE_SILENT_READ; } return pte; } #else static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); return pte; } static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); return pte; } static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); return pte; } static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; if (pte_val(pte) & _PAGE_MODIFIED) pte_val(pte) |= _PAGE_SILENT_WRITE; return pte; } static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_MODIFIED | _PAGE_SOFT_DIRTY; if (pte_val(pte) & _PAGE_WRITE) pte_val(pte) |= _PAGE_SILENT_WRITE; return pte; } static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; if (!(pte_val(pte) & _PAGE_NO_READ)) pte_val(pte) |= _PAGE_SILENT_READ; return pte; } #define pte_sw_mkyoung pte_mkyoung #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; } static inline pte_t pte_mkhuge(pte_t pte) { pte_val(pte) |= _PAGE_HUGE; return pte; } #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */ #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY static inline bool pte_soft_dirty(pte_t pte) { return pte_val(pte) & _PAGE_SOFT_DIRTY; } #define pte_swp_soft_dirty pte_soft_dirty static inline pte_t pte_mksoft_dirty(pte_t pte) { pte_val(pte) |= _PAGE_SOFT_DIRTY; return pte; } #define pte_swp_mksoft_dirty pte_mksoft_dirty static inline pte_t pte_clear_soft_dirty(pte_t pte) { pte_val(pte) &= ~(_PAGE_SOFT_DIRTY); return pte; } #define pte_swp_clear_soft_dirty pte_clear_soft_dirty #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */ #endif /* * Macro to make mark a page protection value as "uncacheable". Note * that "protection" is really a misnomer here as the protection value * contains the memory attribute bits, dirty bits, and various other * bits as well. */ #define pgprot_noncached pgprot_noncached static inline pgprot_t pgprot_noncached(pgprot_t _prot) { unsigned long prot = pgprot_val(_prot); prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED; return __pgprot(prot); } #define pgprot_writecombine pgprot_writecombine static inline pgprot_t pgprot_writecombine(pgprot_t _prot) { unsigned long prot = pgprot_val(_prot); /* cpu_data[0].writecombine is already shifted by _CACHE_SHIFT */ prot = (prot & ~_CACHE_MASK) | cpu_data[0].writecombine; return __pgprot(prot); } static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma, unsigned long address) { } #define __HAVE_ARCH_PTE_SAME static inline int pte_same(pte_t pte_a, pte_t pte_b) { return pte_val(pte_a) == pte_val(pte_b); } #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS static inline int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address, pte_t *ptep, pte_t entry, int dirty) { if (!pte_same(*ptep, entry)) set_pte_at(vma->vm_mm, address, ptep, entry); /* * update_mmu_cache will unconditionally execute, handling both * the case that the PTE changed and the spurious fault case. */ return true; } /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) #if defined(CONFIG_XPA) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { pte.pte_low &= (_PAGE_MODIFIED | _PAGE_ACCESSED | _PFNX_MASK); pte.pte_high &= (_PFN_MASK | _CACHE_MASK); pte.pte_low |= pgprot_val(newprot) & ~_PFNX_MASK; pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK); return pte; } #elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { pte.pte_low &= _PAGE_CHG_MASK; pte.pte_high &= (_PFN_MASK | _CACHE_MASK); pte.pte_low |= pgprot_val(newprot); pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK); return pte; } #else static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { pte_val(pte) &= _PAGE_CHG_MASK; pte_val(pte) |= pgprot_val(newprot) & ~_PAGE_CHG_MASK; if ((pte_val(pte) & _PAGE_ACCESSED) && !(pte_val(pte) & _PAGE_NO_READ)) pte_val(pte) |= _PAGE_SILENT_READ; return pte; } #endif extern void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte); static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { pte_t pte = *ptep; __update_tlb(vma, address, pte); } #define __HAVE_ARCH_UPDATE_MMU_TLB #define update_mmu_tlb update_mmu_cache static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { pte_t pte = *(pte_t *)pmdp; __update_tlb(vma, address, pte); } #define kern_addr_valid(addr) (1) /* * Allow physical addresses to be fixed up to help 36-bit peripherals. */ #ifdef CONFIG_MIPS_FIXUP_BIGPHYS_ADDR phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size); int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long vaddr, unsigned long pfn, unsigned long size, pgprot_t prot); #define io_remap_pfn_range io_remap_pfn_range #else #define fixup_bigphys_addr(addr, size) (addr) #endif /* CONFIG_MIPS_FIXUP_BIGPHYS_ADDR */ #ifdef CONFIG_TRANSPARENT_HUGEPAGE /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/ #define pmdp_establish generic_pmdp_establish #define has_transparent_hugepage has_transparent_hugepage extern int has_transparent_hugepage(void); static inline int pmd_trans_huge(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_HUGE); } static inline pmd_t pmd_mkhuge(pmd_t pmd) { pmd_val(pmd) |= _PAGE_HUGE; return pmd; } extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pmd_t pmd); #define pmd_write pmd_write static inline int pmd_write(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_WRITE); } static inline pmd_t pmd_wrprotect(pmd_t pmd) { pmd_val(pmd) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); return pmd; } static inline pmd_t pmd_mkwrite(pmd_t pmd) { pmd_val(pmd) |= _PAGE_WRITE; if (pmd_val(pmd) & _PAGE_MODIFIED) pmd_val(pmd) |= _PAGE_SILENT_WRITE; return pmd; } static inline int pmd_dirty(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_MODIFIED); } static inline pmd_t pmd_mkclean(pmd_t pmd) { pmd_val(pmd) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); return pmd; } static inline pmd_t pmd_mkdirty(pmd_t pmd) { pmd_val(pmd) |= _PAGE_MODIFIED | _PAGE_SOFT_DIRTY; if (pmd_val(pmd) & _PAGE_WRITE) pmd_val(pmd) |= _PAGE_SILENT_WRITE; return pmd; } static inline int pmd_young(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_ACCESSED); } static inline pmd_t pmd_mkold(pmd_t pmd) { pmd_val(pmd) &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ); return pmd; } static inline pmd_t pmd_mkyoung(pmd_t pmd) { pmd_val(pmd) |= _PAGE_ACCESSED; if (!(pmd_val(pmd) & _PAGE_NO_READ)) pmd_val(pmd) |= _PAGE_SILENT_READ; return pmd; } #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY static inline int pmd_soft_dirty(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_SOFT_DIRTY); } static inline pmd_t pmd_mksoft_dirty(pmd_t pmd) { pmd_val(pmd) |= _PAGE_SOFT_DIRTY; return pmd; } static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd) { pmd_val(pmd) &= ~(_PAGE_SOFT_DIRTY); return pmd; } #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */ /* Extern to avoid header file madness */ extern pmd_t mk_pmd(struct page *page, pgprot_t prot); static inline unsigned long pmd_pfn(pmd_t pmd) { return pmd_val(pmd) >> _PFN_SHIFT; } static inline struct page *pmd_page(pmd_t pmd) { if (pmd_trans_huge(pmd)) return pfn_to_page(pmd_pfn(pmd)); return pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT); } static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) { pmd_val(pmd) = (pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HUGE)) | (pgprot_val(newprot) & ~_PAGE_CHG_MASK); return pmd; } static inline pmd_t pmd_mkinvalid(pmd_t pmd) { pmd_val(pmd) &= ~(_PAGE_PRESENT | _PAGE_VALID | _PAGE_DIRTY); return pmd; } /* * The generic version pmdp_huge_get_and_clear uses a version of pmd_clear() with a * different prototype. */ #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long address, pmd_t *pmdp) { pmd_t old = *pmdp; pmd_clear(pmdp); return old; } #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #ifdef _PAGE_HUGE #define pmd_leaf(pmd) ((pmd_val(pmd) & _PAGE_HUGE) != 0) #define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) #endif #define gup_fast_permitted(start, end) (!cpu_has_dc_aliases) /* * We provide our own get_unmapped area to cope with the virtual aliasing * constraints placed on us by the cache architecture. */ #define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #endif /* _ASM_PGTABLE_H */
Save
cmd:
run