Home
last modified time | relevance | path

Searched refs:sem (Results 1 – 25 of 2724) sorted by relevance

12345678910>>...109

/linux/kernel/locking/
A Drwsem.c311 debug_check_no_locks_freed((void *)sem, sizeof(*sem)); in __init_rwsem()
315 sem->magic = sem; in __init_rwsem()
1047 return sem; in rwsem_down_read_slowpath()
1160 return sem; in rwsem_down_write_slowpath()
1191 return sem; in rwsem_wake()
1212 return sem; in rwsem_downgrade_wake()
1249 DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem); in __down_read_trylock()
1287 DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem); in __down_write_trylock()
1298 DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem); in __up_read()
1318 DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem); in __up_write()
[all …]
A Dpercpu-rwsem.c16 if (unlikely(!sem->read_count)) in __percpu_init_rwsem()
19 rcu_sync_init(&sem->rss); in __percpu_init_rwsem()
20 rcuwait_init(&sem->writer); in __percpu_init_rwsem()
22 atomic_set(&sem->block, 0); in __percpu_init_rwsem()
24 debug_check_no_locks_freed((void *)sem, sizeof(*sem)); in __percpu_init_rwsem()
37 if (!sem->read_count) in percpu_free_rwsem()
40 rcu_sync_dtor(&sem->rss); in percpu_free_rwsem()
41 free_percpu(sem->read_count); in percpu_free_rwsem()
238 rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE); in percpu_down_write()
261 __wake_up(&sem->waiters, TASK_NORMAL, 1, sem); in percpu_up_write()
[all …]
A Dsemaphore.c59 if (likely(sem->count > 0)) in down()
60 sem->count--; in down()
62 __down(sem); in down()
83 if (likely(sem->count > 0)) in down_interruptible()
84 sem->count--; in down_interruptible()
111 sem->count--; in down_killable()
139 count = sem->count - 1; in down_trylock()
141 sem->count = count; in down_trylock()
166 sem->count--; in down_timeout()
188 sem->count++; in up()
[all …]
/linux/drivers/tty/
A Dtty_ldsem.c64 debug_check_no_locks_freed((void *)sem, sizeof(*sem)); in __init_ldsem()
68 sem->wait_readers = 0; in __init_ldsem()
148 __ldsem_wake(sem); in ldsem_wake()
176 return sem; in down_read_failed()
181 sem->wait_readers++; in down_read_failed()
188 __ldsem_wake(sem); in down_read_failed()
223 return sem; in down_read_failed()
249 return sem; in down_write_failed()
290 return sem; in down_write_failed()
397 ldsem_wake(sem); in ldsem_up_read()
[all …]
/linux/include/linux/
A Drwsem.h106 #define init_rwsem(sem) \ argument
110 __init_rwsem((sem), #sem, &__key); \
147 #define init_rwsem(sem) \ argument
151 __init_rwsem((sem), #sem, &__key); \
244 # define down_read_nested(sem, subclass) down_read(sem) argument
245 # define down_read_killable_nested(sem, subclass) down_read_killable(sem) argument
246 # define down_write_nest_lock(sem, nest_lock) down_write(sem) argument
247 # define down_write_nested(sem, subclass) down_write(sem) argument
248 # define down_write_killable_nested(sem, subclass) down_write_killable(sem) argument
249 # define down_read_non_owner(sem) down_read(sem) argument
[all …]
A Dpercpu-rwsem.h63 this_cpu_inc(*sem->read_count); in percpu_down_read()
82 this_cpu_inc(*sem->read_count); in percpu_down_read_trylock()
99 rwsem_release(&sem->dep_map, _RET_IP_); in percpu_up_read()
106 this_cpu_dec(*sem->read_count); in percpu_up_read()
118 this_cpu_dec(*sem->read_count); in percpu_up_read()
119 rcuwait_wake_up(&sem->writer); in percpu_up_read()
132 #define percpu_init_rwsem(sem) \ argument
135 __percpu_init_rwsem(sem, #sem, &rwsem_key); \
138 #define percpu_rwsem_is_held(sem) lockdep_is_held(sem) argument
139 #define percpu_rwsem_assert_held(sem) lockdep_assert_held(sem) argument
[all …]
A Dtty_ldisc.h152 #define init_ldsem(sem) \ argument
156 __init_ldsem((sem), #sem, &__key); \
160 int ldsem_down_read(struct ld_semaphore *sem, long timeout);
161 int ldsem_down_read_trylock(struct ld_semaphore *sem);
163 int ldsem_down_write_trylock(struct ld_semaphore *sem);
164 void ldsem_up_read(struct ld_semaphore *sem);
165 void ldsem_up_write(struct ld_semaphore *sem);
173 # define ldsem_down_read_nested(sem, subclass, timeout) \ argument
174 ldsem_down_read(sem, timeout)
175 # define ldsem_down_write_nested(sem, subclass, timeout) \ argument
[all …]
A Dsemaphore.h31 static inline void sema_init(struct semaphore *sem, int val) in sema_init() argument
34 *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); in sema_init()
35 lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); in sema_init()
38 extern void down(struct semaphore *sem);
39 extern int __must_check down_interruptible(struct semaphore *sem);
40 extern int __must_check down_killable(struct semaphore *sem);
41 extern int __must_check down_trylock(struct semaphore *sem);
42 extern int __must_check down_timeout(struct semaphore *sem, long jiffies);
43 extern void up(struct semaphore *sem);
/linux/tools/perf/util/
A Drwsem.c5 int init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument
7 return pthread_rwlock_init(&sem->lock, NULL); in init_rwsem()
10 int exit_rwsem(struct rw_semaphore *sem) in exit_rwsem() argument
12 return pthread_rwlock_destroy(&sem->lock); in exit_rwsem()
15 int down_read(struct rw_semaphore *sem) in down_read() argument
17 return perf_singlethreaded ? 0 : pthread_rwlock_rdlock(&sem->lock); in down_read()
20 int up_read(struct rw_semaphore *sem) in up_read() argument
22 return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); in up_read()
25 int down_write(struct rw_semaphore *sem) in down_write() argument
27 return perf_singlethreaded ? 0 : pthread_rwlock_wrlock(&sem->lock); in down_write()
[all …]
A Drwsem.h10 int init_rwsem(struct rw_semaphore *sem);
11 int exit_rwsem(struct rw_semaphore *sem);
13 int down_read(struct rw_semaphore *sem);
14 int up_read(struct rw_semaphore *sem);
16 int down_write(struct rw_semaphore *sem);
17 int up_write(struct rw_semaphore *sem);
/linux/arch/ia64/include/uapi/asm/
A Dintrinsics.h40 #define IA64_FETCHADD(tmp,v,n,sz,sem) \ argument
44 tmp = ia64_fetchadd4_##sem((unsigned int *) v, n); \
56 #define ia64_fetchadd(i,v,sem) \ argument
62 IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v)), sem); \
64 IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v)), sem); \
66 IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v)), sem); \
68 IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v)), sem); \
70 IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v)), sem); \
72 IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v)), sem); \
74 IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v)), sem); \
[all …]
A Dcmpxchg.h73 #define ia64_cmpxchg(sem, ptr, old, new, size) \ argument
95 _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_); \
99 _r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_); \
103 _r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_); \
107 _r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_); \
/linux/tools/power/acpi/os_specific/service_layers/
A Dosunixxf.c630 sem_t *sem; in acpi_os_create_semaphore() local
643 sem = in acpi_os_create_semaphore()
646 if (!sem) { in acpi_os_create_semaphore()
654 if (!sem) { in acpi_os_create_semaphore()
659 acpi_os_free(sem); in acpi_os_create_semaphore()
684 if (!sem) { in acpi_os_delete_semaphore()
688 if (sem_close(sem) == -1) { in acpi_os_delete_semaphore()
692 if (sem_destroy(sem) == -1) { in acpi_os_delete_semaphore()
724 if (!sem) { in acpi_os_wait_semaphore()
837 if (!sem) { in acpi_os_signal_semaphore()
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/lib/
A Ddevcom.c20 struct rw_semaphore sem; member
47 init_rwsem(&comp->sem); in mlx5_devcom_list_alloc()
161 down_write(&comp->sem); in mlx5_devcom_register_component()
164 up_write(&comp->sem); in mlx5_devcom_register_component()
176 down_write(&comp->sem); in mlx5_devcom_unregister_component()
178 up_write(&comp->sem); in mlx5_devcom_unregister_component()
193 down_write(&comp->sem); in mlx5_devcom_send_event()
201 up_write(&comp->sem); in mlx5_devcom_send_event()
236 down_read(&comp->sem); in mlx5_devcom_get_peer_data()
238 up_read(&comp->sem); in mlx5_devcom_get_peer_data()
[all …]
/linux/fs/jffs2/
A Ddir.c97 mutex_lock(&dir_f->sem); in jffs2_lookup()
135 mutex_lock(&f->sem); in jffs2_readdir()
156 mutex_unlock(&f->sem); in jffs2_readdir()
201 mutex_unlock(&f->sem); in jffs2_create()
270 mutex_lock(&f->sem); in jffs2_link()
272 mutex_unlock(&f->sem); in jffs2_link()
371 mutex_unlock(&f->sem); in jffs2_symlink()
515 mutex_unlock(&f->sem); in jffs2_mkdir()
598 mutex_lock(&f->sem); in jffs2_rmdir()
605 mutex_unlock(&f->sem); in jffs2_rmdir()
[all …]
A Dwrite.c145 mutex_unlock(&f->sem); in jffs2_write_dnode()
150 mutex_lock(&f->sem); in jffs2_write_dnode()
302 mutex_lock(&f->sem); in jffs2_write_dirent()
368 mutex_lock(&f->sem); in jffs2_write_inode_range()
397 mutex_unlock(&f->sem); in jffs2_write_inode_range()
420 mutex_unlock(&f->sem); in jffs2_write_inode_range()
424 mutex_unlock(&f->sem); in jffs2_write_inode_range()
460 mutex_lock(&f->sem); in jffs2_do_create()
473 mutex_unlock(&f->sem); in jffs2_do_create()
482 mutex_unlock(&f->sem); in jffs2_do_create()
[all …]
A Dfile.c126 mutex_lock(&f->sem); in jffs2_readpage()
128 mutex_unlock(&f->sem); in jffs2_readpage()
165 mutex_lock(&f->sem); in jffs2_write_begin()
192 mutex_unlock(&f->sem); in jffs2_write_begin()
207 mutex_unlock(&f->sem); in jffs2_write_begin()
212 mutex_unlock(&f->sem); in jffs2_write_begin()
221 mutex_lock(&f->sem); in jffs2_write_begin()
223 mutex_unlock(&f->sem); in jffs2_write_begin()
A Dfs.c60 mutex_lock(&f->sem); in jffs2_do_setattr()
64 mutex_unlock(&f->sem); in jffs2_do_setattr()
69 mutex_unlock(&f->sem); in jffs2_do_setattr()
73 mutex_unlock(&f->sem); in jffs2_do_setattr()
93 mutex_lock(&f->sem); in jffs2_do_setattr()
146 mutex_unlock(&f->sem); in jffs2_do_setattr()
177 mutex_unlock(&f->sem); in jffs2_do_setattr()
275 mutex_lock(&f->sem); in jffs2_iget()
358 mutex_unlock(&f->sem); in jffs2_iget()
367 mutex_unlock(&f->sem); in jffs2_iget()
[all …]
/linux/drivers/gpu/drm/gma500/
A Dmmu.c88 down_write(&driver->sem);
90 up_write(&driver->sem);
100 down_write(&driver->sem); in psb_mmu_flush()
117 up_write(&driver->sem); in psb_mmu_flush()
237 down_write(&driver->sem); in psb_mmu_free_pagedir()
257 up_write(&driver->sem); in psb_mmu_free_pagedir()
402 down_read(&driver->sem); in psb_mmu_get_default_pd()
404 up_read(&driver->sem); in psb_mmu_get_default_pd()
439 init_rwsem(&driver->sem); in psb_mmu_driver_init()
440 down_write(&driver->sem); in psb_mmu_driver_init()
[all …]
/linux/drivers/gpu/drm/radeon/
A Dradeon_trace.h170 TP_PROTO(int ring, struct radeon_semaphore *sem),
172 TP_ARGS(ring, sem),
182 __entry->waiters = sem->waiters;
183 __entry->gpu_addr = sem->gpu_addr;
192 TP_PROTO(int ring, struct radeon_semaphore *sem),
194 TP_ARGS(ring, sem)
199 TP_PROTO(int ring, struct radeon_semaphore *sem),
201 TP_ARGS(ring, sem)
/linux/drivers/infiniband/core/
A Dnetlink.c50 struct rw_semaphore sem; member
99 up_read(&rdma_nl_types[type].sem); in get_cb_table()
103 down_read(&rdma_nl_types[type].sem); in get_cb_table()
125 down_write(&rdma_nl_types[index].sem); in rdma_nl_unregister()
127 up_write(&rdma_nl_types[index].sem); in rdma_nl_unregister()
164 down_read(&rdma_nl_types[index].sem); in rdma_nl_rcv_msg()
197 up_read(&rdma_nl_types[index].sem); in rdma_nl_rcv_msg()
296 init_rwsem(&rdma_nl_types[idx].sem); in rdma_nl_init()
/linux/security/keys/
A Dkeyring.c1056 down_write(&keyring->sem); in keyring_restrict()
1069 up_write(&keyring->sem); in keyring_restrict()
1238 __acquires(&keyring->sem) in __key_link_lock()
1385 __releases(&keyring->sem) in __key_link_end()
1398 up_write(&keyring->sem); in __key_link_end()
1472 __acquires(&keyring->sem) in __key_unlink_lock()
1521 __releases(&keyring->sem) in __key_unlink_end()
1525 up_write(&keyring->sem); in __key_unlink_end()
1668 up_write(&keyring->sem); in keyring_clear()
1742 up_write(&keyring->sem); in keyring_gc()
[all …]
/linux/ipc/
A Dsem.c95 struct sem { struct
126 struct sem sems[]; argument
296 struct sem *curr; in unmerge_queues()
317 struct sem *sem = &sma->sems[i]; in merge_queues() local
339 struct sem *sem; in complexmode_enter() local
392 struct sem *sem; in sem_lock() local
467 struct sem *sem = &sma->sems[locknum]; in sem_unlock() local
651 struct sem *curr; in perform_atomic_semop_slow()
723 struct sem *curr; in perform_atomic_semop()
1174 struct sem *sem = &sma->sems[i]; in freeary() local
[all …]
/linux/tools/testing/selftests/kvm/
A Dhardware_disable_test.c28 sem_t *sem; variable
128 sem_post(sem); in run_test()
145 if (!sem_timedwait(sem, &wait_period)) in wait_for_child_setup()
171 sem = sem_open("vm_sem", O_CREAT | O_EXCL, 0644, 0); in main()
193 sem_destroy(sem); in main()
/linux/arch/x86/platform/intel/
A Diosf_mbi.c247 static int iosf_mbi_get_sem(u32 *sem) in iosf_mbi_get_sem() argument
252 iosf_mbi_sem_address, sem); in iosf_mbi_get_sem()
258 *sem &= PUNIT_SEMAPHORE_BIT; in iosf_mbi_get_sem()
316 u32 sem; in iosf_mbi_block_punit_i2c_access() local
355 ret = iosf_mbi_get_sem(&sem); in iosf_mbi_block_punit_i2c_access()
356 if (!ret && sem) { in iosf_mbi_block_punit_i2c_access()
370 if (!iosf_mbi_get_sem(&sem)) in iosf_mbi_block_punit_i2c_access()
371 dev_err(&mbi_pdev->dev, "P-Unit semaphore: %d\n", sem); in iosf_mbi_block_punit_i2c_access()

Completed in 42 milliseconds

12345678910>>...109