/usr/src/linux-headers-5.15.0-190/arch/sh/include/asm
NameSizeModeActions
adc.h2110644editdlrm
addrspace.h18960644editdlrm
alignment.h6540644editdlrm
asm-offsets.h740644editdlrm
atomic-grb.h26770644editdlrm
atomic-irq.h16870644editdlrm
atomic-llsc.h21860644editdlrm
atomic.h8400644editdlrm
barrier.h15030644editdlrm
bitops-cas.h17700644editdlrm
bitops-grb.h63640644editdlrm
bitops-llsc.h28580644editdlrm
bitops-op32.h38420644editdlrm
bitops.h16530644editdlrm
bl_bit.h660644editdlrm
bl_bit_32.h6390644editdlrm
bug.h28350644editdlrm
cache.h11710644editdlrm
cacheflush.h37350644editdlrm
cache_insns.h710644editdlrm
cache_insns_32.h6420644editdlrm
checksum.h680644editdlrm
checksum_32.h50090644editdlrm
clock.h4360644editdlrm
cmpxchg-cas.h5490644editdlrm
cmpxchg-grb.h28690644editdlrm
cmpxchg-irq.h10650644editdlrm
cmpxchg-llsc.h10850644editdlrm
cmpxchg-xchg.h12740644editdlrm
cmpxchg.h18220644editdlrm
device.h4420644editdlrm
dma-register.h17080644editdlrm
dma.h36520644editdlrm
dmabrg.h5360644editdlrm
dwarf.h98960644editdlrm
elf.h60090644editdlrm
entry-macros.S18970644editdlrm
extable.h1350644editdlrm
fb.h4140644editdlrm
fixmap.h25430644editdlrm
flat.h8630644editdlrm
fpu.h16350644editdlrm
freq.h2120644editdlrm
ftrace.h11380644editdlrm
futex-cas.h7280644editdlrm
futex-irq.h4820644editdlrm
futex-llsc.h8700644editdlrm
futex.h13810644editdlrm
gpio.h8510644editdlrm
hardirq.h2670644editdlrm
hd64461.h120680644editdlrm
heartbeat.h3830644editdlrm
hugetlb.h9150644editdlrm
hw_breakpoint.h19700644editdlrm
hw_irq.h9150644editdlrm
i2c-sh7760.h4060644editdlrm
io.h86990644editdlrm
io_generic.h6610644editdlrm
io_noioport.h15020644editdlrm
io_trapped.h14740644editdlrm
irq.h16420644editdlrm
irqflags.h2260644editdlrm
Kbuild1410644editdlrm
kdebug.h4330644editdlrm
kexec.h26720644editdlrm
kgdb.h8510644editdlrm
kprobes.h14070644editdlrm
linkage.h1540644editdlrm
machvec.h8500644editdlrm
mmiowb.h2460644editdlrm
mmu.h22310644editdlrm
mmu_context.h41670644editdlrm
mmu_context_32.h11360644editdlrm
mmzone.h10520644editdlrm
module.h2760644editdlrm
page.h54190644editdlrm
pci.h30070644editdlrm
perf_event.h7970644editdlrm
pgalloc.h11070644editdlrm
pgtable-2level.h5670644editdlrm
pgtable-3level.h14640644editdlrm
pgtable.h43050644editdlrm
pgtable_32.h158990644editdlrm
platform_early.h18500644editdlrm
posix_types.h710644editdlrm
processor.h43420644editdlrm
processor_32.h46140644editdlrm
ptrace.h38340644editdlrm
ptrace_32.h3070644editdlrm
push-switch.h7550644editdlrm
reboot.h4720644editdlrm
romimage-macros.h11260644editdlrm
rtc.h2490644editdlrm
seccomp.h5460644editdlrm
sections.h3110644editdlrm
segment.h8600644editdlrm
setup.h7250644editdlrm
sfp-machine.h27670644editdlrm
sh7760fb.h57400644editdlrm
shmparam.h4890644editdlrm
sh_bios.h7430644editdlrm
siu.h3850644editdlrm
smc37c93x.h56980644editdlrm
smp-ops.h10120644editdlrm
smp.h18470644editdlrm
sparsemem.h3190644editdlrm
spi.h2650644editdlrm
spinlock-cas.h20010644editdlrm
spinlock-llsc.h41490644editdlrm
spinlock.h4380644editdlrm
spinlock_types.h4630644editdlrm
sram.h6700644editdlrm
stackprotector.h7110644editdlrm
stacktrace.h5280644editdlrm
string.h660644editdlrm
string_32.h22080644editdlrm
suspend.h25760644editdlrm
switch_to.h1900644editdlrm
switch_to_32.h36310644editdlrm
syscall.h2010644editdlrm
syscalls.h4540644editdlrm
syscalls_32.h9790644editdlrm
syscall_32.h19170644editdlrm
thread_info.h53420644editdlrm
timex.h6370644editdlrm
tlb.h6250644editdlrm
tlbflush.h18090644editdlrm
topology.h6450644editdlrm
traps.h4240644editdlrm
traps_32.h13380644editdlrm
types.h3260644editdlrm
uaccess.h48110644editdlrm
uaccess_32.h50070644editdlrm
uncached.h13720644editdlrm
unistd.h9190644editdlrm
unwinder.h8560644editdlrm
user.h24400644editdlrm
vermagic.h7090644editdlrm
vga.h1370644editdlrm
vmalloc.h840644editdlrm
vmlinux.lds.h4160644editdlrm
watchdog.h39810644editdlrm
word-at-a-time.h13210644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/arch/sh/include/asm/mmu_context.h (4167B)
/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 1999 Niibe Yutaka * Copyright (C) 2003 - 2007 Paul Mundt * * ASID handling idea taken from MIPS implementation. */ #ifndef __ASM_SH_MMU_CONTEXT_H #define __ASM_SH_MMU_CONTEXT_H #include #include #include #include #include #include /* * The MMU "context" consists of two things: * (a) TLB cache version (or round, cycle whatever expression you like) * (b) ASID (Address Space IDentifier) */ #ifdef CONFIG_CPU_HAS_PTEAEX #define MMU_CONTEXT_ASID_MASK 0x0000ffff #else #define MMU_CONTEXT_ASID_MASK 0x000000ff #endif #define MMU_CONTEXT_VERSION_MASK (~0UL & ~MMU_CONTEXT_ASID_MASK) #define MMU_CONTEXT_FIRST_VERSION (MMU_CONTEXT_ASID_MASK + 1) /* Impossible ASID value, to differentiate from NO_CONTEXT. */ #define MMU_NO_ASID MMU_CONTEXT_FIRST_VERSION #define NO_CONTEXT 0UL #define asid_cache(cpu) (cpu_data[cpu].asid_cache) #ifdef CONFIG_MMU #define cpu_context(cpu, mm) ((mm)->context.id[cpu]) #define cpu_asid(cpu, mm) \ (cpu_context((cpu), (mm)) & MMU_CONTEXT_ASID_MASK) /* * Virtual Page Number mask */ #define MMU_VPN_MASK 0xfffff000 #include /* * Get MMU context if needed. */ static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu) { unsigned long asid = asid_cache(cpu); /* Check if we have old version of context. */ if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0) /* It's up to date, do nothing */ return; /* It's old, we need to get new context with new version. */ if (!(++asid & MMU_CONTEXT_ASID_MASK)) { /* * We exhaust ASID of this version. * Flush all TLB and start new cycle. */ local_flush_tlb_all(); /* * Fix version; Note that we avoid version #0 * to distinguish NO_CONTEXT. */ if (!asid) asid = MMU_CONTEXT_FIRST_VERSION; } cpu_context(cpu, mm) = asid_cache(cpu) = asid; } /* * Initialize the context related info for a new mm_struct * instance. */ #define init_new_context init_new_context static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { int i; for_each_online_cpu(i) cpu_context(i, mm) = NO_CONTEXT; return 0; } /* * After we have set current->mm to a new value, this activates * the context for the new mm so we see the new mappings. */ static inline void activate_context(struct mm_struct *mm, unsigned int cpu) { get_mmu_context(mm, cpu); set_asid(cpu_asid(cpu, mm)); } static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { unsigned int cpu = smp_processor_id(); if (likely(prev != next)) { cpumask_set_cpu(cpu, mm_cpumask(next)); set_TTB(next->pgd); activate_context(next, cpu); } else if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))) activate_context(next, cpu); } #include #else #define set_asid(asid) do { } while (0) #define get_asid() (0) #define cpu_asid(cpu, mm) ({ (void)cpu; NO_CONTEXT; }) #define switch_and_save_asid(asid) (0) #define set_TTB(pgd) do { } while (0) #define get_TTB() (0) #include #endif /* CONFIG_MMU */ #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4) /* * If this processor has an MMU, we need methods to turn it off/on .. * paging_init() will also have to be updated for the processor in * question. */ static inline void enable_mmu(void) { unsigned int cpu = smp_processor_id(); /* Enable MMU */ __raw_writel(MMU_CONTROL_INIT, MMUCR); ctrl_barrier(); if (asid_cache(cpu) == NO_CONTEXT) asid_cache(cpu) = MMU_CONTEXT_FIRST_VERSION; set_asid(asid_cache(cpu) & MMU_CONTEXT_ASID_MASK); } static inline void disable_mmu(void) { unsigned long cr; cr = __raw_readl(MMUCR); cr &= ~MMU_CONTROL_INIT; __raw_writel(cr, MMUCR); ctrl_barrier(); } #else /* * MMU control handlers for processors lacking memory * management hardware. */ #define enable_mmu() do { } while (0) #define disable_mmu() do { } while (0) #endif #endif /* __ASM_SH_MMU_CONTEXT_H */