/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/futex.h (3611B)
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) * * Vineetg: August 2010: From Android kernel work */ #ifndef _ASM_FUTEX_H #define _ASM_FUTEX_H #include #include #include #include #ifdef CONFIG_ARC_HAS_LLSC #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)\ \ smp_mb(); \ __asm__ __volatile__( \ "1: llock %1, [%2] \n" \ insn "\n" \ "2: scond %0, [%2] \n" \ " bnz 1b \n" \ " mov %0, 0 \n" \ "3: \n" \ " .section .fixup,\"ax\" \n" \ " .align 4 \n" \ "4: mov %0, %4 \n" \ " j 3b \n" \ " .previous \n" \ " .section __ex_table,\"a\" \n" \ " .align 4 \n" \ " .word 1b, 4b \n" \ " .word 2b, 4b \n" \ " .previous \n" \ \ : "=&r" (ret), "=&r" (oldval) \ : "r" (uaddr), "r" (oparg), "ir" (-EFAULT) \ : "cc", "memory"); \ smp_mb() \ #else /* !CONFIG_ARC_HAS_LLSC */ #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)\ \ smp_mb(); \ __asm__ __volatile__( \ "1: ld %1, [%2] \n" \ insn "\n" \ "2: st %0, [%2] \n" \ " mov %0, 0 \n" \ "3: \n" \ " .section .fixup,\"ax\" \n" \ " .align 4 \n" \ "4: mov %0, %4 \n" \ " j 3b \n" \ " .previous \n" \ " .section __ex_table,\"a\" \n" \ " .align 4 \n" \ " .word 1b, 4b \n" \ " .word 2b, 4b \n" \ " .previous \n" \ \ : "=&r" (ret), "=&r" (oldval) \ : "r" (uaddr), "r" (oparg), "ir" (-EFAULT) \ : "cc", "memory"); \ smp_mb() \ #endif static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr) { int oldval = 0, ret; if (!access_ok(uaddr, sizeof(u32))) return -EFAULT; #ifndef CONFIG_ARC_HAS_LLSC preempt_disable(); /* to guarantee atomic r-m-w of futex op */ #endif switch (op) { case FUTEX_OP_SET: __futex_atomic_op("mov %0, %3", ret, oldval, uaddr, oparg); break; case FUTEX_OP_ADD: /* oldval = *uaddr; *uaddr += oparg ; ret = *uaddr */ __futex_atomic_op("add %0, %1, %3", ret, oldval, uaddr, oparg); break; case FUTEX_OP_OR: __futex_atomic_op("or %0, %1, %3", ret, oldval, uaddr, oparg); break; case FUTEX_OP_ANDN: __futex_atomic_op("bic %0, %1, %3", ret, oldval, uaddr, oparg); break; case FUTEX_OP_XOR: __futex_atomic_op("xor %0, %1, %3", ret, oldval, uaddr, oparg); break; default: ret = -ENOSYS; } #ifndef CONFIG_ARC_HAS_LLSC preempt_enable(); #endif if (!ret) *oval = oldval; return ret; } /* * cmpxchg of futex (pagefaults disabled by caller) * Return 0 for success, -EFAULT otherwise */ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 expval, u32 newval) { int ret = 0; u32 existval; if (!access_ok(uaddr, sizeof(u32))) return -EFAULT; #ifndef CONFIG_ARC_HAS_LLSC preempt_disable(); /* to guarantee atomic r-m-w of futex op */ #endif smp_mb(); __asm__ __volatile__( #ifdef CONFIG_ARC_HAS_LLSC "1: llock %1, [%4] \n" " brne %1, %2, 3f \n" "2: scond %3, [%4] \n" " bnz 1b \n" #else "1: ld %1, [%4] \n" " brne %1, %2, 3f \n" "2: st %3, [%4] \n" #endif "3: \n" " .section .fixup,\"ax\" \n" "4: mov %0, %5 \n" " j 3b \n" " .previous \n" " .section __ex_table,\"a\" \n" " .align 4 \n" " .word 1b, 4b \n" " .word 2b, 4b \n" " .previous\n" : "+&r"(ret), "=&r"(existval) : "r"(expval), "r"(newval), "r"(uaddr), "ir"(-EFAULT) : "cc", "memory"); smp_mb(); #ifndef CONFIG_ARC_HAS_LLSC preempt_enable(); #endif *uval = existval; return ret; } #endif