/usr/src/linux-headers-5.15.0-190/arch/csky/include/asm
NameSizeModeActions
vdso/-0755rm
addrspace.h2310644editdlrm
asid.h24400644editdlrm
barrier.h25330644editdlrm
bitops.h13630644editdlrm
bug.h5650644editdlrm
cache.h8610644editdlrm
cacheflush.h1930644editdlrm
checksum.h9440644editdlrm
clocksource.h1590644editdlrm
cmpxchg.h18240644editdlrm
elf.h27230644editdlrm
fixmap.h7470644editdlrm
ftrace.h5580644editdlrm
futex.h26050644editdlrm
highmem.h11140644editdlrm
io.h13840644editdlrm
irqflags.h11320644editdlrm
irq_work.h2080644editdlrm
Kbuild1990644editdlrm
kprobes.h11580644editdlrm
memory.h6570644editdlrm
mmu.h2160644editdlrm
mmu_context.h9590644editdlrm
page.h27570644editdlrm
pci.h6800644editdlrm
perf_event.h3590644editdlrm
pgalloc.h16570644editdlrm
pgtable.h69850644editdlrm
probes.h5540644editdlrm
processor.h25250644editdlrm
ptrace.h24760644editdlrm
reg_ops.h3820644editdlrm
seccomp.h2830644editdlrm
segment.h1870644editdlrm
shmparam.h1970644editdlrm
smp.h6260644editdlrm
spinlock.h18920644editdlrm
spinlock_types.h5040644editdlrm
stackprotector.h7050644editdlrm
string.h2330644editdlrm
switch_to.h9230644editdlrm
syscall.h15630644editdlrm
syscalls.h3510644editdlrm
tcm.h6650644editdlrm
thread_info.h28660644editdlrm
tlb.h5080644editdlrm
tlbflush.h8240644editdlrm
traps.h7960644editdlrm
uaccess.h52710644editdlrm
unistd.h1060644editdlrm
uprobes.h6690644editdlrm
vdso.h7840644editdlrm
vmalloc.h900644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/arch/csky/include/asm/asid.h (2440B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_ASM_ASID_H #define __ASM_ASM_ASID_H #include #include #include #include #include struct asid_info { atomic64_t generation; unsigned long *map; atomic64_t __percpu *active; u64 __percpu *reserved; u32 bits; /* Lock protecting the structure */ raw_spinlock_t lock; /* Which CPU requires context flush on next call */ cpumask_t flush_pending; /* Number of ASID allocated by context (shift value) */ unsigned int ctxt_shift; /* Callback to locally flush the context. */ void (*flush_cpu_ctxt_cb)(void); }; #define NUM_ASIDS(info) (1UL << ((info)->bits)) #define NUM_CTXT_ASIDS(info) (NUM_ASIDS(info) >> (info)->ctxt_shift) #define active_asid(info, cpu) *per_cpu_ptr((info)->active, cpu) void asid_new_context(struct asid_info *info, atomic64_t *pasid, unsigned int cpu, struct mm_struct *mm); /* * Check the ASID is still valid for the context. If not generate a new ASID. * * @pasid: Pointer to the current ASID batch * @cpu: current CPU ID. Must have been acquired through get_cpu() */ static inline void asid_check_context(struct asid_info *info, atomic64_t *pasid, unsigned int cpu, struct mm_struct *mm) { u64 asid, old_active_asid; asid = atomic64_read(pasid); /* * The memory ordering here is subtle. * If our active_asid is non-zero and the ASID matches the current * generation, then we update the active_asid entry with a relaxed * cmpxchg. Racing with a concurrent rollover means that either: * * - We get a zero back from the cmpxchg and end up waiting on the * lock. Taking the lock synchronises with the rollover and so * we are forced to see the updated generation. * * - We get a valid ASID back from the cmpxchg, which means the * relaxed xchg in flush_context will treat us as reserved * because atomic RmWs are totally ordered for a given location. */ old_active_asid = atomic64_read(&active_asid(info, cpu)); if (old_active_asid && !((asid ^ atomic64_read(&info->generation)) >> info->bits) && atomic64_cmpxchg_relaxed(&active_asid(info, cpu), old_active_asid, asid)) return; asid_new_context(info, pasid, cpu, mm); } int asid_allocator_init(struct asid_info *info, u32 bits, unsigned int asid_per_ctxt, void (*flush_cpu_ctxt_cb)(void)); #endif