Home
last modified time | relevance | path

Searched refs:atomic_cmpxchg (Results 1 – 95 of 95) sorted by relevance

/linux-4.1.27/include/linux/
Datomic.h53 val = atomic_cmpxchg(v, c, c + 1); in atomic_inc_not_zero_hint()
68 v1 = atomic_cmpxchg(p, v, v + 1); in atomic_inc_unless_negative()
81 v1 = atomic_cmpxchg(p, v, v - 1); in atomic_dec_unless_positive()
105 old = atomic_cmpxchg((v), c, dec); in atomic_dec_if_positive()
123 } while (atomic_cmpxchg(v, old, new) != old); in atomic_or()
Dpagemap.h203 return likely(atomic_cmpxchg(&page->_count, count, 0) == count); in page_freeze_refs()
/linux-4.1.27/kernel/locking/
Dqrwlock.c102 (atomic_cmpxchg(&lock->cnts, 0, _QW_LOCKED) == 0)) in queue_write_lock_slowpath()
112 (atomic_cmpxchg(&lock->cnts, cnts, in queue_write_lock_slowpath()
123 (atomic_cmpxchg(&lock->cnts, _QW_WAITING, in queue_write_lock_slowpath()
Dosq_lock.c53 atomic_cmpxchg(&lock->tail, curr, old) == curr) { in osq_wait_next()
187 if (likely(atomic_cmpxchg(&lock->tail, curr, OSQ_UNLOCKED_VAL) == curr)) in osq_unlock()
Dmutex.c280 (atomic_cmpxchg(&lock->count, 1, 0) == 1); in mutex_try_to_acquire()
/linux-4.1.27/arch/sh/include/asm/
Datomic.h39 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) macro
57 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/m68k/include/asm/
Datomic.h120 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) macro
125 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
190 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/sh/kernel/
Dftrace.c122 old = atomic_cmpxchg(&nmi_running, old, new); in clear_mod_flag()
162 if (!atomic_cmpxchg(&nmi_running, 0, MOD_CODE_WRITE_FLAG)) in wait_for_nmi_and_set_mod_flag()
167 } while (atomic_cmpxchg(&nmi_running, 0, MOD_CODE_WRITE_FLAG)); in wait_for_nmi_and_set_mod_flag()
/linux-4.1.27/include/asm-generic/
Dqrwlock.h92 return likely(atomic_cmpxchg(&lock->cnts, in queue_write_trylock()
118 if (atomic_cmpxchg(&lock->cnts, 0, _QW_LOCKED) == 0) in queue_write_lock()
Datomic.h176 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) macro
182 while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c) in __atomic_add_unless()
Dmutex-dec.h83 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) in __mutex_fastpath_trylock()
Datomic-long.h252 (atomic_cmpxchg((atomic_t *)(l), (old), (new)))
/linux-4.1.27/arch/x86/include/asm/
Datomic.h175 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
201 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
Dmutex_32.h104 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) in __mutex_fastpath_trylock()
Dmutex_64.h121 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) in __mutex_fastpath_trylock()
/linux-4.1.27/arch/mn10300/include/asm/
Datomic.h122 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
128 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) macro
/linux-4.1.27/arch/xtensa/include/asm/
Datomic.h226 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) in ATOMIC_OPS() macro
245 old = atomic_cmpxchg((v), c, c + (a)); in ATOMIC_OPS()
/linux-4.1.27/arch/sparc/include/asm/
Datomic_64.h72 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) in ATOMIC_OPS() macro
82 old = atomic_cmpxchg((v), c, c + (a)); in ATOMIC_OPS()
Datomic_32.h24 int atomic_cmpxchg(atomic_t *, int, int);
/linux-4.1.27/arch/m32r/include/asm/
Datomic.h215 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) macro
234 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/frv/include/asm/
Datomic.h179 #define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new)) macro
191 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/sparc/lib/
Datomic32.c61 int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
74 EXPORT_SYMBOL(atomic_cmpxchg);
/linux-4.1.27/lib/
Ddump_stack.c40 old = atomic_cmpxchg(&dump_lock, -1, cpu); in dump_stack()
/linux-4.1.27/arch/arm/include/asm/
Datomic.h83 static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) in atomic_cmpxchg() function
164 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
183 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c) in __atomic_add_unless()
/linux-4.1.27/arch/arm64/include/asm/
Datomic.h92 static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) in ATOMIC_OPS()
121 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c) in __atomic_add_unless()
/linux-4.1.27/arch/ia64/include/asm/
Datomic.h118 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) macro
132 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/arc/include/asm/
Dcmpxchg.h81 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) macro
Datomic.h164 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c)\
/linux-4.1.27/arch/tile/lib/
Dspinlock_64.c28 return atomic_cmpxchg((atomic_t *)lock, -1, -1); in arch_spin_read_noalloc()
/linux-4.1.27/arch/parisc/include/asm/
Datomic.h74 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) macro
93 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/arch/s390/include/asm/
Datomic.h133 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
150 old = atomic_cmpxchg(v, c, c + a); in __atomic_add_unless()
/linux-4.1.27/arch/tile/include/asm/
Datomic.h137 static inline int atomic_cmpxchg(atomic_t *v, int o, int n) in atomic_cmpxchg() function
/linux-4.1.27/drivers/md/bcache/
Dio.c174 count = atomic_cmpxchg(&ca->io_count, old, new); in bch_count_io_errors()
183 errors = atomic_cmpxchg(&ca->io_errors, in bch_count_io_errors()
Dalloc.c99 } while (atomic_cmpxchg(&c->rescale, r, r + next) != r); in bch_rescale_priorities()
/linux-4.1.27/net/netfilter/
Dxt_statistic.c47 } while (atomic_cmpxchg(&info->master->count, oval, nval) != oval); in statistic_mt()
/linux-4.1.27/drivers/gpu/host1x/hw/
Dsyncpt_hw.c66 } while ((u32)atomic_cmpxchg(&sp->min_val, old, live) != old); in syncpt_load()
/linux-4.1.27/arch/metag/include/asm/
Datomic_lnkget.h115 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
Datomic_lock1.h96 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
/linux-4.1.27/arch/hexagon/include/asm/
Datomic.h78 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() function
/linux-4.1.27/kernel/
Dsmpboot.c438 if (atomic_cmpxchg(&per_cpu(cpu_hotplug_state, cpu), in cpu_wait_death()
467 } while (atomic_cmpxchg(&per_cpu(cpu_hotplug_state, cpu), in cpu_report_death()
/linux-4.1.27/drivers/firewire/
Dcore-device.c815 if (atomic_cmpxchg(&device->state, in fw_device_shutdown()
904 atomic_cmpxchg(&old->state, in lookup_existing_device()
1078 if (atomic_cmpxchg(&device->state, in fw_device_init()
1155 if (atomic_cmpxchg(&device->state, in fw_device_refresh()
1181 if (atomic_cmpxchg(&device->state, in fw_device_refresh()
1279 if (atomic_cmpxchg(&device->state, in fw_node_event()
/linux-4.1.27/drivers/gpu/host1x/
Dintr.c262 while (atomic_cmpxchg(&waiter->state, WLS_PENDING, WLS_CANCELLED) == in host1x_intr_put_ref()
335 if (atomic_cmpxchg(&waiter->state, in host1x_intr_stop()
/linux-4.1.27/arch/mips/include/asm/
Datomic.h211 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) macro
230 old = atomic_cmpxchg((v), c, c + (a)); in __atomic_add_unless()
/linux-4.1.27/drivers/s390/cio/
Dccwgroup.c81 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) in ccwgroup_set_online()
110 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) in ccwgroup_set_offline()
190 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) in ccwgroup_ungroup_store()
Ddevice.c546 if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) in online_store()
1343 (atomic_cmpxchg(&cdev->private->onoff, 0, 1) == 0)) { in purge_fn()
/linux-4.1.27/arch/avr32/include/asm/
Datomic.h170 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) macro
/linux-4.1.27/arch/x86/kernel/
Dsmp.c203 if (atomic_cmpxchg(&stopping_cpu, -1, safe_smp_processor_id()) != -1) in native_stop_other_cpus()
/linux-4.1.27/drivers/net/ethernet/intel/ixgbe/
Dixgbe.h416 int rc = atomic_cmpxchg(&q_vector->state, IXGBE_QV_STATE_IDLE, in ixgbe_qv_lock_napi()
442 int rc = atomic_cmpxchg(&q_vector->state, IXGBE_QV_STATE_IDLE, in ixgbe_qv_lock_poll()
469 int rc = atomic_cmpxchg(&q_vector->state, IXGBE_QV_STATE_IDLE, in ixgbe_qv_disable()
/linux-4.1.27/arch/alpha/include/asm/
Datomic.h122 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) in ATOMIC_OPS() macro
/linux-4.1.27/fs/pstore/
Dram_core.c61 } while (atomic_cmpxchg(&prz->buffer->start, old, new) != old); in buffer_start_add_atomic()
80 } while (atomic_cmpxchg(&prz->buffer->size, old, new) != old); in buffer_size_add_atomic()
/linux-4.1.27/block/
Dblk-mq-tag.c55 atomic_cmpxchg(index, old, new); in bt_index_atomic_inc()
365 atomic_cmpxchg(&bt->wake_index, o, wake_index); in bt_wake_ptr()
/linux-4.1.27/drivers/infiniband/hw/ocrdma/
Docrdma_ah.c113 if (atomic_cmpxchg(&dev->update_sl, 1, 0)) in ocrdma_create_ah()
Docrdma_hw.c2442 if (atomic_cmpxchg(&dev->update_sl, 1, 0)) in ocrdma_set_av_params()
/linux-4.1.27/drivers/gpu/drm/radeon/
Dradeon_vce.c521 if (!atomic_cmpxchg(&p->rdev->vce.handles[i], 0, handle)) { in radeon_vce_validate_handle()
662 atomic_cmpxchg(&p->rdev->vce.handles[i], handle, 0); in radeon_vce_cs_parse()
Dradeon_uvd.c478 if (!atomic_cmpxchg(&p->rdev->uvd.handles[i], 0, handle)) { in radeon_uvd_cs_msg()
514 atomic_cmpxchg(&p->rdev->uvd.handles[i], handle, 0); in radeon_uvd_cs_msg()
/linux-4.1.27/arch/powerpc/include/asm/
Datomic.h154 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) macro
/linux-4.1.27/drivers/media/pci/saa7164/
Dsaa7164-vbi.c1049 if (atomic_cmpxchg(&fh->v4l_reading, 1, 0) == 1) { in fops_release()
1115 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { in fops_read()
1216 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { in fops_poll()
Dsaa7164-encoder.c1102 if (atomic_cmpxchg(&fh->v4l_reading, 1, 0) == 1) { in fops_release()
1169 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { in fops_read()
1269 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { in fops_poll()
/linux-4.1.27/Documentation/
Datomic_ops.txt262 int atomic_cmpxchg(atomic_t *v, int old, int new);
266 atomic_cmpxchg will only satisfy its atomicity semantics as long as all
269 atomic_cmpxchg must provide explicit memory barriers around the operation.
271 The semantics for atomic_cmpxchg are the same as those defined for 'cas'
Dmemory-barriers.txt2378 atomic_cmpxchg(); atomic_long_cmpxchg();
/linux-4.1.27/arch/blackfin/kernel/
Dbfin_dma.c139 if (atomic_cmpxchg(&dma_ch[channel].chan_status, 0, 1)) { in request_dma()
/linux-4.1.27/drivers/hwtracing/coresight/
Dcoresight-etb10.c289 if (atomic_cmpxchg(&drvdata->in_use, 0, 1)) in etb_open()
/linux-4.1.27/drivers/s390/net/
Dqeth_core_main.c488 if (atomic_cmpxchg(&buffer->state, QETH_QDIO_BUF_PRIMED, in qeth_qdio_handle_aob()
1651 switch (atomic_cmpxchg(&card->qdio.state, QETH_QDIO_ESTABLISHED, in qeth_qdio_clear_card()
1795 atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0); in qeth_idx_activate_get_answer()
1867 atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0); in qeth_idx_activate_channel()
2088 while (atomic_cmpxchg(&card->write.irq_pending, 0, 1)) ; in qeth_send_control_data()
2479 if (atomic_cmpxchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED, in qeth_alloc_qdio_buffers()
3768 if (atomic_cmpxchg(&buffer->state, in qeth_qdio_output_handler()
4072 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED, in qeth_do_send_packet_fast()
4107 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED, in qeth_do_send_packet()
4975 if (atomic_cmpxchg(&card->qdio.state, QETH_QDIO_ALLOCATED, in qeth_qdio_establish()
Dqeth_l2_main.c1291 atomic_cmpxchg(&card->write.irq_pending, 0, 1) == 0); in qeth_osn_send_control_data()
/linux-4.1.27/fs/nfs/
Dunlink.c222 wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1); in nfs_block_sillyrename()
/linux-4.1.27/net/ipv4/
Dinetpeer.c405 atomic_cmpxchg(&p->refcnt, 0, -1) == 0) { in inet_peer_gc()
/linux-4.1.27/drivers/vfio/
Dvfio.c1108 int users = atomic_cmpxchg(&group->container_users, 1, 0); in vfio_group_unset_container()
1327 opened = atomic_cmpxchg(&group->opened, 0, 1); in vfio_group_fops_open()
/linux-4.1.27/net/rds/
Drds.h636 return atomic_cmpxchg(&conn->c_state, old, new) == old; in rds_conn_transition()
Diw_send.c394 if (atomic_cmpxchg(&ic->i_credits, oldval, newval) != oldval) in rds_iw_send_grab_credits()
Dib_send.c442 if (atomic_cmpxchg(&ic->i_credits, oldval, newval) != oldval) in rds_ib_send_grab_credits()
/linux-4.1.27/net/rxrpc/
Dar-input.c336 hi_serial = atomic_cmpxchg(&call->conn->hi_serial, hi_serial, in rxrpc_fast_process_packet()
/linux-4.1.27/drivers/media/usb/cx231xx/
Dcx231xx-417.c1744 if (atomic_cmpxchg(&fh->v4l_reading, 1, 0) == 1) { in mpeg_release()
1775 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { in mpeg_read()
/linux-4.1.27/drivers/thermal/
Dthermal_core.c1197 if (atomic_cmpxchg(&pos->need_update, 1, 0)) in __thermal_cooling_device_register()
1622 if (atomic_cmpxchg(&tz->need_update, 1, 0)) in thermal_zone_device_register()
/linux-4.1.27/drivers/media/rc/
Dredrat3.c823 if (brightness != LED_OFF && atomic_cmpxchg(&rr3->flash, 0, 1) == 0) { in redrat3_brightness_set()
/linux-4.1.27/fs/gfs2/
Dlog.c367 if (atomic_cmpxchg(&sdp->sd_log_blks_free, free_blocks, in gfs2_log_reserve()
/linux-4.1.27/fs/hfsplus/
Dxattr.c145 if (old_state != atomic_cmpxchg(&sbi->attr_tree_state, in hfsplus_create_attributes_file()
/linux-4.1.27/drivers/staging/media/omap4iss/
Diss.c874 if (atomic_cmpxchg(stopping, 1, 0)) { in omap4iss_module_sync_is_stopping()
/linux-4.1.27/drivers/block/drbd/
Ddrbd_actlog.c100 (r = atomic_cmpxchg(&device->md_io.in_use, 0, 1)) == 0 || in drbd_md_get_buffer()
/linux-4.1.27/drivers/net/ethernet/sfc/
Dfarch.c627 } else if (atomic_cmpxchg(&tx_queue->flush_outstanding, in efx_check_tx_flush_complete()
1105 if (atomic_cmpxchg(&tx_queue->flush_outstanding, 1, 0)) { in efx_farch_handle_tx_flush_done()
/linux-4.1.27/arch/x86/kernel/apic/
Dapic.c404 rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new); in reserve_eilvt_offset()
/linux-4.1.27/drivers/video/fbdev/omap2/displays-new/
Dpanel-dsi-cm.c843 old = atomic_cmpxchg(&ddata->do_update, 1, 0); in dsicm_te_isr()
/linux-4.1.27/arch/s390/mm/
Dpgtable.c988 } while (atomic_cmpxchg(v, old, new) != old); in atomic_xor_bits()
/linux-4.1.27/net/netfilter/ipvs/
Dip_vs_conn.c244 if (atomic_cmpxchg(&cp->refcnt, 1, 0) == 1) { in ip_vs_conn_unlink()
/linux-4.1.27/fs/
Daio.c908 avail = atomic_cmpxchg(&ctx->reqs_available, in get_reqs_available()
/linux-4.1.27/kernel/trace/
Dring_buffer.c3108 } while (atomic_cmpxchg(&buffer->record_disabled, rd, new_rd) != rd); in ring_buffer_record_off()
3131 } while (atomic_cmpxchg(&buffer->record_disabled, rd, new_rd) != rd); in ring_buffer_record_on()
/linux-4.1.27/drivers/net/wireless/brcm80211/brcmfmac/
Dmsgbuf.c344 if (atomic_cmpxchg(&array[*idx].allocated, 0, 1) == 0) in brcmf_msgbuf_alloc_pktid()
Dsdio.c2567 while (atomic_cmpxchg(v, old_val, val | old_val) != old_val) in atomic_orr()
/linux-4.1.27/drivers/staging/lustre/lustre/llite/
Dlproc_llite.c433 rc = atomic_cmpxchg(&cache->ccc_lru_left, ov, nv); in ll_max_cached_mb_seq_write()
/linux-4.1.27/drivers/s390/block/
Ddasd.c2011 if (atomic_cmpxchg (&device->tasklet_scheduled, 0, 1) != 0) in dasd_schedule_device_bh()
2869 if (atomic_cmpxchg(&block->tasklet_scheduled, 0, 1) != 0) in dasd_schedule_block_bh()
/linux-4.1.27/net/ipv6/
Dip6_fib.c104 } while (atomic_cmpxchg(&net->ipv6.fib6_sernum, in fib6_new_sernum()
/linux-4.1.27/drivers/media/platform/omap3isp/
Disp.c1437 if (atomic_cmpxchg(stopping, 1, 0)) { in omap3isp_module_sync_is_stopping()
/linux-4.1.27/drivers/net/ethernet/broadcom/bnx2x/
Dbnx2x_sp.c3706 old = atomic_cmpxchg((v), c, c + a); in __atomic_add_ifless()
3734 old = atomic_cmpxchg((v), c, c - a); in __atomic_dec_ifmoe()
/linux-4.1.27/mm/
Dhuge_memory.c225 if (atomic_cmpxchg(&huge_zero_refcount, 1, 0) == 1) { in shrink_huge_zero_page_scan()
/linux-4.1.27/fs/btrfs/
Dextent_io.c5072 old = atomic_cmpxchg(&eb->refs, refs, refs - 1); in free_extent_buffer()
/linux-4.1.27/drivers/md/
Draid5.c178 } while (atomic_cmpxchg(segments, old, new) != old); in raid5_set_bi_processed_stripes()