/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
csky
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/csky/include/asm
mkdir
upload
Name
Size
Mode
Actions
vdso/
-
0755
rm
addrspace.h
231
0644
edit
dl
rm
asid.h
2440
0644
edit
dl
rm
barrier.h
2533
0644
edit
dl
rm
bitops.h
1363
0644
edit
dl
rm
bug.h
565
0644
edit
dl
rm
cache.h
861
0644
edit
dl
rm
cacheflush.h
193
0644
edit
dl
rm
checksum.h
944
0644
edit
dl
rm
clocksource.h
159
0644
edit
dl
rm
cmpxchg.h
1824
0644
edit
dl
rm
elf.h
2723
0644
edit
dl
rm
fixmap.h
747
0644
edit
dl
rm
ftrace.h
558
0644
edit
dl
rm
futex.h
2605
0644
edit
dl
rm
highmem.h
1114
0644
edit
dl
rm
io.h
1384
0644
edit
dl
rm
irqflags.h
1132
0644
edit
dl
rm
irq_work.h
208
0644
edit
dl
rm
Kbuild
199
0644
edit
dl
rm
kprobes.h
1158
0644
edit
dl
rm
memory.h
657
0644
edit
dl
rm
mmu.h
216
0644
edit
dl
rm
mmu_context.h
959
0644
edit
dl
rm
page.h
2757
0644
edit
dl
rm
pci.h
680
0644
edit
dl
rm
perf_event.h
359
0644
edit
dl
rm
pgalloc.h
1657
0644
edit
dl
rm
pgtable.h
6985
0644
edit
dl
rm
probes.h
554
0644
edit
dl
rm
processor.h
2525
0644
edit
dl
rm
ptrace.h
2476
0644
edit
dl
rm
reg_ops.h
382
0644
edit
dl
rm
seccomp.h
283
0644
edit
dl
rm
segment.h
187
0644
edit
dl
rm
shmparam.h
197
0644
edit
dl
rm
smp.h
626
0644
edit
dl
rm
spinlock.h
1892
0644
edit
dl
rm
spinlock_types.h
504
0644
edit
dl
rm
stackprotector.h
705
0644
edit
dl
rm
string.h
233
0644
edit
dl
rm
switch_to.h
923
0644
edit
dl
rm
syscall.h
1563
0644
edit
dl
rm
syscalls.h
351
0644
edit
dl
rm
tcm.h
665
0644
edit
dl
rm
thread_info.h
2866
0644
edit
dl
rm
tlb.h
508
0644
edit
dl
rm
tlbflush.h
824
0644
edit
dl
rm
traps.h
796
0644
edit
dl
rm
uaccess.h
5271
0644
edit
dl
rm
unistd.h
106
0644
edit
dl
rm
uprobes.h
669
0644
edit
dl
rm
vdso.h
784
0644
edit
dl
rm
vmalloc.h
90
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/csky/include/asm/asid.h
(2440B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_ASM_ASID_H #define __ASM_ASM_ASID_H #include <linux/atomic.h> #include <linux/compiler.h> #include <linux/cpumask.h> #include <linux/percpu.h> #include <linux/spinlock.h> 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
Save
cmd:
run