| /linux/arch/sh/include/asm/ |
| H A 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 …]
|
| H A 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/arch/s390/include/asm/ |
| H A D | cmpxchg.h | 18 static __always_inline u32 __cs_asm(u64 ptr, u32 old, u32 new) in __cs_asm() argument 21 " cs %[old],%[new],%[ptr]" in __cs_asm() 22 : [old] "+d" (old), [ptr] "+Q" (*(u32 *)ptr) in __cs_asm() 25 return old; in __cs_asm() 28 static __always_inline u64 __csg_asm(u64 ptr, u64 old, u64 new) in __csg_asm() argument 31 " csg %[old],%[new],%[ptr]" in __csg_asm() 32 : [old] "+d" (old), [ptr] "+QS" (*(u64 *)ptr) in __csg_asm() 35 return old; in __csg_asm() 38 static inline u8 __arch_cmpxchg1(u64 ptr, u8 old, u8 new) in __arch_cmpxchg1() argument 52 if (old32.b[i] != old) in __arch_cmpxchg1() [all …]
|
| H A D | futex.h | 14 __futex_atomic_##name(int oparg, int *old, u32 __user *uaddr) \ 19 instrument_copy_from_user_before(old, uaddr, sizeof(*old)); \ 23 "0: l %[old],%[uaddr]\n" \ 25 "2: cs %[old],%[new],%[uaddr]\n" \ 33 : [rc] "=d" (rc), [old] "=&d" (*old), \ 39 instrument_copy_from_user_after(old, uaddr, sizeof(*old), 0); \ 44 FUTEX_OP_FUNC(add, "lr %[new],%[old]\n ar %[new],%[oparg]\n") 45 FUTEX_OP_FUNC(or, "lr %[new],%[old]\n or %[new],%[oparg]\n") 46 FUTEX_OP_FUNC(and, "lr %[new],%[old]\n nr %[new],%[oparg]\n") 47 FUTEX_OP_FUNC(xor, "lr %[new],%[old]\n xr %[new],%[oparg]\n") [all …]
|
| H A D | spinlock.h | 76 int old = 0; in arch_spin_trylock_once() local 79 return likely(arch_try_cmpxchg(&lp->lock, &old, spinlock_lockval())); in arch_spin_trylock_once() 126 int old; in arch_read_lock() local 128 old = __atomic_add(1, &rw->cnts); in arch_read_lock() 129 if (old & 0xffff0000) in arch_read_lock() 140 int old = 0; in arch_write_lock() local 142 if (!arch_try_cmpxchg(&rw->cnts, &old, 0x30000)) in arch_write_lock() 154 int old; in arch_read_trylock() local 156 old = READ_ONCE(rw->cnts); in arch_read_trylock() 157 return (!(old & 0xffff0000) && arch_try_cmpxchg(&rw->cnts, &old, old + 1)); in arch_read_trylock() [all …]
|
| /linux/arch/s390/mm/ |
| H A D | pgtable.c | 83 pte_t old; in ptep_flush_direct() local 85 old = *ptep; in ptep_flush_direct() 86 if (unlikely(pte_val(old) & _PAGE_INVALID)) in ptep_flush_direct() 87 return old; in ptep_flush_direct() 95 return old; in ptep_flush_direct() 102 pte_t old; in ptep_flush_lazy() local 104 old = *ptep; in ptep_flush_lazy() 105 if (unlikely(pte_val(old) & _PAGE_INVALID)) in ptep_flush_lazy() 106 return old; in ptep_flush_lazy() 115 return old; in ptep_flush_lazy() [all …]
|
| /linux/arch/powerpc/include/asm/ |
| H A 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) \ 269 * Compare and exchange - if *p == old, set it to new, 270 * and return the old value of *p. 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 [all …]
|
| /linux/security/safesetid/ |
| H A D | lsm.c | 145 * Check whether a caller with old credentials @old is allowed to switch to 148 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 152 /* If our old creds already had this ID in it, it's fine. */ in id_permitted_for_cred() 154 if (uid_eq(new_id.uid, old->uid) || uid_eq(new_id.uid, old->euid) || in id_permitted_for_cred() 155 uid_eq(new_id.uid, old->suid)) in id_permitted_for_cred() 158 if (gid_eq(new_id.gid, old->gid) || gid_eq(new_id.gid, old->egid) || in id_permitted_for_cred() 159 gid_eq(new_id.gid, old->sgid)) in id_permitted_for_cred() 165 * Transitions to new UIDs require a check against the policy of the old in id_permitted_for_cred() 169 setid_policy_lookup((kid_t){.uid = old->uid}, new_id, new_type) != SIDPOL_CONSTRAINED; in id_permitted_for_cred() 174 __kuid_val(old->uid), __kuid_val(old->euid), in id_permitted_for_cred() [all …]
|
| /linux/drivers/input/joystick/iforce/ |
| H A D | iforce-ff.c | 178 struct ff_effect *old, in need_condition_modifier() argument 191 ret |= old->u.condition[i].right_saturation != new->u.condition[i].right_saturation in need_condition_modifier() 192 || old->u.condition[i].left_saturation != new->u.condition[i].left_saturation in need_condition_modifier() 193 || old->u.condition[i].right_coeff != new->u.condition[i].right_coeff in need_condition_modifier() 194 || old->u.condition[i].left_coeff != new->u.condition[i].left_coeff in need_condition_modifier() 195 || old->u.condition[i].deadband != new->u.condition[i].deadband in need_condition_modifier() 196 || old->u.condition[i].center != new->u.condition[i].center; in need_condition_modifier() 206 struct ff_effect *old, in need_magnitude_modifier() argument 215 return old->u.constant.level != effect->u.constant.level; in need_magnitude_modifier() 222 static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old, in need_envelope_modifier() argument [all …]
|
| /linux/arch/s390/lib/ |
| H A D | spinlock.c | 106 static inline int arch_try_cmpxchg_niai8(int *lock, int old, int new) in arch_try_cmpxchg_niai8() argument 112 " cs %[old],%[new],%[lock]" in arch_try_cmpxchg_niai8() 113 : [old] "+d" (old), [lock] "+Q" (*lock), "=@cc" (cc) in arch_try_cmpxchg_niai8() 121 static inline int arch_try_cmpxchg_niai8(int *lock, int old, int new) in arch_try_cmpxchg_niai8() argument 123 int expected = old; in arch_try_cmpxchg_niai8() 127 " cs %[old],%[new],%[lock]" in arch_try_cmpxchg_niai8() 128 : [old] "+d" (old), [lock] "+Q" (*lock) in arch_try_cmpxchg_niai8() 131 return expected == old; in arch_try_cmpxchg_niai8() 159 int lockval, ix, node_id, tail_id, old, new, owner, count; in arch_spin_lock_queued() local 169 old = READ_ONCE(lp->lock); in arch_spin_lock_queued() [all …]
|
| /linux/arch/sparc/kernel/ |
| H A D | ftrace.c | 26 static int ftrace_modify_code(unsigned long ip, u32 old, u32 new) in ftrace_modify_code() argument 32 "1: cas [%[ip]], %[old], %[new]\n" in ftrace_modify_code() 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() [all …]
|
| /linux/kernel/ |
| H A D | tracepoint.c | 115 static inline void release_probes(struct tracepoint *tp, struct tracepoint_func *old) in release_probes() argument 117 if (old) { in release_probes() 118 struct tp_probes *tp_probes = container_of(old, in release_probes() 146 struct tracepoint_func *old, *new; in func_add() local 147 int iter_probes; /* Iterate over old probe array. */ in func_add() 155 old = *funcs; in func_add() 156 if (old) { in func_add() 158 for (iter_probes = 0; old[iter_probes].func; iter_probes++) { in func_add() 159 if (old[iter_probes].func == tp_stub_func) in func_add() 161 if (old[iter_probes].func == tp_func->func && in func_add() [all …]
|
| H A D | cred.c | 182 const struct cred *old; in prepare_creds() local 191 old = task->cred; in prepare_creds() 192 memcpy(new, old, sizeof(struct cred)); in prepare_creds() 215 if (security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT) < 0) in prepare_creds() 359 * the old set. Both the objective and the subjective credentials pointers are 371 const struct cred *old = task->real_cred; in commit_creds() local 376 BUG_ON(task->cred != old); in commit_creds() 382 if (!uid_eq(old->euid, new->euid) || in commit_creds() 383 !gid_eq(old->egid, new->egid) || in commit_creds() 384 !uid_eq(old->fsuid, new->fsuid) || in commit_creds() [all …]
|
| /linux/net/smc/ |
| H A D | smc_cdc.h | 146 /* calculate cursor difference between old and new, where old <= new and 150 union smc_host_cursor *old, in smc_curs_diff() argument 153 if (old->wrap != new->wrap) in smc_curs_diff() 155 ((size - old->count) + new->count)); in smc_curs_diff() 157 return max_t(int, 0, (new->count - old->count)); in smc_curs_diff() 160 /* calculate cursor difference between old and new - returns negative 161 * value in case old > new 164 union smc_host_cursor *old, in smc_curs_comp() argument 167 if (old->wrap > new->wrap || in smc_curs_comp() 168 (old->wrap == new->wrap && old->count > new->count)) in smc_curs_comp() [all …]
|
| /linux/arch/arm/kernel/ |
| H A 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/tools/testing/selftests/bpf/progs/ |
| H A D | map_kptr_race.c | 44 struct prog_test_ref_kfunc *p, *old; in test_htab_leak() local 59 old = bpf_kptr_xchg(&v->ref_ptr, p); in test_htab_leak() 60 if (old) in test_htab_leak() 61 bpf_kfunc_call_test_release(old); in test_htab_leak() 68 old = bpf_kptr_xchg(&v->ref_ptr, p); in test_htab_leak() 69 if (old) in test_htab_leak() 70 bpf_kfunc_call_test_release(old); in test_htab_leak() 77 struct prog_test_ref_kfunc *p, *old; in fill_percpu_kptr() local 82 old = bpf_kptr_xchg(&v->ref_ptr, p); in fill_percpu_kptr() 83 if (old) in fill_percpu_kptr() [all …]
|
| /linux/arch/sparc/include/asm/ |
| H A 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() 78 /* Read the old value */ in xchg16() 106 * Atomic compare and exchange. Compare OLD with MEM, if identical, 108 * indicated by comparing RETURN with OLD. 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() [all …]
|
| /linux/Documentation/ |
| H A D | atomic_t.txt | 279 int atomic_cmpxchg(atomic_t *ptr, int old, int new); 287 int ret, old = *oldp; 288 ret = atomic_cmpxchg(ptr, old, new); 289 if (ret != old) 291 return ret == old; 296 int atomic_cmpxchg(atomic_t *ptr, int old, int new) 298 (void)atomic_try_cmpxchg(ptr, &old, new); 299 return old; 304 old = atomic_read(&v); old = atomic_read(&v); 306 new = func(old); new = func(old); [all …]
|
| /linux/include/linux/ |
| H A D | refcount.h | 32 * int old = atomic_fetch_add_relaxed(r); 33 * // old is INT_MAX, refcount now INT_MIN (0x8000_0000) 34 * if (old < 0) 176 int old = refcount_read(r); in __refcount_add_not_zero() local 179 if (!old) in __refcount_add_not_zero() 181 } while (!atomic_try_cmpxchg_relaxed(&r->refs, &old, old + i)); in __refcount_add_not_zero() 184 *oldp = old; in __refcount_add_not_zero() 186 if (unlikely(old < 0 || old in __refcount_add_not_zero() 219 int old = refcount_read(r); __refcount_add_not_zero_limited_acquire() local 283 int old = atomic_fetch_add_relaxed(i, &r->refs); __refcount_add() local 389 int old = atomic_fetch_sub_release(i, &r->refs); __refcount_sub_and_test() local 455 int old = atomic_fetch_sub_release(1, &r->refs); __refcount_dec() local [all...] |
| /linux/arch/sparc/lib/ |
| H A 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 …]
|
| /linux/arch/x86/include/asm/ |
| H A D | cmpxchg.h | 40 * returns the old value. 81 * Atomic compare and exchange. Compare OLD with MEM, if identical, 83 * indicated by comparing RETURN with OLD. 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 [all …]
|
| /linux/arch/alpha/include/asm/ |
| H A D | atomic.h | 205 int c, new, old; in ATOMIC_OPS() local 208 "1: ldl_l %[old],%[mem]\n" in ATOMIC_OPS() 209 " cmpeq %[old],%[u],%[c]\n" in ATOMIC_OPS() 210 " addl %[old],%[a],%[new]\n" in ATOMIC_OPS() 218 : [old] "=&r"(old), [new] "=&r"(new), [c] "=&r"(c) in ATOMIC_OPS() 222 return old; in ATOMIC_OPS() 228 s64 c, new, old; in arch_atomic64_fetch_add_unless() local 231 "1: ldq_l %[old],%[mem]\n" in arch_atomic64_fetch_add_unless() 232 " cmpeq %[old],%[u],%[c]\n" in arch_atomic64_fetch_add_unless() 233 " addq %[old],%[a],%[new]\n" in arch_atomic64_fetch_add_unless() [all …]
|
| /linux/lib/ |
| H A D | errseq.c | 64 errseq_t cur, old; in errseq_set() local 73 old = READ_ONCE(*eseq); in errseq_set() 77 return old; in errseq_set() 83 new = (old & ~(ERRNO_MASK | ERRSEQ_SEEN)) | -err; in errseq_set() 86 if (old & ERRSEQ_SEEN) in errseq_set() 90 if (new == old) { in errseq_set() 96 cur = cmpxchg(eseq, old, new); in errseq_set() 102 if (likely(cur == old || cur == new)) in errseq_set() 106 old = cur; in errseq_set() 117 * If the error has been "seen", new callers will not see an old error. [all …]
|
| /linux/sound/soc/sof/ |
| H A 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() 49 unsigned int old, new; 54 old = ret; in snd_sof_dsp_update_bits_unlocked() local 55 new = (old & ~mask) | (value & mask); in snd_sof_dsp_update_bits_unlocked() 57 if (old == new) in snd_sof_dsp_update_bits_unlocked() 69 u64 old, ne in snd_sof_dsp_update_bits_unlocked() 74 u64 old, new; snd_sof_dsp_update_bits64_unlocked() local 122 unsigned int old, new; snd_sof_dsp_update_bits_forced_unlocked() local [all...] |
| /linux/tools/docs/ |
| H A D | gen-renames.py | 59 _, old, new = line[1:].split('\t', 2) variable 61 if old.endswith('.rst') and new.endswith('.rst'): 62 old = normalize(old) variable 65 name = names.get(old) 67 name = Name(old) 69 del names[old] 78 _, old = line.split('\t', 1) variable 80 if old.endswith('.rst'): 81 old = normalize(old) variable 85 name = names.get(old) [all …]
|