/usr/src/linux-headers-5.15.0-190/arch/arc/include/asm
NameSizeModeActions
arcregs.h94770644editdlrm
asm-offsets.h1650644editdlrm
asserts.h9580644editdlrm
atomic-llsc.h28640644editdlrm
atomic-spinlock.h25690644editdlrm
atomic.h11530644editdlrm
atomic64-arcv2.h60950644editdlrm
barrier.h13760644editdlrm
bitops.h38850644editdlrm
bug.h8190644editdlrm
cache.h36040644editdlrm
cacheflush.h38240644editdlrm
checksum.h23710644editdlrm
cmpxchg.h31880644editdlrm
current.h5490644editdlrm
delay.h18960644editdlrm
disasm.h38130644editdlrm
dma.h3130644editdlrm
dsp-impl.h38600644editdlrm
dsp.h7960644editdlrm
dwarf.h7460644editdlrm
elf.h19350644editdlrm
entry-arcv2.h74190644editdlrm
entry-compact.h88100644editdlrm
entry.h66870644editdlrm
exec.h2640644editdlrm
fb.h4110644editdlrm
fpu.h11250644editdlrm
futex.h36110644editdlrm
highmem.h14220644editdlrm
hugepage.h20710644editdlrm
io.h62910644editdlrm
irq.h6790644editdlrm
irqflags-arcv2.h34910644editdlrm
irqflags-compact.h42930644editdlrm
irqflags.h3630644editdlrm
jump_label.h19760644editdlrm
Kbuild1530644editdlrm
kdebug.h2540644editdlrm
kgdb.h12390644editdlrm
kprobes.h11860644editdlrm
linkage.h14840644editdlrm
mach_desc.h19430644editdlrm
mmu-arcv2.h24940644editdlrm
mmu.h3870644editdlrm
mmu_context.h55680644editdlrm
module.h4280644editdlrm
page.h33130644editdlrm
pci.h3600644editdlrm
perf_event.h68790644editdlrm
pgalloc.h28880644editdlrm
pgtable-bits-arcv2.h48960644editdlrm
pgtable-levels.h56260644editdlrm
pgtable.h7800644editdlrm
processor.h32530644editdlrm
ptrace.h37590644editdlrm
sections.h2610644editdlrm
segment.h4760644editdlrm
serial.h4980644editdlrm
setup.h12740644editdlrm
shmparam.h2960644editdlrm
smp.h38230644editdlrm
spinlock.h85800644editdlrm
spinlock_types.h9050644editdlrm
stacktrace.h11780644editdlrm
string.h10360644editdlrm
switch_to.h5530644editdlrm
syscall.h17380644editdlrm
syscalls.h5470644editdlrm
thread_info.h33390644editdlrm
timex.h3620644editdlrm
tlb.h2620644editdlrm
tlbflush.h16540644editdlrm
uaccess.h170190644editdlrm
unaligned.h6250644editdlrm
unwind.h34460644editdlrm
vermagic.h1570644editdlrm
vmalloc.h870644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/arch/arc/include/asm/cmpxchg.h (3188B)
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) */ #ifndef __ASM_ARC_CMPXCHG_H #define __ASM_ARC_CMPXCHG_H #include #include #include #include #ifdef CONFIG_ARC_HAS_LLSC /* * if (*ptr == @old) * *ptr = @new */ #define __cmpxchg(ptr, old, new) \ ({ \ __typeof__(*(ptr)) _prev; \ \ __asm__ __volatile__( \ "1: llock %0, [%1] \n" \ " brne %0, %2, 2f \n" \ " scond %3, [%1] \n" \ " bnz 1b \n" \ "2: \n" \ : "=&r"(_prev) /* Early clobber prevent reg reuse */ \ : "r"(ptr), /* Not "m": llock only supports reg */ \ "ir"(old), \ "r"(new) /* Not "ir": scond can't take LIMM */ \ : "cc", \ "memory"); /* gcc knows memory is clobbered */ \ \ _prev; \ }) #define arch_cmpxchg_relaxed(ptr, old, new) \ ({ \ __typeof__(ptr) _p_ = (ptr); \ __typeof__(*(ptr)) _o_ = (old); \ __typeof__(*(ptr)) _n_ = (new); \ __typeof__(*(ptr)) _prev_; \ \ switch(sizeof((_p_))) { \ case 4: \ _prev_ = __cmpxchg(_p_, _o_, _n_); \ break; \ default: \ BUILD_BUG(); \ } \ _prev_; \ }) #else #define arch_cmpxchg(ptr, old, new) \ ({ \ volatile __typeof__(ptr) _p_ = (ptr); \ __typeof__(*(ptr)) _o_ = (old); \ __typeof__(*(ptr)) _n_ = (new); \ __typeof__(*(ptr)) _prev_; \ unsigned long __flags; \ \ BUILD_BUG_ON(sizeof(_p_) != 4); \ \ /* \ * spin lock/unlock provide the needed smp_mb() before/after \ */ \ atomic_ops_lock(__flags); \ _prev_ = *_p_; \ if (_prev_ == _o_) \ *_p_ = _n_; \ atomic_ops_unlock(__flags); \ _prev_; \ }) #endif /* * xchg */ #ifdef CONFIG_ARC_HAS_LLSC #define __xchg(ptr, val) \ ({ \ __asm__ __volatile__( \ " ex %0, [%1] \n" /* set new value */ \ : "+r"(val) \ : "r"(ptr) \ : "memory"); \ _val_; /* get old value */ \ }) #define arch_xchg_relaxed(ptr, val) \ ({ \ __typeof__(ptr) _p_ = (ptr); \ __typeof__(*(ptr)) _val_ = (val); \ \ switch(sizeof(*(_p_))) { \ case 4: \ _val_ = __xchg(_p_, _val_); \ break; \ default: \ BUILD_BUG(); \ } \ _val_; \ }) #else /* !CONFIG_ARC_HAS_LLSC */ /* * EX instructions is baseline and present in !LLSC too. But in this * regime it still needs use @atomic_ops_lock spinlock to allow interop * with cmpxchg() which uses spinlock in !LLSC * (llist.h use xchg and cmpxchg on sama data) */ #define arch_xchg(ptr, val) \ ({ \ __typeof__(ptr) _p_ = (ptr); \ __typeof__(*(ptr)) _val_ = (val); \ \ unsigned long __flags; \ \ atomic_ops_lock(__flags); \ \ __asm__ __volatile__( \ " ex %0, [%1] \n" \ : "+r"(_val_) \ : "r"(_p_) \ : "memory"); \ \ atomic_ops_unlock(__flags); \ _val_; \ }) #endif #endif