| /linux/scripts/atomic/ |
| H A D | gen-atomic-fallback.sh | 227 local cmpxchg="$1"; shift; 234 ___r = raw_${prefix}${cmpxchg}${suffix}((_ptr), ___o, (_new)); \\ 244 local cmpxchg="$1"; shift 248 printf "#if defined(arch_try_${cmpxchg}${order})\n" 249 printf "#define raw_try_${cmpxchg}${order} arch_try_${cmpxchg}${order}\n" 252 printf "#elif defined(arch_try_${cmpxchg}_relaxed)\n" 253 printf "#define raw_try_${cmpxchg}${order}(...) \\\\\n" 254 printf " __atomic_op${forder}(arch_try_${cmpxchg}, __VA_ARGS__)\n" 258 printf "#elif defined(arch_try_${cmpxchg})\n" 259 printf "#define raw_try_${cmpxchg}${order} arch_try_${cmpxchg}\n" [all …]
|
| /linux/Documentation/litmus-tests/atomic/ |
| H A D | cmpxchg-fail-unordered-2.litmus | 1 C cmpxchg-fail-unordered-2 6 * Demonstrate that a failing cmpxchg() operation does not act as either 7 * an acquire release operation. (In contrast, a successful cmpxchg() 18 r1 = cmpxchg(y, 0, 1); 26 r1 = cmpxchg(y, 0, 1);
|
| H A D | cmpxchg-fail-unordered-1.litmus | 1 C cmpxchg-fail-unordered-1 6 * Demonstrate that a failing cmpxchg() operation does not act as a 7 * full barrier. (In contrast, a successful cmpxchg() does act as a 19 r1 = cmpxchg(z, 1, 0); 29 r1 = cmpxchg(z, 1, 0);
|
| H A D | cmpxchg-fail-ordered-2.litmus | 1 C cmpxchg-fail-ordered-2 6 * Demonstrate use of smp_mb__after_atomic() to make a failing cmpxchg 17 r1 = cmpxchg(y, 0, 1); 25 r1 = cmpxchg(y, 0, 1);
|
| H A D | cmpxchg-fail-ordered-1.litmus | 1 C cmpxchg-fail-ordered-1 6 * Demonstrate that a failing cmpxchg() operation will act as a full 18 r1 = cmpxchg(z, 1, 0); 29 r1 = cmpxchg(z, 1, 0);
|
| /linux/net/ipv4/ |
| H A D | protocol.c | 34 return !cmpxchg((const struct net_protocol **)&inet_protos[protocol], in inet_add_protocol() 41 return !cmpxchg((const struct net_offload **)&inet_offloads[protocol], in inet_add_offload() 50 ret = (cmpxchg((const struct net_protocol **)&inet_protos[protocol], in inet_del_protocol() 63 ret = (cmpxchg((const struct net_offload **)&inet_offloads[protocol], in inet_del_offload()
|
| /linux/net/ipv6/ |
| H A D | protocol.c | 30 return !cmpxchg((const struct inet6_protocol **)&inet6_protos[protocol], in inet6_add_protocol() 39 ret = (cmpxchg((const struct inet6_protocol **)&inet6_protos[protocol], in inet6_del_protocol() 54 return !cmpxchg((const struct net_offload **)&inet6_offloads[protocol], in inet6_add_offload() 63 ret = (cmpxchg((const struct net_offload **)&inet6_offloads[protocol], in inet6_del_offload()
|
| /linux/Documentation/litmus-tests/ |
| H A D | README | 24 cmpxchg-fail-ordered-1.litmus 25 Demonstrate that a failing cmpxchg() operation acts as a full barrier 28 cmpxchg-fail-ordered-2.litmus 29 Demonstrate that a failing cmpxchg() operation acts as an acquire 32 cmpxchg-fail-unordered-1.litmus 33 Demonstrate that a failing cmpxchg() operation does not act as a 36 cmpxchg-fail-unordered-2.litmus 37 Demonstrate that a failing cmpxchg() operation does not act as an
|
| /linux/tools/testing/memblock/ |
| H A D | Makefile | 33 test -L asm/cmpxchg.h || ln -s ../../../arch/x86/include/asm/cmpxchg.h asm/cmpxchg.h 39 $(RM) $(TARGETS) $(OFILES) linux/memblock.h memblock.c asm/asm.h asm/cmpxchg.h
|
| H A D | .gitignore | 5 asm/cmpxchg.h
|
| /linux/tools/include/asm-generic/ |
| H A D | atomic-gcc.h | 65 #define cmpxchg(ptr, oldval, newval) \ macro 70 return cmpxchg(&(v)->counter, oldval, newval); in atomic_cmpxchg()
|
| /linux/lib/ |
| H A D | errseq.c | 96 cur = cmpxchg(eseq, old, new); in errseq_set() 202 cmpxchg(eseq, old, new); in errseq_check_and_advance()
|
| H A D | cmpxchg-emu.c | 41 ret = data_race(cmpxchg(p32, old32.w, new32.w)); // Overridden above. in cmpxchg_emu_u8()
|
| /linux/Documentation/translations/zh_CN/locking/ |
| H A D | mutex-design.rst | 48 (i) 快速路径:试图通过调用cmpxchg()修改锁的所有者为当前任务,以此原子化地 49 获取锁。这只在无竞争的情况下有效(cmpxchg()检查值是否为0,所以3个状态
|
| /linux/arch/sh/kernel/cpu/sh2/ |
| H A D | smp-j2.c | 28 while (cmpxchg(pmsg, messages, 0) != messages); in j2_ipi_interrupt_handler() 118 while (cmpxchg(pmsg, old, old|(1U<<message)) != old); in j2_send_ipi()
|
| /linux/drivers/accessibility/speakup/ |
| H A D | selection.c | 71 if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { in speakup_set_selection() 124 if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { in speakup_paste_selection()
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | bpf_atomic.h | 47 #define cmpxchg(p, old, new) __sync_val_compare_and_swap((p), old, new) macro 52 __unqual_typeof(*(p)) __r = cmpxchg(p, __o, new); \
|
| /linux/kernel/kcsan/ |
| H A D | selftest.c | 153 KCSAN_CHECK_READ_BARRIER(cmpxchg(&test_var, 0, 0)); in test_barrier() 182 KCSAN_CHECK_WRITE_BARRIER(cmpxchg(&test_var, 0, 0)); in test_barrier() 214 KCSAN_CHECK_RW_BARRIER(cmpxchg(&test_var, 0, 0)); in test_barrier()
|
| /linux/kernel/trace/ |
| H A D | trace_recursion_record.c | 78 old = cmpxchg(&recursed_functions[index].ip, 0, ip); in ftrace_record_recursion() 112 cmpxchg(&recursed_functions[index].ip, ip, 0); in ftrace_record_recursion()
|
| H A D | undefsyms_base.c | 26 cmpxchg((u32 * volatile)&u, 0, 8); in undefsyms_base()
|
| /linux/Documentation/locking/ |
| H A D | rt-mutex.rst | 42 without waiters. The optimized fastpath operations require cmpxchg 66 with ->wait_lock is held. To prevent any fast path cmpxchg to the lock, 72 To prevent a cmpxchg of the owner releasing the lock, we need to
|
| /linux/rust/kernel/sync/atomic/ |
| H A D | predefine.rs | 245 assert_eq!(Err(old), x.cmpxchg(new, new, Full)); 247 assert_eq!(Ok(old), x.cmpxchg(old, new, Relaxed)); 259 assert_eq!(Err(old), unsafe { cmpxchg(ptr, new, new, Full) }); 262 assert_eq!(Ok(old), unsafe { cmpxchg(ptr, old, new, Relaxed) }); 292 assert_eq!(Err(false), x.cmpxchg(true, true, Relaxed)); 294 assert_eq!(Ok(false), x.cmpxchg(false, true, Full)); 304 assert_eq!(x.cmpxchg(&raw mut u, &raw mut u, Relaxed), Err(&raw mut v)); 305 assert_eq!(x.cmpxchg(&raw mut v, &raw mut u, Relaxed), Ok(&raw mut v)); 312 x.cmpxchg(&raw const u, &raw const u, Relaxed), 316 x.cmpxchg( [all...] |
| /linux/fs/nfs/ |
| H A D | nfs3acl.c | 25 cmpxchg(p, ACL_NOT_CACHED, sentinel); in nfs3_prepare_get_acl() 34 if (cmpxchg(p, sentinel, acl) != sentinel) in nfs3_complete_get_acl() 43 cmpxchg(p, sentinel, ACL_NOT_CACHED); in nfs3_abort_get_acl()
|
| /linux/Documentation/features/locking/cmpxchg-local/ |
| H A D | arch-support.txt | 2 # Feature name: cmpxchg-local
|
| /linux/tools/arch/x86/include/asm/ |
| H A D | atomic.h | 71 return cmpxchg(&v->counter, old, new); in atomic_cmpxchg()
|