Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 163) sorted by relevance

1234567

/Zephyr-Core-2.7.6/lib/libc/newlib/
Dlibc-hooks.c352 void __retarget_lock_init(_LOCK_T *lock) in __retarget_lock_init() argument
354 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_init()
358 *lock = malloc(sizeof(struct k_sem)); in __retarget_lock_init()
360 *lock = k_object_alloc(K_OBJ_SEM); in __retarget_lock_init()
362 __ASSERT(*lock != NULL, "non-recursive lock allocation failed"); in __retarget_lock_init()
364 k_sem_init((struct k_sem *)*lock, 1, 1); in __retarget_lock_init()
368 void __retarget_lock_init_recursive(_LOCK_T *lock) in __retarget_lock_init_recursive() argument
370 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_init_recursive()
374 *lock = malloc(sizeof(struct k_mutex)); in __retarget_lock_init_recursive()
376 *lock = k_object_alloc(K_OBJ_MUTEX); in __retarget_lock_init_recursive()
[all …]
/Zephyr-Core-2.7.6/kernel/
Datomic_c.c32 static struct k_spinlock lock; variable
87 key = k_spin_lock(&lock); in z_impl_atomic_cas()
94 k_spin_unlock(&lock, key); in z_impl_atomic_cas()
116 key = k_spin_lock(&lock); in z_impl_atomic_ptr_cas()
123 k_spin_unlock(&lock, key); in z_impl_atomic_ptr_cas()
158 key = k_spin_lock(&lock); in z_impl_atomic_add()
163 k_spin_unlock(&lock, key); in z_impl_atomic_add()
188 key = k_spin_lock(&lock); in z_impl_atomic_sub()
193 k_spin_unlock(&lock, key); in z_impl_atomic_sub()
239 key = k_spin_lock(&lock); in z_impl_atomic_set()
[all …]
Dmutex.c47 static struct k_spinlock lock; variable
103 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_mutex, lock, mutex, timeout); in z_impl_k_mutex_lock()
105 key = k_spin_lock(&lock); in z_impl_k_mutex_lock()
120 k_spin_unlock(&lock, key); in z_impl_k_mutex_lock()
122 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_mutex, lock, mutex, timeout, 0); in z_impl_k_mutex_lock()
128 k_spin_unlock(&lock, key); in z_impl_k_mutex_lock()
130 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_mutex, lock, mutex, timeout, -EBUSY); in z_impl_k_mutex_lock()
135 SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_mutex, lock, mutex, timeout); in z_impl_k_mutex_lock()
146 int got_mutex = z_pend_curr(&lock, key, &mutex->wait_q, timeout); in z_impl_k_mutex_lock()
154 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_mutex, lock, mutex, timeout, 0); in z_impl_k_mutex_lock()
[all …]
Dtimer.c16 static struct k_spinlock lock; variable
29 k_spinlock_key_t key = k_spin_lock(&lock); in z_timer_expiration_handler()
47 k_spin_unlock(&lock, key); in z_timer_expiration_handler()
49 key = k_spin_lock(&lock); in z_timer_expiration_handler()
53 k_spin_unlock(&lock, key); in z_timer_expiration_handler()
60 k_spin_unlock(&lock, key); in z_timer_expiration_handler()
68 k_spin_unlock(&lock, key); in z_timer_expiration_handler()
180 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_timer_status_get()
184 k_spin_unlock(&lock, key); in z_impl_k_timer_status_get()
207 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_timer_status_sync()
[all …]
Dcondvar.c14 static struct k_spinlock lock; variable
37 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_condvar_signal()
48 z_reschedule(&lock, key); in z_impl_k_condvar_signal()
50 k_spin_unlock(&lock, key); in z_impl_k_condvar_signal()
73 key = k_spin_lock(&lock); in z_impl_k_condvar_broadcast()
87 z_reschedule(&lock, key); in z_impl_k_condvar_broadcast()
108 key = k_spin_lock(&lock); in z_impl_k_condvar_wait()
111 ret = z_pend_curr(&lock, key, &condvar->wait_q, timeout); in z_impl_k_condvar_wait()
Dwork.c63 static struct k_spinlock lock; variable
152 k_spinlock_key_t key = k_spin_lock(&lock); in k_work_busy_get()
155 k_spin_unlock(&lock, key); in k_work_busy_get()
374 k_spinlock_key_t key = k_spin_lock(&lock); in z_work_submit_to_queue()
378 k_spin_unlock(&lock, key); in z_work_submit_to_queue()
462 k_spinlock_key_t key = k_spin_lock(&lock); in k_work_flush()
466 k_spin_unlock(&lock, key); in k_work_flush()
550 k_spinlock_key_t key = k_spin_lock(&lock); in k_work_cancel()
553 k_spin_unlock(&lock, key); in k_work_cancel()
574 k_spinlock_key_t key = k_spin_lock(&lock); in k_work_cancel_sync()
[all …]
Dsem.c39 static struct k_spinlock lock; variable
88 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_sem_give()
103 z_reschedule(&lock, key); in z_impl_k_sem_give()
124 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_sem_take()
130 k_spin_unlock(&lock, key); in z_impl_k_sem_take()
136 k_spin_unlock(&lock, key); in z_impl_k_sem_take()
143 ret = z_pend_curr(&lock, key, &sem->wait_q, timeout); in z_impl_k_sem_take()
154 k_spinlock_key_t key = k_spin_lock(&lock); in z_impl_k_sem_reset()
170 z_reschedule(&lock, key); in z_impl_k_sem_reset()
Dpoll.c35 static struct k_spinlock lock; variable
203 k_spin_unlock(&lock, key); in clear_event_registrations()
204 key = k_spin_lock(&lock); in clear_event_registrations()
225 key = k_spin_lock(&lock); in register_events()
239 k_spin_unlock(&lock, key); in register_events()
291 key = k_spin_lock(&lock); in z_impl_k_poll()
300 k_spin_unlock(&lock, key); in z_impl_k_poll()
310 k_spin_unlock(&lock, key); in z_impl_k_poll()
319 int swap_rc = z_pend_curr(&lock, key, &wait_q, timeout); in z_impl_k_poll()
330 key = k_spin_lock(&lock); in z_impl_k_poll()
[all …]
/Zephyr-Core-2.7.6/include/posix/sys/
Deventfd.h57 struct k_mutex *lock; in eventfd_read() local
61 obj = z_get_fd_obj_and_vtable(fd, &efd_vtable, &lock); in eventfd_read()
63 (void)k_mutex_lock(lock, K_FOREVER); in eventfd_read()
67 k_mutex_unlock(lock); in eventfd_read()
83 struct k_mutex *lock; in eventfd_write() local
87 obj = z_get_fd_obj_and_vtable(fd, &efd_vtable, &lock); in eventfd_write()
89 (void)k_mutex_lock(lock, K_FOREVER); in eventfd_write()
93 k_mutex_unlock(lock); in eventfd_write()
/Zephyr-Core-2.7.6/tests/lib/newlib/thread_safety/src/
Dlocks.c62 _LOCK_T lock = NULL; in test_retargetable_lock_sem() local
65 __retarget_lock_init(&lock); in test_retargetable_lock_sem()
66 zassert_not_null(lock, "non-recursive lock init failed"); in test_retargetable_lock_sem()
69 __retarget_lock_acquire(lock); in test_retargetable_lock_sem()
70 zassert_equal(__retarget_lock_try_acquire(lock), 0, in test_retargetable_lock_sem()
74 __retarget_lock_release(lock); in test_retargetable_lock_sem()
75 zassert_not_equal(__retarget_lock_try_acquire(lock), 0, in test_retargetable_lock_sem()
79 __retarget_lock_close(lock); in test_retargetable_lock_sem()
84 _LOCK_T lock = p1; in retargetable_lock_mutex_thread_acq() local
91 ret = __retarget_lock_try_acquire_recursive(lock); in retargetable_lock_mutex_thread_acq()
[all …]
/Zephyr-Core-2.7.6/drivers/timer/
Dapic_timer.c73 static struct k_spinlock lock; variable
109 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_set_timeout()
117 k_spin_unlock(&lock, key); in sys_clock_set_timeout()
125 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_elapsed()
129 k_spin_unlock(&lock, key); in sys_clock_elapsed()
142 k_spinlock_key_t key = k_spin_lock(&lock); in isr()
151 k_spin_unlock(&lock, key); in isr()
163 k_spin_unlock(&lock, key); in isr()
173 k_spinlock_key_t key = k_spin_lock(&lock); in isr()
176 k_spin_unlock(&lock, key); in isr()
[all …]
Dstm32_lptim_timer.c46 static struct k_spinlock lock; variable
56 k_spinlock_key_t key = k_spin_lock(&lock); in lptim_irq_handler()
69 k_spin_unlock(&lock, key); in lptim_irq_handler()
229 k_spinlock_key_t key = k_spin_lock(&lock);
242 k_spin_unlock(&lock, key);
277 k_spin_unlock(&lock, key);
286 k_spinlock_key_t key = k_spin_lock(&lock);
298 k_spin_unlock(&lock, key);
312 k_spinlock_key_t key = k_spin_lock(&lock);
329 k_spin_unlock(&lock, key);
Darm_arch_timer.c18 static struct k_spinlock lock; variable
25 k_spinlock_key_t key = k_spin_lock(&lock); in arm_arch_timer_compare_isr()
44 k_spin_unlock(&lock, key); in arm_arch_timer_compare_isr()
75 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_set_timeout()
90 k_spin_unlock(&lock, key); in sys_clock_set_timeout()
104 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_elapsed()
108 k_spin_unlock(&lock, key); in sys_clock_elapsed()
Dxtensa_sys_timer.c19 static struct k_spinlock lock; variable
40 k_spinlock_key_t key = k_spin_lock(&lock); in ccompare_isr()
55 k_spin_unlock(&lock, key); in ccompare_isr()
77 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_set_timeout()
96 k_spin_unlock(&lock, key); in sys_clock_set_timeout()
106 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_elapsed()
109 k_spin_unlock(&lock, key); in sys_clock_elapsed()
/Zephyr-Core-2.7.6/drivers/serial/
Duart_mchp_xec.c191 struct k_spinlock lock; member
250 k_spinlock_key_t key = k_spin_lock(&dev_data->lock); in uart_xec_configure()
336 k_spin_unlock(&dev_data->lock, key); in uart_xec_configure()
401 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_xec_poll_in()
409 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_xec_poll_in()
430 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_xec_poll_out()
438 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_xec_poll_out()
453 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_xec_err_check()
456 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_xec_err_check()
478 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_xec_fifo_fill()
[all …]
Duart_ns16550.c264 struct k_spinlock lock; member
347 k_spinlock_key_t key = k_spin_lock(&dev_data->lock); in uart_ns16550_configure()
474 k_spin_unlock(&dev_data->lock, key); in uart_ns16550_configure()
530 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_ns16550_poll_in()
538 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_ns16550_poll_in()
558 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_ns16550_poll_out()
565 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_ns16550_poll_out()
578 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_ns16550_err_check()
581 k_spin_unlock(&DEV_DATA(dev)->lock, key); in uart_ns16550_err_check()
602 k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock); in uart_ns16550_fifo_fill()
[all …]
/Zephyr-Core-2.7.6/tests/kernel/spinlock/src/
Dspinlock_error_case.c12 static struct k_spinlock lock; variable
25 k_spin_unlock(&lock, key); in action_after_assert_fail()
77 key = k_spin_lock(&lock); in test_spinlock_no_recursive()
80 re = k_spin_lock(&lock); in test_spinlock_no_recursive()
96 key = k_spin_lock(&lock); in test_spinlock_unlock_error()
115 key = k_spin_lock(&lock); in test_spinlock_release_error()
/Zephyr-Core-2.7.6/kernel/include/
Dkswap.h62 struct k_spinlock *lock, in do_swap() argument
65 ARG_UNUSED(lock); in do_swap()
99 if (is_spinlock && lock != NULL && lock != &sched_spinlock) { in do_swap()
100 k_spin_release(lock); in do_swap()
102 if (!is_spinlock || lock != &sched_spinlock) { in do_swap()
165 static inline int z_swap(struct k_spinlock *lock, k_spinlock_key_t key) in z_swap() argument
167 return do_swap(key.key, lock, 1); in z_swap()
191 static ALWAYS_INLINE int z_swap(struct k_spinlock *lock, k_spinlock_key_t key) in z_swap() argument
193 k_spin_release(lock); in z_swap()
/Zephyr-Core-2.7.6/scripts/coccinelle/
Dmini_lock.cocci2 /// where the unlock is missing from an if branch, and there is a lock
5 /// supposed to exit with the lock held, or where there is some preceding
6 /// function call that releases the lock.
43 identifier lock,unlock;
51 lock(E1@p,...)
67 identifier lock,unlock;
71 *lock(E1@p,...);
86 lock << err.lock;
91 cocci.print_main(lock,p)
96 lock << err.lock;
[all …]
/Zephyr-Core-2.7.6/subsys/net/ip/
Dnet_if.c40 static K_MUTEX_DEFINE(lock);
388 k_mutex_lock(&lock, K_FOREVER); in net_if_stats_reset_all()
394 k_mutex_unlock(&lock); in net_if_stats_reset_all()
434 k_mutex_lock(&lock, K_FOREVER); in net_if_send_data()
505 k_mutex_unlock(&lock); in net_if_send_data()
516 k_mutex_lock(&lock, K_FOREVER); in net_if_set_link_addr_locked()
520 k_mutex_unlock(&lock); in net_if_set_link_addr_locked()
644 k_mutex_lock(&lock, K_FOREVER); in iface_router_lookup()
665 k_mutex_unlock(&lock); in iface_router_lookup()
714 k_mutex_lock(&lock, K_FOREVER); in iface_router_update_timer()
[all …]
/Zephyr-Core-2.7.6/subsys/net/l2/ethernet/
Dbridge.c62 k_mutex_lock(&br->lock, K_FOREVER); in eth_bridge_iface_add()
65 k_mutex_unlock(&br->lock); in eth_bridge_iface_add()
73 k_mutex_unlock(&br->lock); in eth_bridge_iface_add()
95 k_mutex_lock(&br->lock, K_FOREVER); in eth_bridge_iface_remove()
98 k_mutex_unlock(&br->lock); in eth_bridge_iface_remove()
105 k_mutex_unlock(&br->lock); in eth_bridge_iface_remove()
126 k_mutex_lock(&br->lock, K_FOREVER); in eth_bridge_listener_add()
128 k_mutex_unlock(&br->lock); in eth_bridge_listener_add()
134 k_mutex_lock(&br->lock, K_FOREVER); in eth_bridge_listener_remove()
136 k_mutex_unlock(&br->lock); in eth_bridge_listener_remove()
[all …]
/Zephyr-Core-2.7.6/drivers/eeprom/
Deeprom_stm32.c16 K_MUTEX_DEFINE(lock);
39 k_mutex_lock(&lock, K_FOREVER); in eeprom_stm32_read()
49 k_mutex_unlock(&lock); in eeprom_stm32_read()
70 k_mutex_lock(&lock, K_FOREVER); in eeprom_stm32_write()
81 k_mutex_unlock(&lock); in eeprom_stm32_write()
93 k_mutex_unlock(&lock); in eeprom_stm32_write()
97 k_mutex_unlock(&lock); in eeprom_stm32_write()
/Zephyr-Core-2.7.6/subsys/pm/
Ddevice_runtime.c59 (void)k_mutex_lock(&pm->lock, K_FOREVER); in pm_work_handler()
61 (void)k_mutex_unlock(&pm->lock); in pm_work_handler()
101 (void)k_mutex_lock(&dev->pm->lock, K_FOREVER); in pm_device_request()
135 ret = k_condvar_wait(&dev->pm->condvar, &dev->pm->lock, in pm_device_request()
152 (void)k_mutex_unlock(&dev->pm->lock); in pm_device_request()
191 (void)k_mutex_lock(&dev->pm->lock, K_FOREVER); in pm_device_enable()
212 (void)k_mutex_unlock(&dev->pm->lock); in pm_device_enable()
223 (void)k_mutex_lock(&dev->pm->lock, K_FOREVER); in pm_device_disable()
229 (void)k_mutex_unlock(&dev->pm->lock); in pm_device_disable()
237 k_mutex_lock(&dev->pm->lock, K_FOREVER); in pm_device_wait()
[all …]
/Zephyr-Core-2.7.6/drivers/counter/
Dcounter_esp32.c71 static struct k_spinlock lock; variable
93 k_spinlock_key_t key = k_spin_lock(&lock); in counter_esp32_init()
109 k_spin_unlock(&lock, key); in counter_esp32_init()
116 k_spinlock_key_t key = k_spin_lock(&lock); in counter_esp32_start()
119 k_spin_unlock(&lock, key); in counter_esp32_start()
126 k_spinlock_key_t key = k_spin_lock(&lock); in counter_esp32_stop()
129 k_spin_unlock(&lock, key); in counter_esp32_stop()
136 k_spinlock_key_t key = k_spin_lock(&lock); in counter_esp32_get_value()
139 k_spin_unlock(&lock, key); in counter_esp32_get_value()
151 k_spinlock_key_t key = k_spin_lock(&lock); in counter_esp32_set_alarm()
[all …]
/Zephyr-Core-2.7.6/lib/os/
Dfdtable.c28 struct k_mutex lock; member
141 struct k_mutex **lock) in z_get_fd_obj_and_vtable() argument
152 if (lock) { in z_get_fd_obj_and_vtable()
153 *lock = &entry->lock; in z_get_fd_obj_and_vtable()
171 k_mutex_init(&fdtable[fd].lock); in z_reserve_fd()
201 &fdtable[fd].lock); in z_finalize_fd()
233 (void)k_mutex_lock(&fdtable[fd].lock, K_FOREVER); in read()
237 k_mutex_unlock(&fdtable[fd].lock); in read()
251 (void)k_mutex_lock(&fdtable[fd].lock, K_FOREVER); in write()
255 k_mutex_unlock(&fdtable[fd].lock); in write()
[all …]

1234567