| /trueos/contrib/ipfilter/lib/ |
| HD | mutex_emul.c | 20 eMmutex_enter(mtx, file, line) in eMmutex_enter() argument 21 eMmutex_t *mtx; in eMmutex_enter() 27 mtx->eMm_owner); 28 if (mtx->eMm_magic != EMM_MAGIC) { 30 mtx->eMm_owner, mtx, mtx->eMm_magic); 33 if (mtx->eMm_held != 0) { 35 mtx->eMm_owner, mtx, mtx->eMm_held); 38 mtx->eMm_held++; 39 mtx->eMm_heldin = file; 40 mtx->eMm_heldat = line; [all …]
|
| /trueos/sys/dev/usb/ |
| HD | usb_request.h | 33 struct mtx *mtx, uint16_t sel); 35 struct mtx *mtx, uint8_t port, uint16_t sel); 37 struct mtx *mtx, uint8_t *alt_iface_no, 39 usb_error_t usbd_req_get_config(struct usb_device *udev, struct mtx *mtx, 43 usb_error_t usbd_req_get_config_desc(struct usb_device *udev, struct mtx *mtx, 46 struct mtx *mtx, struct usb_config_descriptor **ppcd, 48 usb_error_t usbd_req_get_desc(struct usb_device *udev, struct mtx *mtx, 52 usb_error_t usbd_req_get_device_desc(struct usb_device *udev, struct mtx *mtx, 55 struct mtx *mtx, struct usb_status *st); 57 struct mtx *mtx, struct usb_hub_descriptor *hd, [all …]
|
| HD | usb_request.c | 404 usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx, in usbd_do_request_flags() argument 457 if ((mtx != NULL) && (mtx != &Giant)) { in usbd_do_request_flags() 458 mtx_unlock(mtx); in usbd_do_request_flags() 459 mtx_assert(mtx, MA_NOTOWNED); in usbd_do_request_flags() 721 if ((mtx != NULL) && (mtx != &Giant)) in usbd_do_request_flags() 722 mtx_lock(mtx); in usbd_do_request_flags() 732 usb_pause_mtx(mtx, hz / 16); in usbd_do_request_flags() 793 usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port) in usbd_req_reset_port() argument 805 udev, mtx, port, UHF_C_PORT_RESET); in usbd_req_reset_port() 809 udev, mtx, port, UHF_PORT_RESET); in usbd_req_reset_port() [all …]
|
| HD | 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,
|
| /trueos/lib/libthr/thread/ |
| HD | thr_umtx.h | 39 int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __hidden; 40 int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden; 41 int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id, 43 int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) __hidden; 44 int __thr_umutex_trylock(struct umutex *mtx) __hidden; 45 int __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling, 48 void _thr_umutex_init(struct umutex *mtx) __hidden; 51 int _thr_umtx_wait(volatile long *mtx, long exp, 53 int _thr_umtx_wait_uint(volatile u_int *mtx, u_int exp, 55 int _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int exp, int clockid, [all …]
|
| HD | thr_umtx.c | 43 _thr_umutex_init(struct umutex *mtx) in _thr_umutex_init() argument 47 *mtx = default_mtx; in _thr_umutex_init() 58 __thr_umutex_lock(struct umutex *mtx, uint32_t id) in __thr_umutex_lock() argument 62 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { in __thr_umutex_lock() 65 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0); in __thr_umutex_lock() 67 owner = mtx->m_owner; in __thr_umutex_lock() 69 atomic_cmpset_acq_32(&mtx->m_owner, owner, id|owner)) in __thr_umutex_lock() 74 return _umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0); in __thr_umutex_lock() 80 __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) in __thr_umutex_lock_spin() argument 85 return __thr_umutex_lock(mtx, id); in __thr_umutex_lock_spin() [all …]
|
| /trueos/lib/libstdthreads/ |
| HD | mtx.c | 38 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 41 (void)pthread_mutex_destroy(mtx); in mtx_destroy() 45 mtx_init(mtx_t *mtx, int type) in mtx_init() argument 67 if (pthread_mutex_init(mtx, &attr) != 0) in mtx_init() 73 mtx_lock(mtx_t *mtx) in mtx_lock() argument 76 if (pthread_mutex_lock(mtx) != 0) in mtx_lock() 82 mtx_timedlock(mtx_t *restrict mtx, const struct timespec *restrict ts) in mtx_timedlock() argument 85 switch (pthread_mutex_timedlock(mtx, ts)) { in mtx_timedlock() 96 mtx_trylock(mtx_t *mtx) in mtx_trylock() argument 99 switch (pthread_mutex_trylock(mtx)) { in mtx_trylock() [all …]
|
| /trueos/contrib/netbsd-tests/lib/libpthread/dlopen/ |
| HD | 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 113 ATF_REQUIRE(pthread_mutex_init(&mtx, NULL) == 0); in ATF_TC_BODY() 114 ATF_REQUIRE(pthread_mutex_lock(&mtx) == 0); in ATF_TC_BODY() 123 ATF_REQUIRE(testf_dso_mutex_unlock(&mtx) == 0xcafe); in ATF_TC_BODY() 127 pthread_mutex_destroy(&mtx); in ATF_TC_BODY() [all …]
|
| /trueos/tools/regression/pthread/mutex_isowned_np/ |
| HD | mutex_isowned_np.c | 38 pthread_mutex_t *mtx = arg; in thread() local 40 if (pthread_mutex_isowned_np(mtx) != 0) { in thread() 52 pthread_mutex_t mtx; in main() local 54 pthread_mutex_init(&mtx, NULL); in main() 55 if (pthread_mutex_isowned_np(&mtx) != 0) { in main() 60 pthread_mutex_lock(&mtx); in main() 61 if (pthread_mutex_isowned_np(&mtx) == 0) { in main() 66 pthread_create(&thr, NULL, thread, &mtx); in main() 68 pthread_mutex_unlock(&mtx); in main() 69 if (pthread_mutex_isowned_np(&mtx) != 0) { in main()
|
| /trueos/sys/boot/usb/ |
| HD | bsd_kernel.c | 37 struct mtx Giant; 47 mtx_init(struct mtx *mtx, const char *name, const char *type, int opt) in mtx_init() argument 49 mtx->owned = 0; in mtx_init() 50 mtx->parent = mtx; in mtx_init() 54 mtx_lock(struct mtx *mtx) in mtx_lock() argument 56 mtx = mtx->parent; in mtx_lock() 57 mtx->owned++; in mtx_lock() 61 mtx_unlock(struct mtx *mtx) in mtx_unlock() argument 63 mtx = mtx->parent; in mtx_unlock() 64 mtx->owned--; in mtx_unlock() [all …]
|
| /trueos/contrib/netbsd-tests/rump/kernspace/ |
| HD | 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()
|
| HD | 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()
|
| HD | 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()
|
| /trueos/sys/cam/ |
| HD | cam_sim.c | 64 struct mtx *mtx, int max_dev_transactions, in cam_sim_alloc() argument 69 if (mtx == NULL) in cam_sim_alloc() 90 sim->mtx = mtx; in cam_sim_alloc() 91 if (mtx == &Giant) { in cam_sim_alloc() 106 mtx_assert(sim->mtx, MA_OWNED); in cam_sim_free() 109 error = msleep(sim, sim->mtx, PRIBIO, "simfree", 0); in cam_sim_free() 125 lock = (mtx_owned(sim->mtx) == 0); in cam_sim_release() 141 lock = (mtx_owned(sim->mtx) == 0); in cam_sim_hold()
|
| /trueos/sys/fs/fuse/ |
| HD | fuse.h | 148 extern struct mtx fuse_mtx; 203 #define fuse_lck_mtx_lock(mtx) do { \ argument 205 __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ 206 mtx_lock(&(mtx)); \ 208 __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ 211 #define fuse_lck_mtx_unlock(mtx) do { \ argument 213 __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ 214 mtx_unlock(&(mtx)); \ 216 __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \
|
| /trueos/sys/kern/ |
| HD | kern_mutex.c | 89 #define mtxlock2mtx(c) (__containerof(c, struct mtx, mtx_lock)) 146 struct mtx blocked_lock; 147 struct mtx Giant; 153 mtx_assert((const struct mtx *)lock, what); in assert_mtx() 160 mtx_lock((struct mtx *)lock); in lock_mtx() 173 struct mtx *m; in unlock_mtx() 175 m = (struct mtx *)lock; in unlock_mtx() 192 const struct mtx *m = (const struct mtx *)lock; in owner_mtx() 206 struct mtx *m; in __mtx_lock_flags() 235 struct mtx *m; in __mtx_unlock_flags() [all …]
|
| /trueos/sys/netsmb/ |
| HD | smb_subr.h | 74 #define smb_slock mtx 75 #define smb_sl_init(mtx, desc) mtx_init(mtx, desc, NULL, MTX_DEF) argument 76 #define smb_sl_destroy(mtx) mtx_destroy(mtx) argument 77 #define smb_sl_lock(mtx) mtx_lock(mtx) argument 78 #define smb_sl_unlock(mtx) mtx_unlock(mtx) argument
|
| /trueos/sys/nfs/ |
| HD | nfs_fha.c | 58 mtx_init(&softc->fha_hash[i].mtx, "fhalock", NULL, MTX_DEF); in fha_init() 121 mtx_destroy(&softc->fha_hash[i].mtx); in fha_uninit() 210 mtx_assert(e->mtx, MA_OWNED); in fha_hash_entry_destroy() 224 mtx_assert(e->mtx, MA_OWNED); in fha_hash_entry_remove() 239 new_fhe->mtx = &fhs->mtx; in fha_hash_entry_lookup() 240 mtx_lock(&fhs->mtx); in fha_hash_entry_lookup() 256 mtx_assert(fhe->mtx, MA_OWNED); in fha_hash_entry_add_thread() 266 mtx_assert(fhe->mtx, MA_OWNED); in fha_hash_entry_remove_thread() 280 mtx_assert(fhe->mtx, MA_OWNED); in fha_hash_entry_add_op() 428 mtx_unlock(fhe->mtx); in fha_assign() [all …]
|
| /trueos/contrib/netbsd-tests/lib/libpthread/dlopen/dso/ |
| HD | h_pthread_dlopen.c | 59 testf_dso_mutex_lock(pthread_mutex_t *mtx) in testf_dso_mutex_lock() argument 61 ATF_REQUIRE(mtx != NULL); in testf_dso_mutex_lock() 62 ATF_REQUIRE(pthread_mutex_lock(mtx) == 0); in testf_dso_mutex_lock() 68 testf_dso_mutex_unlock(pthread_mutex_t *mtx) in testf_dso_mutex_unlock() argument 70 ATF_REQUIRE(mtx != NULL); in testf_dso_mutex_unlock() 71 ATF_REQUIRE(pthread_mutex_unlock(mtx) == 0); in testf_dso_mutex_unlock()
|
| /trueos/sys/dev/sound/usb/ |
| HD | uaudio_pcm.c | 138 struct mtx *mtx = mixer_get_lock(m); in ua_mixer_set() local 141 if (mtx_owned(mtx)) { in ua_mixer_set() 145 mtx_lock(mtx); in ua_mixer_set() 149 mtx_unlock(mtx); in ua_mixer_set() 157 struct mtx *mtx = mixer_get_lock(m); in ua_mixer_setrecsrc() local 161 if (mtx_owned(mtx)) { in ua_mixer_setrecsrc() 165 mtx_lock(mtx); in ua_mixer_setrecsrc() 169 mtx_unlock(mtx); in ua_mixer_setrecsrc()
|
| /trueos/sys/net80211/ |
| HD | ieee80211_freebsd.h | 43 struct mtx mtx; member 48 mtx_init(&cl->mtx, cl->name, NULL, MTX_DEF | MTX_RECURSE); \ 50 #define IEEE80211_LOCK_OBJ(_ic) (&(_ic)->ic_comlock.mtx) 67 struct mtx mtx; member 72 mtx_init(&cl->mtx, cl->name, NULL, MTX_DEF); \ 74 #define IEEE80211_TX_LOCK_OBJ(_ic) (&(_ic)->ic_txlock.mtx) 88 struct mtx mtx; member 93 mtx_init(&nl->mtx, nl->name, NULL, MTX_DEF | MTX_RECURSE); \ 95 #define IEEE80211_NODE_LOCK_OBJ(_nt) (&(_nt)->nt_nodelock.mtx) 114 struct mtx mtx; member [all …]
|
| /trueos/sys/arm/xscale/i80321/ |
| HD | i80321_dma.c | 77 struct mtx mtx; member 115 mtx_init(&softc->mtx, "DMA engine mtx", NULL, MTX_SPIN); in i80321_dma_attach() 195 mtx_lock_spin(&softcs[0]->mtx); in dma_memcpy() 197 mtx_unlock_spin(&softcs[0]->mtx); in dma_memcpy() 198 mtx_lock_spin(&softcs[1]->mtx); in dma_memcpy() 200 mtx_unlock(&softcs[1]->mtx); in dma_memcpy() 207 mtx_unlock_spin(&sc->mtx); in dma_memcpy() 222 mtx_lock_spin(&sc->mtx); in dma_memcpy() 224 mtx_unlock_spin(&sc->mtx); in dma_memcpy() 296 mtx_lock_spin(&sc->mtx); in dma_memcpy() [all …]
|
| /trueos/tools/regression/pthread/unwind/ |
| HD | cond_wait_cancel.cpp | 11 pthread_mutex_t mtx; variable 19 pthread_mutex_lock(&mtx); in thr() 20 pthread_cond_wait(&cv, &mtx); in thr() 21 pthread_mutex_unlock(&mtx); in thr() 31 pthread_mutex_init(&mtx, NULL); in main()
|
| HD | cond_wait_cancel2.cpp | 16 pthread_mutex_t mtx; variable 23 pthread_mutex_lock(&mtx); in f() 24 pthread_cond_wait(&cv, &mtx); in f() 25 pthread_mutex_unlock(&mtx); in f() 48 pthread_mutex_init(&mtx, NULL); in main()
|
| /trueos/sys/sys/ |
| HD | rangelock.h | 66 struct mtx; 71 struct mtx *ilk); 73 off_t start, off_t end, struct mtx *ilk); 75 struct mtx *ilk); 77 struct mtx *ilk);
|