| /freebsd-14.2/sbin/ipf/libipf/ |
| H A D | mutex_emul.c | 26 mtx->eMm_owner, mtx, mtx->eMm_magic); in eMmutex_enter() 31 mtx->eMm_owner, mtx, mtx->eMm_held); in eMmutex_enter() 34 mtx->eMm_held++; in eMmutex_enter() 48 mtx->eMm_owner, mtx, mtx->eMm_magic); in eMmutex_exit() 53 mtx->eMm_owner, mtx, mtx->eMm_held); in eMmutex_exit() 56 mtx->eMm_held--; in eMmutex_exit() 73 mtx->eMm_owner, mtx, mtx->eMm_magic); in eMmutex_init() 92 mtx, mtx->eMm_owner); in eMmutex_destroy() 95 mtx->eMm_owner, mtx, mtx->eMm_magic); in eMmutex_destroy() 101 mtx->eMm_owner, mtx, mtx->eMm_held); in eMmutex_destroy() [all …]
|
| /freebsd-14.2/sys/dev/usb/ |
| H A D | usb_request.h | 34 struct mtx *mtx, uint16_t sel); 36 struct mtx *mtx, uint8_t port, uint16_t sel); 38 struct mtx *mtx, uint8_t *alt_iface_no, 56 struct mtx *mtx, struct usb_status *st); 58 struct mtx *mtx, struct usb_hub_descriptor *hd, 70 struct mtx *mtx, uint8_t port); 76 struct mtx *mtx, uint8_t port, uint16_t sel); 80 struct mtx *mtx, uint16_t sel); 82 struct mtx *mtx, uint16_t sel); 84 struct mtx *mtx, uint8_t port, uint8_t timeout); [all …]
|
| H A D | usb_request.c | 414 usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx, in usbd_do_request_flags() argument 467 if ((mtx != NULL) && (mtx != &Giant)) { in usbd_do_request_flags() 722 if ((mtx != NULL) && (mtx != &Giant)) in usbd_do_request_flags() 996 struct mtx *mtx, uint16_t *actlen, void *desc, in usbd_req_get_desc() argument 1721 usbd_req_set_hub_depth(struct usb_device *udev, struct mtx *mtx, in usbd_req_set_hub_depth() argument 1786 usbd_req_set_protocol(struct usb_device *udev, struct mtx *mtx, in usbd_req_set_protocol() argument 1871 usbd_req_set_idle(struct usb_device *udev, struct mtx *mtx, in usbd_req_set_idle() argument 1970 usbd_setup_device_desc(struct usb_device *udev, struct mtx *mtx) in usbd_setup_device_desc() argument 2063 usbd_req_re_enumerate(struct usb_device *udev, struct mtx *mtx) in usbd_req_re_enumerate() argument 2216 usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx, in usbd_req_reset_tt() argument [all …]
|
| H A D | usbdi_util.h | 62 usb_error_t usbd_req_get_report(struct usb_device *udev, struct mtx *mtx, 66 struct mtx *mtx, void *d, uint16_t size, 68 usb_error_t usbd_req_get_string_any(struct usb_device *udev, struct mtx *mtx, 70 usb_error_t usbd_req_get_string_desc(struct usb_device *udev, struct mtx *mtx, 73 usb_error_t usbd_req_set_config(struct usb_device *udev, struct mtx *mtx, 76 struct mtx *mtx, uint8_t iface_index, uint8_t alt_no); 77 usb_error_t usbd_req_set_idle(struct usb_device *udev, struct mtx *mtx, 79 usb_error_t usbd_req_set_protocol(struct usb_device *udev, struct mtx *mtx, 81 usb_error_t usbd_req_set_report(struct usb_device *udev, struct mtx *mtx,
|
| /freebsd-14.2/sys/cam/ |
| H A D | cam_sim.c | 103 struct mtx *mtx, int max_dev_transactions, in cam_sim_alloc() argument 124 sim->mtx = mtx; in cam_sim_alloc() 144 struct mtx *mtx; in cam_sim_free() local 151 mtx = sim->mtx; in cam_sim_free() 172 struct mtx *mtx; in cam_sim_release() local 177 mtx = sim->mtx; in cam_sim_release() 180 if (mtx) in cam_sim_release() 186 if (mtx) in cam_sim_release() 193 struct mtx *mtx; in cam_sim_hold() local 198 mtx = sim->mtx; in cam_sim_hold() [all …]
|
| /freebsd-14.2/lib/libthr/thread/ |
| H A D | thr_umtx.h | 55 int _thr_umtx_wait(volatile long *mtx, long exp, 93 return (__thr_umutex_trylock(mtx)); in _thr_umutex_trylock() 121 if (_thr_umutex_trylock2(mtx, id) == 0) in _thr_umutex_lock() 123 return (__thr_umutex_lock(mtx, id)); in _thr_umutex_lock() 130 if (_thr_umutex_trylock2(mtx, id) == 0) in _thr_umutex_lock_spin() 132 return (__thr_umutex_lock_spin(mtx, id)); in _thr_umutex_lock_spin() 140 if (_thr_umutex_trylock2(mtx, id) == 0) in _thr_umutex_timedlock() 151 flags = mtx->m_flags; in _thr_umutex_unlock2() 158 return (__thr_umutex_unlock(mtx)); in _thr_umutex_unlock2() 162 owner = mtx->m_owner; in _thr_umutex_unlock2() [all …]
|
| H A D | thr_umtx.c | 43 _thr_umutex_init(struct umutex *mtx) in _thr_umutex_init() argument 47 *mtx = default_mtx; in _thr_umutex_init() 67 owner = mtx->m_owner; in __thr_umutex_lock() 72 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_lock() 79 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0); in __thr_umutex_lock() 92 return (__thr_umutex_lock(mtx, id)); in __thr_umutex_lock_spin() 99 owner = mtx->m_owner; in __thr_umutex_lock_spin() 139 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | in __thr_umutex_timedlock() 142 owner = mtx->m_owner; in __thr_umutex_timedlock() 170 __thr_umutex_unlock(struct umutex *mtx) in __thr_umutex_unlock() argument [all …]
|
| /freebsd-14.2/lib/libstdthreads/ |
| H A D | mtx.c | 36 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 39 (void)pthread_mutex_destroy(mtx); in mtx_destroy() 43 mtx_init(mtx_t *mtx, int type) in mtx_init() argument 65 pthread_mutex_init(mtx, &attr) != 0) in mtx_init() 72 mtx_lock(mtx_t *mtx) in mtx_lock() argument 75 if (pthread_mutex_lock(mtx) != 0) in mtx_lock() 84 switch (pthread_mutex_timedlock(mtx, ts)) { in mtx_timedlock() 95 mtx_trylock(mtx_t *mtx) in mtx_trylock() argument 98 switch (pthread_mutex_trylock(mtx)) { in mtx_trylock() 109 mtx_unlock(mtx_t *mtx) in mtx_unlock() argument [all …]
|
| /freebsd-14.2/contrib/netbsd-tests/lib/libpthread/dlopen/ |
| H A D | t_dlopen.c | 77 pthread_mutex_t mtx; in ATF_TC_BODY() local 81 ATF_REQUIRE(pthread_mutex_init(&mtx, NULL) == 0); in ATF_TC_BODY() 82 ATF_REQUIRE(pthread_mutex_lock(&mtx) == 0); in ATF_TC_BODY() 92 ATF_REQUIRE(pthread_mutex_unlock(&mtx) == 0); in ATF_TC_BODY() 96 pthread_mutex_destroy(&mtx); in ATF_TC_BODY() 109 pthread_mutex_t mtx; in ATF_TC_BODY() local 114 ATF_REQUIRE(pthread_mutex_lock(&mtx) == 0); in ATF_TC_BODY() 127 pthread_mutex_destroy(&mtx); in ATF_TC_BODY() 141 pthread_mutex_t mtx; in ATF_TC_BODY() local 156 ATF_REQUIRE(pthread_mutex_unlock(&mtx) == 0); in ATF_TC_BODY() [all …]
|
| /freebsd-14.2/tools/regression/pthread/mutex_isowned_np/ |
| H A D | mutex_isowned_np.c | 36 pthread_mutex_t *mtx = arg; in thread() local 38 if (pthread_mutex_isowned_np(mtx) != 0) { in thread() 50 pthread_mutex_t mtx; in main() local 52 pthread_mutex_init(&mtx, NULL); in main() 53 if (pthread_mutex_isowned_np(&mtx) != 0) { in main() 58 pthread_mutex_lock(&mtx); in main() 59 if (pthread_mutex_isowned_np(&mtx) == 0) { in main() 64 pthread_create(&thr, NULL, thread, &mtx); in main() 66 pthread_mutex_unlock(&mtx); in main() 67 if (pthread_mutex_isowned_np(&mtx) != 0) { in main()
|
| /freebsd-14.2/contrib/processor-trace/include/windows/ |
| H A D | threads.h | 145 if (!mtx || type != mtx_plain) in mtx_init() 148 InitializeCriticalSection(&mtx->cs); in mtx_init() 155 if (mtx) in mtx_destroy() 156 DeleteCriticalSection(&mtx->cs); in mtx_destroy() 159 static inline int mtx_lock(mtx_t *mtx) in mtx_lock() argument 161 if (!mtx) in mtx_lock() 164 EnterCriticalSection(&mtx->cs); in mtx_lock() 169 static inline int mtx_unlock(mtx_t *mtx) in mtx_unlock() argument 171 if (!mtx) in mtx_unlock() 174 LeaveCriticalSection(&mtx->cs); in mtx_unlock() [all …]
|
| /freebsd-14.2/contrib/processor-trace/include/posix/ |
| H A D | threads.h | 139 if (!mtx || type != mtx_plain) in mtx_init() 149 static inline void mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 151 if (mtx) in mtx_destroy() 152 (void) pthread_mutex_destroy(&mtx->mutex); in mtx_destroy() 155 static inline int mtx_lock(mtx_t *mtx) in mtx_lock() argument 159 if (!mtx) in mtx_lock() 162 errcode = pthread_mutex_lock(&mtx->mutex); in mtx_lock() 169 static inline int mtx_unlock(mtx_t *mtx) in mtx_unlock() argument 173 if (!mtx) in mtx_unlock() 176 errcode = pthread_mutex_unlock(&mtx->mutex); in mtx_unlock() [all …]
|
| /freebsd-14.2/sys/contrib/vchiq/interface/compat/ |
| H A D | vchi_bsd.c | 60 mtx_lock_spin(&t->mtx); in run_timer() 120 mtx_destroy(&t->mtx); in vchiq_del_timer_sync() 319 mtx_destroy(&s->mtx); in _sema_destroy() 327 mtx_lock(&s->mtx); in down() 335 mtx_unlock(&s->mtx); in down() 345 mtx_lock(&s->mtx); in down_interruptible() 362 mtx_unlock(&s->mtx); in down_interruptible() 374 mtx_lock(&s->mtx); in down_trylock() 384 mtx_unlock(&s->mtx); in down_trylock() 392 mtx_lock(&s->mtx); in up() [all …]
|
| /freebsd-14.2/contrib/netbsd-tests/rump/kernspace/ |
| H A D | lockme.c | 52 kmutex_t mtx; in rumptest_lockme() local 56 mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE); in rumptest_lockme() 60 mutex_enter(&mtx); in rumptest_lockme() 61 mutex_enter(&mtx); in rumptest_lockme() 76 mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE); in rumptest_lockme() 79 mutex_destroy(&mtx); in rumptest_lockme() 80 mutex_destroy(&mtx); in rumptest_lockme() 83 mutex_enter(&mtx); in rumptest_lockme() 84 mutex_destroy(&mtx); in rumptest_lockme()
|
| H A D | alloc.c | 51 static kmutex_t mtx; variable 60 mutex_enter(&mtx); in hthr() 65 cv_wait(&kcv, &mtx); in hthr() 66 mutex_exit(&mtx); in hthr() 85 mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE); in rumptest_alloc() 103 mutex_enter(&mtx); in rumptest_alloc() 105 cv_wait(&kcv, &mtx); in rumptest_alloc() 106 mutex_exit(&mtx); in rumptest_alloc() 112 mutex_enter(&mtx); in rumptest_alloc() 115 mutex_exit(&mtx); in rumptest_alloc()
|
| H A D | thread.c | 72 static kmutex_t mtx; variable 80 mutex_enter(&mtx); in thethread() 83 mutex_exit(&mtx); in thethread() 94 mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE); in rumptest_thread() 101 mutex_enter(&mtx); in rumptest_thread() 103 cv_wait(&cv, &mtx); in rumptest_thread() 104 mutex_exit(&mtx); in rumptest_thread()
|
| /freebsd-14.2/sys/compat/linuxkpi/common/src/ |
| H A D | linux_hrtimer.c | 59 mtx_lock(&hrtimer->mtx); in linux_hrtimer_active() 61 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_active() 76 mtx_lock(&hrtimer->mtx); in linux_hrtimer_try_to_cancel() 78 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_try_to_cancel() 104 mtx_init(&hrtimer->mtx, "hrtimer", NULL, in linux_hrtimer_init() 106 callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0); in linux_hrtimer_init() 127 mtx_lock(&hrtimer->mtx); in linux_hrtimer_start_range_ns() 131 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_start_range_ns() 138 mtx_lock(&hrtimer->mtx); in linux_hrtimer_forward_now() 141 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_forward_now()
|
| /freebsd-14.2/usr.bin/mkuzip/ |
| H A D | mkuz_fqueue.c | 67 pthread_mutex_lock(&fqp->mtx); in mkuz_fqueue_enq() 78 pthread_mutex_unlock(&fqp->mtx); in mkuz_fqueue_enq() 88 pthread_mutex_lock(&fqp->mtx); in mkuz_fqueue_enq_all() 100 pthread_mutex_unlock(&fqp->mtx); in mkuz_fqueue_enq_all() 124 pthread_mutex_lock(&fqp->mtx); in mkuz_fqueue_deq_when() 126 pthread_cond_wait(&fqp->cvar, &fqp->mtx); in mkuz_fqueue_deq_when() 156 pthread_mutex_unlock(&fqp->mtx); in mkuz_fqueue_deq_when() 169 pthread_mutex_lock(&fqp->mtx); in mkuz_fqueue_deq() 185 pthread_mutex_unlock(&fqp->mtx); in mkuz_fqueue_deq() 198 pthread_mutex_lock(&fqp->mtx); in mkuz_fqueue_deq_all() [all …]
|
| /freebsd-14.2/sys/kern/ |
| H A D | kern_devctl.c | 69 struct mtx mtx; member 221 mtx_lock(&devsoftc.mtx); in devopen() 228 mtx_unlock(&devsoftc.mtx); in devopen() 235 mtx_lock(&devsoftc.mtx); in devclose() 241 mtx_unlock(&devsoftc.mtx); in devclose() 259 mtx_lock(&devsoftc.mtx); in devread() 277 mtx_unlock(&devsoftc.mtx); in devread() 320 mtx_lock(&devsoftc.mtx); in devpoll() 373 mtx_lock(&devsoftc.mtx); in devctl_alloc_dei() 421 mtx_lock(&devsoftc.mtx); in devctl_queue() [all …]
|
| /freebsd-14.2/sys/dev/bhnd/nvram/ |
| H A D | bhnd_nvram_storevar.h | 267 struct mtx mtx; member 269 pthread_mutex_t mtx; 286 mtx_init(&(sc)->mtx, "BHND NVRAM store lock", NULL, MTX_DEF) 287 #define BHND_NVSTORE_LOCK(sc) mtx_lock(&(sc)->mtx) 288 #define BHND_NVSTORE_UNLOCK(sc) mtx_unlock(&(sc)->mtx) 289 #define BHND_NVSTORE_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->mtx, what) 290 #define BHND_NVSTORE_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx) 295 int error = pthread_mutex_init(&(sc)->mtx, NULL); \ 301 #define BHND_NVSTORE_LOCK(sc) pthread_mutex_lock(&(sc)->mtx) 302 #define BHND_NVSTORE_UNLOCK(sc) pthread_mutex_unlock(&(sc)->mtx) [all …]
|
| /freebsd-14.2/sys/libkern/ |
| H A D | arc4random.c | 64 struct mtx mtx; member 144 mtx_lock(&chacha20->mtx); in chacha20_randomstir() 153 mtx_unlock(&chacha20->mtx); in chacha20_randomstir() 169 mtx_init(&chacha20->mtx, "chacha20_mtx", NULL, MTX_DEF); 185 mtx_destroy(&chacha20->mtx); 218 mtx_lock(&chacha20->mtx); 223 mtx_unlock(&chacha20->mtx); 225 mtx_lock(&chacha20->mtx); 237 mtx_unlock(&chacha20->mtx); 239 mtx_lock(&chacha20->mtx); [all …]
|
| /freebsd-14.2/sys/dev/qat/qat_common/ |
| H A D | adf_freebsd_dev_processes.c | 39 static struct mtx mtx; variable 401 mtx_lock(&mtx); in adf_state_set() 425 mtx_unlock(&mtx); in adf_state_set() 481 mtx_lock(&mtx); in adf_state_kqfilter() 507 mtx_lock(&mtx); in adf_state_kqread_detach() 518 mtx_unlock(&mtx); in adf_state_kqread_detach() 555 mtx_lock(&mtx); in adf_state_destroy() 561 mtx_unlock(&mtx); in adf_state_destroy() 576 mtx_lock(&mtx); in adf_state_open() 609 mtx_lock(&mtx); in adf_state_read() [all …]
|
| /freebsd-14.2/contrib/jemalloc/src/ |
| H A D | background_thread.c | 195 malloc_mutex_unlock(tsdn, &decay->mtx); 274 malloc_mutex_unlock(tsdn, &info->mtx); 278 malloc_mutex_lock(tsdn, &info->mtx); 398 malloc_mutex_lock(tsdn, &info->mtx); 404 malloc_mutex_unlock(tsdn, &info->mtx); 734 malloc_mutex_unlock(tsdn, &decay->mtx); 736 malloc_mutex_unlock(tsdn, &info->mtx); 756 &background_thread_info[i].mtx); 765 &background_thread_info[i].mtx); 778 malloc_mutex_lock(tsdn, &info->mtx); [all …]
|
| /freebsd-14.2/sys/dev/gpio/ |
| H A D | gpioc.c | 77 struct mtx mtx; member 88 struct mtx mtx; member 276 mtx_lock(&priv->mtx); in gpioc_attach_priv_pin() 290 mtx_unlock(&priv->mtx); in gpioc_attach_priv_pin() 297 mtx_unlock(&priv->mtx); in gpioc_attach_priv_pin() 310 mtx_unlock(&priv->mtx); in gpioc_attach_priv_pin() 327 mtx_lock(&priv->mtx); in gpioc_detach_priv_pin() 357 mtx_unlock(&priv->mtx); in gpioc_detach_priv_pin() 516 mtx_lock(&priv->mtx); in gpioc_interrupt_handler() 732 mtx_lock(&priv->mtx); in gpioc_read() [all …]
|
| /freebsd-14.2/stand/kshim/ |
| H A D | bsd_kernel.c | 276 mtx->parent = mtx; in mtx_init() 280 mtx_lock(struct mtx *mtx) in mtx_lock() argument 282 mtx = mtx->parent; in mtx_lock() 287 mtx_unlock(struct mtx *mtx) in mtx_unlock() argument 289 mtx = mtx->parent; in mtx_unlock() 294 mtx_owned(struct mtx *mtx) in mtx_owned() argument 296 mtx = mtx->parent; in mtx_owned() 301 mtx_destroy(struct mtx *mtx) in mtx_destroy() argument 357 cv_wait(struct cv *cv, struct mtx *mtx) in cv_wait() argument 363 cv_timedwait(struct cv *cv, struct mtx *mtx, int timo) in cv_timedwait() argument [all …]
|