/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
arc
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/arc/include/asm
mkdir
upload
Name
Size
Mode
Actions
arcregs.h
9477
0644
edit
dl
rm
asm-offsets.h
165
0644
edit
dl
rm
asserts.h
958
0644
edit
dl
rm
atomic-llsc.h
2864
0644
edit
dl
rm
atomic-spinlock.h
2569
0644
edit
dl
rm
atomic.h
1153
0644
edit
dl
rm
atomic64-arcv2.h
6095
0644
edit
dl
rm
barrier.h
1376
0644
edit
dl
rm
bitops.h
3885
0644
edit
dl
rm
bug.h
819
0644
edit
dl
rm
cache.h
3604
0644
edit
dl
rm
cacheflush.h
3824
0644
edit
dl
rm
checksum.h
2371
0644
edit
dl
rm
cmpxchg.h
3188
0644
edit
dl
rm
current.h
549
0644
edit
dl
rm
delay.h
1896
0644
edit
dl
rm
disasm.h
3813
0644
edit
dl
rm
dma.h
313
0644
edit
dl
rm
dsp-impl.h
3860
0644
edit
dl
rm
dsp.h
796
0644
edit
dl
rm
dwarf.h
746
0644
edit
dl
rm
elf.h
1935
0644
edit
dl
rm
entry-arcv2.h
7419
0644
edit
dl
rm
entry-compact.h
8810
0644
edit
dl
rm
entry.h
6687
0644
edit
dl
rm
exec.h
264
0644
edit
dl
rm
fb.h
411
0644
edit
dl
rm
fpu.h
1125
0644
edit
dl
rm
futex.h
3611
0644
edit
dl
rm
highmem.h
1422
0644
edit
dl
rm
hugepage.h
2071
0644
edit
dl
rm
io.h
6291
0644
edit
dl
rm
irq.h
679
0644
edit
dl
rm
irqflags-arcv2.h
3491
0644
edit
dl
rm
irqflags-compact.h
4293
0644
edit
dl
rm
irqflags.h
363
0644
edit
dl
rm
jump_label.h
1976
0644
edit
dl
rm
Kbuild
153
0644
edit
dl
rm
kdebug.h
254
0644
edit
dl
rm
kgdb.h
1239
0644
edit
dl
rm
kprobes.h
1186
0644
edit
dl
rm
linkage.h
1484
0644
edit
dl
rm
mach_desc.h
1943
0644
edit
dl
rm
mmu-arcv2.h
2494
0644
edit
dl
rm
mmu.h
387
0644
edit
dl
rm
mmu_context.h
5568
0644
edit
dl
rm
module.h
428
0644
edit
dl
rm
page.h
3313
0644
edit
dl
rm
pci.h
360
0644
edit
dl
rm
perf_event.h
6879
0644
edit
dl
rm
pgalloc.h
2888
0644
edit
dl
rm
pgtable-bits-arcv2.h
4896
0644
edit
dl
rm
pgtable-levels.h
5626
0644
edit
dl
rm
pgtable.h
780
0644
edit
dl
rm
processor.h
3253
0644
edit
dl
rm
ptrace.h
3759
0644
edit
dl
rm
sections.h
261
0644
edit
dl
rm
segment.h
476
0644
edit
dl
rm
serial.h
498
0644
edit
dl
rm
setup.h
1274
0644
edit
dl
rm
shmparam.h
296
0644
edit
dl
rm
smp.h
3823
0644
edit
dl
rm
spinlock.h
8580
0644
edit
dl
rm
spinlock_types.h
905
0644
edit
dl
rm
stacktrace.h
1178
0644
edit
dl
rm
string.h
1036
0644
edit
dl
rm
switch_to.h
553
0644
edit
dl
rm
syscall.h
1738
0644
edit
dl
rm
syscalls.h
547
0644
edit
dl
rm
thread_info.h
3339
0644
edit
dl
rm
timex.h
362
0644
edit
dl
rm
tlb.h
262
0644
edit
dl
rm
tlbflush.h
1654
0644
edit
dl
rm
uaccess.h
17019
0644
edit
dl
rm
unaligned.h
625
0644
edit
dl
rm
unwind.h
3446
0644
edit
dl
rm
vermagic.h
157
0644
edit
dl
rm
vmalloc.h
87
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/arc/include/asm/atomic64-arcv2.h
(6095B)
/* SPDX-License-Identifier: GPL-2.0-only */ /* * ARCv2 supports 64-bit exclusive load (LLOCKD) / store (SCONDD) * - The address HAS to be 64-bit aligned */ #ifndef _ASM_ARC_ATOMIC64_ARCV2_H #define _ASM_ARC_ATOMIC64_ARCV2_H typedef struct { s64 __aligned(8) counter; } atomic64_t; #define ATOMIC64_INIT(a) { (a) } static inline s64 arch_atomic64_read(const atomic64_t *v) { s64 val; __asm__ __volatile__( " ldd %0, [%1] \n" : "=r"(val) : "r"(&v->counter)); return val; } static inline void arch_atomic64_set(atomic64_t *v, s64 a) { /* * This could have been a simple assignment in "C" but would need * explicit volatile. Otherwise gcc optimizers could elide the store * which borked atomic64 self-test * In the inline asm version, memory clobber needed for exact same * reason, to tell gcc about the store. * * This however is not needed for sibling atomic64_add() etc since both * load/store are explicitly done in inline asm. As long as API is used * for each access, gcc has no way to optimize away any load/store */ __asm__ __volatile__( " std %0, [%1] \n" : : "r"(a), "r"(&v->counter) : "memory"); } #define ATOMIC64_OP(op, op1, op2) \ static inline void arch_atomic64_##op(s64 a, atomic64_t *v) \ { \ s64 val; \ \ __asm__ __volatile__( \ "1: \n" \ " llockd %0, [%1] \n" \ " " #op1 " %L0, %L0, %L2 \n" \ " " #op2 " %H0, %H0, %H2 \n" \ " scondd %0, [%1] \n" \ " bnz 1b \n" \ : "=&r"(val) \ : "r"(&v->counter), "ir"(a) \ : "cc", "memory"); \ } \ #define ATOMIC64_OP_RETURN(op, op1, op2) \ static inline s64 arch_atomic64_##op##_return_relaxed(s64 a, atomic64_t *v) \ { \ s64 val; \ \ __asm__ __volatile__( \ "1: \n" \ " llockd %0, [%1] \n" \ " " #op1 " %L0, %L0, %L2 \n" \ " " #op2 " %H0, %H0, %H2 \n" \ " scondd %0, [%1] \n" \ " bnz 1b \n" \ : [val] "=&r"(val) \ : "r"(&v->counter), "ir"(a) \ : "cc", "memory"); \ \ return val; \ } #define arch_atomic64_add_return_relaxed arch_atomic64_add_return_relaxed #define arch_atomic64_sub_return_relaxed arch_atomic64_sub_return_relaxed #define ATOMIC64_FETCH_OP(op, op1, op2) \ static inline s64 arch_atomic64_fetch_##op##_relaxed(s64 a, atomic64_t *v) \ { \ s64 val, orig; \ \ __asm__ __volatile__( \ "1: \n" \ " llockd %0, [%2] \n" \ " " #op1 " %L1, %L0, %L3 \n" \ " " #op2 " %H1, %H0, %H3 \n" \ " scondd %1, [%2] \n" \ " bnz 1b \n" \ : "=&r"(orig), "=&r"(val) \ : "r"(&v->counter), "ir"(a) \ : "cc", "memory"); \ \ return orig; \ } #define arch_atomic64_fetch_add_relaxed arch_atomic64_fetch_add_relaxed #define arch_atomic64_fetch_sub_relaxed arch_atomic64_fetch_sub_relaxed #define arch_atomic64_fetch_and_relaxed arch_atomic64_fetch_and_relaxed #define arch_atomic64_fetch_andnot_relaxed arch_atomic64_fetch_andnot_relaxed #define arch_atomic64_fetch_or_relaxed arch_atomic64_fetch_or_relaxed #define arch_atomic64_fetch_xor_relaxed arch_atomic64_fetch_xor_relaxed #define ATOMIC64_OPS(op, op1, op2) \ ATOMIC64_OP(op, op1, op2) \ ATOMIC64_OP_RETURN(op, op1, op2) \ ATOMIC64_FETCH_OP(op, op1, op2) ATOMIC64_OPS(add, add.f, adc) ATOMIC64_OPS(sub, sub.f, sbc) #undef ATOMIC64_OPS #define ATOMIC64_OPS(op, op1, op2) \ ATOMIC64_OP(op, op1, op2) \ ATOMIC64_FETCH_OP(op, op1, op2) ATOMIC64_OPS(and, and, and) ATOMIC64_OPS(andnot, bic, bic) ATOMIC64_OPS(or, or, or) ATOMIC64_OPS(xor, xor, xor) #define arch_atomic64_andnot arch_atomic64_andnot #undef ATOMIC64_OPS #undef ATOMIC64_FETCH_OP #undef ATOMIC64_OP_RETURN #undef ATOMIC64_OP static inline s64 arch_atomic64_cmpxchg(atomic64_t *ptr, s64 expected, s64 new) { s64 prev; smp_mb(); __asm__ __volatile__( "1: llockd %0, [%1] \n" " brne %L0, %L2, 2f \n" " brne %H0, %H2, 2f \n" " scondd %3, [%1] \n" " bnz 1b \n" "2: \n" : "=&r"(prev) : "r"(ptr), "ir"(expected), "r"(new) : "cc"); /* memory clobber comes from smp_mb() */ smp_mb(); return prev; } static inline s64 arch_atomic64_xchg(atomic64_t *ptr, s64 new) { s64 prev; smp_mb(); __asm__ __volatile__( "1: llockd %0, [%1] \n" " scondd %2, [%1] \n" " bnz 1b \n" "2: \n" : "=&r"(prev) : "r"(ptr), "r"(new) : "cc"); /* memory clobber comes from smp_mb() */ smp_mb(); return prev; } /** * arch_atomic64_dec_if_positive - decrement by 1 if old value positive * @v: pointer of type atomic64_t * * The function returns the old value of *v minus 1, even if * the atomic variable, v, was not decremented. */ static inline s64 arch_atomic64_dec_if_positive(atomic64_t *v) { s64 val; smp_mb(); __asm__ __volatile__( "1: llockd %0, [%1] \n" " sub.f %L0, %L0, 1 # w0 - 1, set C on borrow\n" " sub.c %H0, %H0, 1 # if C set, w1 - 1\n" " brlt %H0, 0, 2f \n" " scondd %0, [%1] \n" " bnz 1b \n" "2: \n" : "=&r"(val) : "r"(&v->counter) : "cc"); /* memory clobber comes from smp_mb() */ smp_mb(); return val; } #define arch_atomic64_dec_if_positive arch_atomic64_dec_if_positive /** * arch_atomic64_fetch_add_unless - add unless the number is a given value * @v: pointer of type atomic64_t * @a: the amount to add to v... * @u: ...unless v is equal to u. * * Atomically adds @a to @v, if it was not @u. * Returns the old value of @v */ static inline s64 arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) { s64 old, temp; smp_mb(); __asm__ __volatile__( "1: llockd %0, [%2] \n" " brne %L0, %L4, 2f # continue to add since v != u \n" " breq.d %H0, %H4, 3f # return since v == u \n" "2: \n" " add.f %L1, %L0, %L3 \n" " adc %H1, %H0, %H3 \n" " scondd %1, [%2] \n" " bnz 1b \n" "3: \n" : "=&r"(old), "=&r" (temp) : "r"(&v->counter), "r"(a), "r"(u) : "cc"); /* memory clobber comes from smp_mb() */ smp_mb(); return old; } #define arch_atomic64_fetch_add_unless arch_atomic64_fetch_add_unless #endif
Save
cmd:
run