/linux-6.6.21/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-6.6.21/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 | 34 __s32 old, new; \ 39 old = arch_atomic_read(v); \ 40 new = old c_op i; \ 41 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); \ 49 __s32 old, new; \ 54 old = arch_atomic_read(v); \ 55 new = old c_op i; \ 56 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); \ 57 return old; \ 129 s64 old, new; \ [all …]
|
/linux-6.6.21/arch/s390/include/asm/ |
D | atomic_ops.h | 50 op_type old; \ 55 : [old] "=d" (old), [ptr] "+QS" (*ptr) \ 57 return old; \ 101 int old, new; \ 108 : [old] "=d" (old), [new] "=&d" (new), [ptr] "+Q" (*ptr)\ 110 return old; \ 127 long old, new; \ 134 : [old] "=d" (old), [new] "=&d" (new), [ptr] "+QS" (*ptr)\ 136 return old; \ 157 static inline int __atomic_cmpxchg(int *ptr, int old, int new) in __atomic_cmpxchg() argument [all …]
|
D | cmpxchg.h | 20 unsigned long old; in __arch_xchg() local 34 : "=&d" (old), "+Q" (*(int *) address) in __arch_xchg() 37 return old >> shift; in __arch_xchg() 48 : "=&d" (old), "+Q" (*(int *) address) in __arch_xchg() 51 return old >> shift; in __arch_xchg() 57 : "=&d" (old), "+Q" (*(int *) address) in __arch_xchg() 60 return old; in __arch_xchg() 66 : "=&d" (old), "+QS" (*(long *) address) in __arch_xchg() 69 return old; in __arch_xchg() 88 unsigned long old, in __cmpxchg() argument [all …]
|
/linux-6.6.21/arch/powerpc/include/asm/ |
D | cmpxchg.h | 42 u32 __cmpxchg_##type##sfx(volatile void *p, u32 old, u32 new) \ 49 old <<= bitoff; \ 67 : "r" (p), "r" (old), "r" (new), "r" (prev_mask) \ 283 __cmpxchg_u8(volatile unsigned char *p, unsigned long old, unsigned long new) in __cmpxchg_u8() argument 298 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8() 305 __cmpxchg_u8_local(volatile unsigned char *p, unsigned long old, in __cmpxchg_u8_local() argument 318 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8_local() 325 __cmpxchg_u8_relaxed(u8 *p, unsigned long old, unsigned long new) in __cmpxchg_u8_relaxed() argument 337 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8_relaxed() 344 __cmpxchg_u8_acquire(u8 *p, unsigned long old, unsigned long new) in __cmpxchg_u8_acquire() argument [all …]
|
/linux-6.6.21/lib/ |
D | errseq.c | 61 errseq_t cur, old; in errseq_set() local 72 old = READ_ONCE(*eseq); in errseq_set() 76 return old; in errseq_set() 82 new = (old & ~(MAX_ERRNO|ERRSEQ_SEEN)) | -err; in errseq_set() 85 if (old & ERRSEQ_SEEN) in errseq_set() 89 if (new == old) { in errseq_set() 95 cur = cmpxchg(eseq, old, new); in errseq_set() 101 if (likely(cur == old || cur == new)) in errseq_set() 105 old = cur; in errseq_set() 125 errseq_t old = READ_ONCE(*eseq); in errseq_sample() local [all …]
|
/linux-6.6.21/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-6.6.21/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-6.6.21/security/safesetid/ |
D | lsm.c | 147 static bool id_permitted_for_cred(const struct cred *old, kid_t new_id, enum setid_type new_type) in id_permitted_for_cred() argument 153 if (uid_eq(new_id.uid, old->uid) || uid_eq(new_id.uid, old->euid) || in id_permitted_for_cred() 154 uid_eq(new_id.uid, old->suid)) in id_permitted_for_cred() 157 if (gid_eq(new_id.gid, old->gid) || gid_eq(new_id.gid, old->egid) || in id_permitted_for_cred() 158 gid_eq(new_id.gid, old->sgid)) in id_permitted_for_cred() 168 setid_policy_lookup((kid_t){.uid = old->uid}, new_id, new_type) != SIDPOL_CONSTRAINED; in id_permitted_for_cred() 173 __kuid_val(old->uid), __kuid_val(old->euid), in id_permitted_for_cred() 174 __kuid_val(old->suid), __kuid_val(new_id.uid)); in id_permitted_for_cred() 177 __kgid_val(old->gid), __kgid_val(old->egid), in id_permitted_for_cred() 178 __kgid_val(old->sgid), __kgid_val(new_id.gid)); in id_permitted_for_cred() [all …]
|
/linux-6.6.21/kernel/ |
D | tracepoint.c | 142 static inline void release_probes(struct tracepoint_func *old) in release_probes() argument 144 if (old) { in release_probes() 145 struct tp_probes *tp_probes = container_of(old, in release_probes() 183 struct tracepoint_func *old, *new; in func_add() local 192 old = *funcs; in func_add() 193 if (old) { in func_add() 195 for (iter_probes = 0; old[iter_probes].func; iter_probes++) { in func_add() 196 if (old[iter_probes].func == tp_stub_func) in func_add() 198 if (old[iter_probes].func == tp_func->func && in func_add() 199 old[iter_probes].data == tp_func->data) in func_add() [all …]
|
D | cred.c | 204 const struct cred *old; in prepare_creds() local 213 old = task->cred; in prepare_creds() 214 memcpy(new, old, sizeof(struct cred)); in prepare_creds() 237 if (security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT) < 0) in prepare_creds() 391 const struct cred *old = task->real_cred; in commit_creds() local 396 BUG_ON(task->cred != old); in commit_creds() 402 if (!uid_eq(old->euid, new->euid) || in commit_creds() 403 !gid_eq(old->egid, new->egid) || in commit_creds() 404 !uid_eq(old->fsuid, new->fsuid) || in commit_creds() 405 !gid_eq(old->fsgid, new->fsgid) || in commit_creds() [all …]
|
/linux-6.6.21/include/linux/ |
D | refcount.h | 152 int old = refcount_read(r); in __refcount_add_not_zero() local 155 if (!old) in __refcount_add_not_zero() 157 } while (!atomic_try_cmpxchg_relaxed(&r->refs, &old, old + i)); in __refcount_add_not_zero() 160 *oldp = old; in __refcount_add_not_zero() 162 if (unlikely(old < 0 || old + i < 0)) in __refcount_add_not_zero() 165 return old; in __refcount_add_not_zero() 193 int old = atomic_fetch_add_relaxed(i, &r->refs); in __refcount_add() local 196 *oldp = old; in __refcount_add() 198 if (unlikely(!old)) in __refcount_add() 200 else if (unlikely(old < 0 || old + i < 0)) in __refcount_add() [all …]
|
/linux-6.6.21/arch/arm/kernel/ |
D | ftrace.c | 98 static int ftrace_modify_code(unsigned long pc, unsigned long old, in ftrace_modify_code() argument 104 old = __opcode_to_mem_thumb32(old); in ftrace_modify_code() 106 old = __opcode_to_mem_arm(old); in ftrace_modify_code() 113 if (replaced != old) in ftrace_modify_code() 147 unsigned long new, old; in ftrace_make_call() local 156 old = ftrace_nop_replace(rec); in ftrace_make_call() 166 return ftrace_modify_code(rec->ip, old, new, true); in ftrace_make_call() 174 unsigned long new, old; in ftrace_modify_call() local 177 old = ftrace_call_replace(ip, adjust_address(rec, old_addr), true); in ftrace_modify_call() 181 return ftrace_modify_code(rec->ip, old, new, true); in ftrace_modify_call() [all …]
|
/linux-6.6.21/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-6.6.21/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-6.6.21/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-6.6.21/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-6.6.21/arch/x86/include/asm/ |
D | atomic64_32.h | 198 s64 old, c = 0; in arch_atomic64_and() local 200 while ((old = arch_atomic64_cmpxchg(v, c, c & i)) != c) in arch_atomic64_and() 201 c = old; in arch_atomic64_and() 206 s64 old, c = 0; in arch_atomic64_fetch_and() local 208 while ((old = arch_atomic64_cmpxchg(v, c, c & i)) != c) in arch_atomic64_fetch_and() 209 c = old; in arch_atomic64_fetch_and() 211 return old; in arch_atomic64_fetch_and() 217 s64 old, c = 0; in arch_atomic64_or() local 219 while ((old = arch_atomic64_cmpxchg(v, c, c | i)) != c) in arch_atomic64_or() 220 c = old; in arch_atomic64_or() [all …]
|
D | cmpxchg.h | 85 #define __raw_cmpxchg(ptr, old, new, size, lock) \ argument 88 __typeof__(*(ptr)) __old = (old); \ 133 #define __cmpxchg(ptr, old, new, size) \ argument 134 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX) 136 #define __sync_cmpxchg(ptr, old, new, size) \ argument 137 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ") 139 #define __cmpxchg_local(ptr, old, new, size) \ argument 140 __raw_cmpxchg((ptr), (old), (new), (size), "") 148 #define arch_cmpxchg(ptr, old, new) \ argument 149 __cmpxchg(ptr, old, new, sizeof(*(ptr))) [all …]
|
/linux-6.6.21/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-6.6.21/include/asm-generic/bitops/ |
D | lock.h | 21 long old; in arch_test_and_set_bit_lock() local 28 old = raw_atomic_long_fetch_or_acquire(mask, (atomic_long_t *)p); in arch_test_and_set_bit_lock() 29 return !!(old & mask); in arch_test_and_set_bit_lock() 61 unsigned long old; in arch___clear_bit_unlock() local 64 old = READ_ONCE(*p); in arch___clear_bit_unlock() 65 old &= ~BIT_MASK(nr); in arch___clear_bit_unlock() 66 raw_atomic_long_set_release((atomic_long_t *)p, old); in arch___clear_bit_unlock() 82 long old; in arch_clear_bit_unlock_is_negative_byte() local 86 old = raw_atomic_long_fetch_andnot_release(mask, (atomic_long_t *)p); in arch_clear_bit_unlock_is_negative_byte() 87 return !!(old & BIT(7)); in arch_clear_bit_unlock_is_negative_byte()
|
/linux-6.6.21/arch/sparc/lib/ |
D | atomic32.c | 83 int arch_atomic_cmpxchg(atomic_t *v, int old, int new) in arch_atomic_cmpxchg() argument 90 if (likely(ret == old)) in arch_atomic_cmpxchg() 125 unsigned long old, flags; in sp32___set_bit() local 128 old = *addr; in sp32___set_bit() 129 *addr = old | mask; in sp32___set_bit() 132 return old & mask; in sp32___set_bit() 138 unsigned long old, flags; in sp32___clear_bit() local 141 old = *addr; in sp32___clear_bit() 142 *addr = old & ~mask; in sp32___clear_bit() 145 return old & mask; in sp32___clear_bit() [all …]
|