/Linux-v5.4/arch/sh/include/asm/ |
D | bitops-cas.h | 5 static inline unsigned __bo_cas(volatile unsigned *p, unsigned old, unsigned new) in __bo_cas() argument 9 : "r"(old), "z"(p) in __bo_cas() 16 unsigned mask, old; in set_bit() local 22 do old = *a; in set_bit() 23 while (__bo_cas(a, old, old|mask) != old); in set_bit() 28 unsigned mask, old; in clear_bit() local 34 do old = *a; in clear_bit() 35 while (__bo_cas(a, old, old&~mask) != old); in clear_bit() 40 unsigned mask, old; in change_bit() local 46 do old = *a; in change_bit() [all …]
|
D | spinlock-cas.h | 13 static inline unsigned __sl_cas(volatile unsigned *p, unsigned old, unsigned new) in __sl_cas() argument 17 : "r"(old), "z"(p) in __sl_cas() 54 unsigned old; in arch_read_lock() local 55 do old = rw->lock; in arch_read_lock() 56 while (!old || __sl_cas(&rw->lock, old, old-1) != old); in arch_read_lock() 61 unsigned old; in arch_read_unlock() local 62 do old = rw->lock; in arch_read_unlock() 63 while (__sl_cas(&rw->lock, old, old+1) != old); in arch_read_unlock() 78 unsigned old; in arch_read_trylock() local 79 do old = rw->lock; in arch_read_trylock() [all …]
|
/Linux-v5.4/arch/ia64/include/asm/ |
D | bitops.h | 42 __u32 bit, old, new; in set_bit() local 50 old = *m; in set_bit() 51 new = old | bit; in set_bit() 52 } while (cmpxchg_acq(m, old, new) != old); in set_bit() 83 __u32 mask, old, new; in clear_bit() local 91 old = *m; in clear_bit() 92 new = old & mask; in clear_bit() 93 } while (cmpxchg_acq(m, old, new) != old); in clear_bit() 107 __u32 mask, old, new; in clear_bit_unlock() local 115 old = *m; in clear_bit_unlock() [all …]
|
D | acenv.h | 22 unsigned int old, new, val; in ia64_acpi_acquire_global_lock() local 24 old = *lock; in ia64_acpi_acquire_global_lock() 25 new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); in ia64_acpi_acquire_global_lock() 26 val = ia64_cmpxchg4_acq(lock, new, old); in ia64_acpi_acquire_global_lock() 27 } while (unlikely (val != old)); in ia64_acpi_acquire_global_lock() 34 unsigned int old, new, val; in ia64_acpi_release_global_lock() local 36 old = *lock; in ia64_acpi_release_global_lock() 37 new = old & ~0x3; in ia64_acpi_release_global_lock() 38 val = ia64_cmpxchg4_acq(lock, new, old); in ia64_acpi_release_global_lock() 39 } while (unlikely (val != old)); in ia64_acpi_release_global_lock() [all …]
|
D | atomic.h | 35 __s32 old, new; \ 40 old = atomic_read(v); \ 41 new = old c_op i; \ 42 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); \ 50 __s32 old, new; \ 55 old = atomic_read(v); \ 56 new = old c_op i; \ 57 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); \ 58 return old; \ 130 s64 old, new; \ [all …]
|
/Linux-v5.4/lib/ |
D | errseq.c | 60 errseq_t cur, old; in errseq_set() local 71 old = READ_ONCE(*eseq); in errseq_set() 75 return old; in errseq_set() 81 new = (old & ~(MAX_ERRNO|ERRSEQ_SEEN)) | -err; in errseq_set() 84 if (old & ERRSEQ_SEEN) in errseq_set() 88 if (new == old) { in errseq_set() 94 cur = cmpxchg(eseq, old, new); in errseq_set() 100 if (likely(cur == old || cur == new)) in errseq_set() 104 old = cur; in errseq_set() 124 errseq_t old = READ_ONCE(*eseq); in errseq_sample() local [all …]
|
D | lockref.c | 13 struct lockref old; \ 14 BUILD_BUG_ON(sizeof(old) != 8); \ 15 old.lock_count = READ_ONCE(lockref->lock_count); \ 16 while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) { \ 17 struct lockref new = old, prev = old; \ 19 old.lock_count = cmpxchg64_relaxed(&lockref->lock_count, \ 20 old.lock_count, \ 22 if (likely(old.lock_count == prev.lock_count)) { \ 69 if (old.count <= 0) in lockref_get_not_zero() 97 if (old.count <= 1) in lockref_put_not_zero() [all …]
|
/Linux-v5.4/arch/powerpc/include/asm/ |
D | cmpxchg.h | 44 u32 __cmpxchg_##type##sfx(volatile void *p, u32 old, u32 new) \ 51 old <<= bitoff; \ 70 : "r" (p), "r" (old), "r" (new), "r" (prev_mask) \ 223 __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) in __cmpxchg_u32() argument 239 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u32() 246 __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, in __cmpxchg_u32_local() argument 261 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u32_local() 268 __cmpxchg_u32_relaxed(u32 *p, unsigned long old, unsigned long new) in __cmpxchg_u32_relaxed() argument 281 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u32_relaxed() 296 __cmpxchg_u32_acquire(u32 *p, unsigned long old, unsigned long new) in __cmpxchg_u32_acquire() argument [all …]
|
/Linux-v5.4/arch/sparc/kernel/ |
D | ftrace.c | 26 static int ftrace_modify_code(unsigned long ip, u32 old, u32 new) in ftrace_modify_code() argument 47 : [new] "0" (new), [old] "r" (old), [ip] "r" (ip) in ftrace_modify_code() 50 if (replaced != old && replaced != new) in ftrace_modify_code() 59 u32 old, new; in ftrace_make_nop() local 61 old = ftrace_call_replace(ip, addr); in ftrace_make_nop() 63 return ftrace_modify_code(ip, old, new); in ftrace_make_nop() 69 u32 old, new; in ftrace_make_call() local 71 old = ftrace_nop; in ftrace_make_call() 73 return ftrace_modify_code(ip, old, new); in ftrace_make_call() 79 u32 old, new; in ftrace_update_ftrace_func() local [all …]
|
/Linux-v5.4/arch/s390/lib/ |
D | spinlock.c | 84 static inline int arch_cmpxchg_niai8(int *lock, int old, int new) in arch_cmpxchg_niai8() argument 86 int expected = old; in arch_cmpxchg_niai8() 91 : "=d" (old), "=Q" (*lock) in arch_cmpxchg_niai8() 92 : "0" (old), "d" (new), "Q" (*lock) in arch_cmpxchg_niai8() 94 return expected == old; in arch_cmpxchg_niai8() 120 int lockval, ix, node_id, tail_id, old, new, owner, count; in arch_spin_lock_queued() local 131 old = READ_ONCE(lp->lock); in arch_spin_lock_queued() 132 if ((old & _Q_LOCK_CPU_MASK) == 0 && in arch_spin_lock_queued() 133 (old & _Q_LOCK_STEAL_MASK) != _Q_LOCK_STEAL_MASK) { in arch_spin_lock_queued() 141 new = (old ? (old + _Q_LOCK_STEAL_ADD) : 0) | lockval; in arch_spin_lock_queued() [all …]
|
/Linux-v5.4/arch/s390/include/asm/ |
D | atomic_ops.h | 16 op_type old; \ 21 : [old] "=d" (old), [ptr] "+Q" (*ptr) \ 23 return old; \ 67 int old, new; \ 74 : [old] "=d" (old), [new] "=&d" (new), [ptr] "+Q" (*ptr)\ 76 return old; \ 93 long old, new; \ 100 : [old] "=d" (old), [new] "=&d" (new), [ptr] "+Q" (*ptr)\ 102 return old; \ 123 static inline int __atomic_cmpxchg(int *ptr, int old, int new) in __atomic_cmpxchg() argument [all …]
|
/Linux-v5.4/arch/arm/kernel/ |
D | ftrace.c | 79 static int ftrace_modify_code(unsigned long pc, unsigned long old, in ftrace_modify_code() argument 85 old = __opcode_to_mem_thumb32(old); in ftrace_modify_code() 88 old = __opcode_to_mem_arm(old); in ftrace_modify_code() 96 if (replaced != old) in ftrace_modify_code() 133 unsigned long new, old; in ftrace_make_call() local 136 old = ftrace_nop_replace(rec); in ftrace_make_call() 140 return ftrace_modify_code(rec->ip, old, new, true); in ftrace_make_call() 148 unsigned long new, old; in ftrace_modify_call() local 151 old = ftrace_call_replace(ip, adjust_address(rec, old_addr)); in ftrace_modify_call() 155 return ftrace_modify_code(rec->ip, old, new, true); in ftrace_modify_call() [all …]
|
/Linux-v5.4/kernel/ |
D | tracepoint.c | 91 static inline void release_probes(struct tracepoint_func *old) in release_probes() argument 93 if (old) { in release_probes() 94 struct tp_probes *tp_probes = container_of(old, in release_probes() 132 struct tracepoint_func *old, *new; in func_add() local 140 old = *funcs; in func_add() 141 if (old) { in func_add() 143 for (nr_probes = 0; old[nr_probes].func; nr_probes++) { in func_add() 145 if (pos < 0 && old[nr_probes].prio < prio) in func_add() 147 if (old[nr_probes].func == tp_func->func && in func_add() 148 old[nr_probes].data == tp_func->data) in func_add() [all …]
|
D | cred.c | 253 const struct cred *old; in prepare_creds() local 264 old = task->cred; in prepare_creds() 265 memcpy(new, old, sizeof(struct cred)); in prepare_creds() 285 if (security_prepare_creds(new, old, GFP_KERNEL) < 0) in prepare_creds() 437 const struct cred *old = task->real_cred; in commit_creds() local 443 BUG_ON(task->cred != old); in commit_creds() 445 BUG_ON(read_cred_subscribers(old) < 2); in commit_creds() 446 validate_creds(old); in commit_creds() 454 if (!uid_eq(old->euid, new->euid) || in commit_creds() 455 !gid_eq(old->egid, new->egid) || in commit_creds() [all …]
|
/Linux-v5.4/include/linux/ |
D | iversion.h | 126 u64 cur, old; in inode_set_max_iversion_raw() local 132 old = atomic64_cmpxchg(&inode->i_version, cur, val); in inode_set_max_iversion_raw() 133 if (likely(old == cur)) in inode_set_max_iversion_raw() 135 cur = old; in inode_set_max_iversion_raw() 200 u64 cur, old, new; in inode_maybe_inc_iversion() local 222 old = atomic64_cmpxchg(&inode->i_version, cur, new); in inode_maybe_inc_iversion() 223 if (likely(old == cur)) in inode_maybe_inc_iversion() 225 cur = old; in inode_maybe_inc_iversion() 307 u64 cur, old, new; in inode_query_iversion() local 323 old = atomic64_cmpxchg(&inode->i_version, cur, new); in inode_query_iversion() [all …]
|
/Linux-v5.4/drivers/input/joystick/iforce/ |
D | iforce-ff.c | 182 struct ff_effect *old, in need_condition_modifier() argument 195 ret |= old->u.condition[i].right_saturation != new->u.condition[i].right_saturation in need_condition_modifier() 196 || old->u.condition[i].left_saturation != new->u.condition[i].left_saturation in need_condition_modifier() 197 || old->u.condition[i].right_coeff != new->u.condition[i].right_coeff in need_condition_modifier() 198 || old->u.condition[i].left_coeff != new->u.condition[i].left_coeff in need_condition_modifier() 199 || old->u.condition[i].deadband != new->u.condition[i].deadband in need_condition_modifier() 200 || old->u.condition[i].center != new->u.condition[i].center; in need_condition_modifier() 210 struct ff_effect *old, in need_magnitude_modifier() argument 219 return old->u.constant.level != effect->u.constant.level; in need_magnitude_modifier() 226 static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old, in need_envelope_modifier() argument [all …]
|
/Linux-v5.4/arch/sh/kernel/ |
D | ftrace.c | 102 int old = atomic_read(&nmi_running); in clear_mod_flag() local 105 int new = old & ~MOD_CODE_WRITE_FLAG; in clear_mod_flag() 107 if (old == new) in clear_mod_flag() 110 old = atomic_cmpxchg(&nmi_running, old, new); in clear_mod_flag() 225 unsigned char old[MCOUNT_INSN_SIZE], *new; in ftrace_update_ftrace_func() local 227 memcpy(old, (unsigned char *)ip, MCOUNT_INSN_SIZE); in ftrace_update_ftrace_func() 230 return ftrace_modify_code(ip, old, new); in ftrace_update_ftrace_func() 236 unsigned char *new, *old; in ftrace_make_nop() local 239 old = ftrace_call_replace(ip, addr); in ftrace_make_nop() 242 return ftrace_modify_code(rec->ip, old, new); in ftrace_make_nop() [all …]
|
/Linux-v5.4/arch/x86/include/asm/ |
D | atomic64_32.h | 269 s64 old, c = 0; in arch_atomic64_and() local 271 while ((old = arch_atomic64_cmpxchg(v, c, c & i)) != c) in arch_atomic64_and() 272 c = old; in arch_atomic64_and() 277 s64 old, c = 0; in arch_atomic64_fetch_and() local 279 while ((old = arch_atomic64_cmpxchg(v, c, c & i)) != c) in arch_atomic64_fetch_and() 280 c = old; in arch_atomic64_fetch_and() 282 return old; in arch_atomic64_fetch_and() 287 s64 old, c = 0; in arch_atomic64_or() local 289 while ((old = arch_atomic64_cmpxchg(v, c, c | i)) != c) in arch_atomic64_or() 290 c = old; in arch_atomic64_or() [all …]
|
/Linux-v5.4/arch/sparc/include/asm/ |
D | cmpxchg_64.h | 11 __cmpxchg_u32(volatile int *m, int old, int new) in __cmpxchg_u32() argument 15 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u32() 115 __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) in __cmpxchg_u64() argument 119 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u64() 131 __cmpxchg_u8(volatile unsigned char *m, unsigned char old, unsigned char new) in __cmpxchg_u8() argument 142 old32 = (load32 & ~mask) | (old << bit_shift); in __cmpxchg_u8() 145 return old; in __cmpxchg_u8() 147 } while (load == old); in __cmpxchg_u8() 157 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) in __cmpxchg() argument 161 return __cmpxchg_u8(ptr, old, new); in __cmpxchg() [all …]
|
/Linux-v5.4/security/safesetid/ |
D | lsm.c | 100 static bool uid_permitted_for_cred(const struct cred *old, kuid_t new_uid) in uid_permitted_for_cred() argument 105 if (uid_eq(new_uid, old->uid) || uid_eq(new_uid, old->euid) || in uid_permitted_for_cred() 106 uid_eq(new_uid, old->suid)) in uid_permitted_for_cred() 114 setuid_policy_lookup(old->uid, new_uid) != SIDPOL_CONSTRAINED; in uid_permitted_for_cred() 117 __kuid_val(old->uid), __kuid_val(old->euid), in uid_permitted_for_cred() 118 __kuid_val(old->suid), __kuid_val(new_uid)); in uid_permitted_for_cred() 129 const struct cred *old, in safesetid_task_fix_setuid() argument 134 if (setuid_policy_lookup(old->uid, INVALID_UID) == SIDPOL_DEFAULT) in safesetid_task_fix_setuid() 137 if (uid_permitted_for_cred(old, new->uid) && in safesetid_task_fix_setuid() 138 uid_permitted_for_cred(old, new->euid) && in safesetid_task_fix_setuid() [all …]
|
/Linux-v5.4/drivers/gpu/drm/ |
D | drm_lock.c | 62 unsigned int old, new, prev; in drm_lock_take() local 67 old = *lock; in drm_lock_take() 68 if (old & _DRM_LOCK_HELD) in drm_lock_take() 69 new = old | _DRM_LOCK_CONT; in drm_lock_take() 75 prev = cmpxchg(lock, old, new); in drm_lock_take() 76 } while (prev != old); in drm_lock_take() 79 if (_DRM_LOCKING_CONTEXT(old) == context) { in drm_lock_take() 80 if (old & _DRM_LOCK_HELD) { in drm_lock_take() 111 unsigned int old, new, prev; in drm_lock_transfer() local 116 old = *lock; in drm_lock_transfer() [all …]
|
/Linux-v5.4/include/asm-generic/bitops/ |
D | lock.h | 21 long old; in test_and_set_bit_lock() local 28 old = atomic_long_fetch_or_acquire(mask, (atomic_long_t *)p); in test_and_set_bit_lock() 29 return !!(old & mask); in test_and_set_bit_lock() 60 unsigned long old; in __clear_bit_unlock() local 63 old = READ_ONCE(*p); in __clear_bit_unlock() 64 old &= ~BIT_MASK(nr); in __clear_bit_unlock() 65 atomic_long_set_release((atomic_long_t *)p, old); in __clear_bit_unlock() 81 long old; in clear_bit_unlock_is_negative_byte() local 85 old = atomic_long_fetch_andnot_release(mask, (atomic_long_t *)p); in clear_bit_unlock_is_negative_byte() 86 return !!(old & BIT(7)); in clear_bit_unlock_is_negative_byte()
|
/Linux-v5.4/arch/alpha/include/asm/ |
D | xchg.h | 129 ____cmpxchg(_u8, volatile char *m, unsigned char old, unsigned char new) in ____cmpxchg() argument 149 : "r" ((long)m), "Ir" (old), "1" (new) : "memory"); in ____cmpxchg() 155 ____cmpxchg(_u16, volatile short *m, unsigned short old, unsigned short new) in ____cmpxchg() argument 175 : "r" ((long)m), "Ir" (old), "1" (new) : "memory"); in ____cmpxchg() 181 ____cmpxchg(_u32, volatile int *m, int old, int new) in ____cmpxchg() argument 197 : "r"((long) old), "r"(new), "m"(*m) : "memory"); in ____cmpxchg() 203 ____cmpxchg(_u64, volatile long *m, unsigned long old, unsigned long new) in ____cmpxchg() argument 219 : "r"((long) old), "r"(new), "m"(*m) : "memory"); in ____cmpxchg() 229 ____cmpxchg(, volatile void *ptr, unsigned long old, unsigned long new, 234 return ____cmpxchg(_u8, ptr, old, new); [all …]
|
/Linux-v5.4/arch/sparc/lib/ |
D | atomic32.c | 83 int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() argument 90 if (likely(ret == old)) in atomic_cmpxchg() 125 unsigned long old, flags; in ___set_bit() local 128 old = *addr; in ___set_bit() 129 *addr = old | mask; in ___set_bit() 132 return old & mask; in ___set_bit() 138 unsigned long old, flags; in ___clear_bit() local 141 old = *addr; in ___clear_bit() 142 *addr = old & ~mask; in ___clear_bit() 145 return old & mask; in ___clear_bit() [all …]
|
/Linux-v5.4/sound/soc/sof/ |
D | ops.c | 19 unsigned int old, new; in snd_sof_pci_update_bits_unlocked() local 23 old = ret; in snd_sof_pci_update_bits_unlocked() 24 dev_dbg(sdev->dev, "Debug PCIR: %8.8x at %8.8x\n", old & mask, offset); in snd_sof_pci_update_bits_unlocked() 26 new = (old & ~mask) | (value & mask); in snd_sof_pci_update_bits_unlocked() 28 if (old == new) in snd_sof_pci_update_bits_unlocked() 54 unsigned int old, new; in snd_sof_dsp_update_bits_unlocked() local 59 old = ret; in snd_sof_dsp_update_bits_unlocked() 60 new = (old & ~mask) | (value & mask); in snd_sof_dsp_update_bits_unlocked() 62 if (old == new) in snd_sof_dsp_update_bits_unlocked() 74 u64 old, new; in snd_sof_dsp_update_bits64_unlocked() local [all …]
|