| /xnu-12377.41.6/tests/unit/mocks/fibers/ |
| H A D | rwlock.c | 40 fibers_rwlock_init(fibers_rwlock_t *rwlock) in fibers_rwlock_init() argument 42 rwlock->writer_active = NULL; in fibers_rwlock_init() 43 rwlock->reader_count = 0; in fibers_rwlock_init() 44 rwlock->reader_wait_queue = (struct fibers_queue){0, 0}; in fibers_rwlock_init() 45 rwlock->writer_wait_queue = (struct fibers_queue){0, 0}; in fibers_rwlock_init() 48 __tsan_mutex_create(rwlock, __tsan_mutex_not_static); in fibers_rwlock_init() 53 fibers_rwlock_rdlock_helper(fibers_rwlock_t *rwlock, bool check_may_yield) in fibers_rwlock_rdlock_helper() argument 56 __tsan_mutex_pre_lock(rwlock, __tsan_mutex_read_lock); in fibers_rwlock_rdlock_helper() 60 if (rwlock->writer_active != NULL || rwlock->writer_wait_queue.count > 0) { in fibers_rwlock_rdlock_helper() 62 rwlock, rwlock->writer_active, rwlock->writer_wait_queue.count); in fibers_rwlock_rdlock_helper() [all …]
|
| H A D | rwlock.h | 52 extern void fibers_rwlock_init(fibers_rwlock_t *rwlock); 53 extern void fibers_rwlock_rdlock(fibers_rwlock_t *rwlock, bool check_may_yield); 54 extern void fibers_rwlock_wrlock(fibers_rwlock_t *rwlock, bool check_may_yield); 55 extern int fibers_rwlock_try_rdlock(fibers_rwlock_t *rwlock); 56 extern int fibers_rwlock_try_wrlock(fibers_rwlock_t *rwlock); 57 extern void fibers_rwlock_rdunlock(fibers_rwlock_t *rwlock); 58 extern void fibers_rwlock_wrunlock(fibers_rwlock_t *rwlock); 59 extern void fibers_rwlock_unlock(fibers_rwlock_t *rwlock); 60 extern void fibers_rwlock_destroy(fibers_rwlock_t *rwlock); 61 extern bool fibers_rwlock_upgrade(fibers_rwlock_t *rwlock); [all …]
|
| /xnu-12377.41.6/osfmk/arm64/sptm/pmap/ |
| H A D | pmap_internal.h | 138 lck_rw_init(&pmap->rwlock, &pmap_lck_grp, 0); in pmap_lock_init() 149 lck_rw_destroy(&pmap->rwlock, &pmap_lck_grp); in pmap_lock_destroy() 196 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_SHARED); in pmap_assert_locked() 199 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_EXCLUSIVE); in pmap_assert_locked() 202 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_HELD); in pmap_assert_locked() 219 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_HELD); in pmap_assert_locked_any() 256 lck_rw_lock_shared(&pmap->rwlock); in pmap_lock() 259 lck_rw_lock_exclusive(&pmap->rwlock); in pmap_lock() 289 ret = lck_rw_try_lock_shared(&pmap->rwlock); in pmap_try_lock() 292 ret = lck_rw_try_lock_exclusive(&pmap->rwlock); in pmap_try_lock() [all …]
|
| H A D | pmap.h | 337 decl_lck_rw_data(, rwlock);
|
| /xnu-12377.41.6/osfmk/arm/pmap/ |
| H A D | pmap_internal.h | 208 lck_rw_init(&pmap->rwlock, &pmap_lck_grp, 0); in pmap_lock_init() 209 pmap->rwlock.lck_rw_can_sleep = FALSE; in pmap_lock_init() 220 lck_rw_destroy(&pmap->rwlock, &pmap_lck_grp); in pmap_lock_destroy() 235 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_SHARED); in pmap_assert_locked() 238 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_EXCLUSIVE); in pmap_assert_locked() 254 LCK_RW_ASSERT(&pmap->rwlock, LCK_RW_ASSERT_HELD); in pmap_assert_locked_any() 276 lck_rw_lock_shared(&pmap->rwlock); in pmap_lock() 279 lck_rw_lock_exclusive(&pmap->rwlock); in pmap_lock() 320 ret = lck_rw_lock_shared_b(&pmap->rwlock, check_preemption); in pmap_lock_preempt() 323 ret = lck_rw_lock_exclusive_b(&pmap->rwlock, check_preemption); in pmap_lock_preempt() [all …]
|
| H A D | pmap.h | 363 decl_lck_rw_data(, rwlock);
|
| H A D | pmap.c | 13954 lck_rw_unlock_exclusive(&cd_entry->rwlock); 13990 lck_rw_unlock_exclusive(&cd_entry->rwlock); 14037 lck_rw_unlock_exclusive(&cd_entry->rwlock); 14102 lck_rw_unlock_shared(&cd_entry->rwlock); 14269 lck_rw_unlock_exclusive(&cd_entry->rwlock);
|
| /xnu-12377.41.6/bsd/sys/ |
| H A D | pthread_shims.h | 97 …int (*psynch_rw_longrdlock)(proc_t p, user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint… 98 …int (*psynch_rw_rdlock)(proc_t p, user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t… 99 …int (*psynch_rw_unlock)(proc_t p, user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t… 100 …int (*psynch_rw_wrlock)(proc_t p, user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t… 101 …int (*psynch_rw_yieldwrlock)(proc_t p, user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uin…
|
| /xnu-12377.41.6/bsd/security/audit/ |
| H A D | audit_bsd.h | 178 struct rwlock { struct 273 void _audit_rw_init(struct rwlock *lp, const char *name); 274 void _audit_rw_destroy(struct rwlock *lp);
|
| H A D | audit_bsd.c | 179 _audit_rw_init(struct rwlock *lp, const char *lckname) in _audit_rw_init() 181 _audit_rw_init(struct rwlock *lp, __unused const char *lckname) in _audit_rw_init() 193 _audit_rw_destroy(struct rwlock *lp) in _audit_rw_destroy()
|
| H A D | audit_bsm_klib.c | 74 static struct rwlock evclass_lock;
|
| H A D | audit.c | 191 static struct rwlock audit_kinfo_lock;
|
| H A D | audit_session.c | 117 static struct rwlock se_entry_lck; /* (1) lock for se_link above */ 310 static struct rwlock audit_sdev_lock;
|
| H A D | audit_pipe.c | 195 static struct rwlock audit_pipe_lock;
|
| /xnu-12377.41.6/bsd/pthread/ |
| H A D | pthread_shims.c | 448 …return pthread_functions->psynch_rw_longrdlock(p, uap->rwlock, uap->lgenval, uap->ugenval, uap->rw… in psynch_rw_longrdlock() 454 …return pthread_functions->psynch_rw_rdlock(p, uap->rwlock, uap->lgenval, uap->ugenval, uap->rw_wc,… in psynch_rw_rdlock() 460 …return pthread_functions->psynch_rw_unlock(p, uap->rwlock, uap->lgenval, uap->ugenval, uap->rw_wc,… in psynch_rw_unlock() 472 …return pthread_functions->psynch_rw_wrlock(p, uap->rwlock, uap->lgenval, uap->ugenval, uap->rw_wc,… in psynch_rw_wrlock() 478 …return pthread_functions->psynch_rw_yieldwrlock(p, uap->rwlock, uap->lgenval, uap->ugenval, uap->r… in psynch_rw_yieldwrlock()
|
| /xnu-12377.41.6/tests/ |
| H A D | stackshot_block_owner_14362384.m | 346 /* perform various actions with a rwlock in kernel memory. note that, since we aren't allowed 347 * to go to user space while still holding a rwlock, the lock-acquiring actions in this kernel 387 T_ASSERT_POSIX_SUCCESS(ret, "sysctl: %s kernel rwlock", action_name); 399 T_QUIET; T_ASSERT_POSIX_SUCCESS(ret, "Getting unslid location of kernel rwlock"); 400 …T_EXPECT_EQ(context, unslid_krwlck_address, "Context should match unslid location of rwlock in ker… 449 // acquires a kernel rwlock for writing, and then waits on a kernel semaphore. 458 // attempts to acquire a kernel rwlock for reading, and doesn't wait on a semaphore afterwards. 699 // this thread should spawn, acquire a kernel rwlock for write, and then wait on a semaphore 703 // this thread should spawn and try to acquire the same kernel rwlock for read, but block 802 …check_python(stackshot, __func__, "thread \\d+: pthread rwlock %llx for reading", (long long)&rwlc…
|
| /xnu-12377.41.6/osfmk/vm/ |
| H A D | pmap_cs.h | 422 decl_lck_rw_data(, rwlock);
|
| /xnu-12377.41.6/tests/unit/ |
| H A D | Makefile | 149 mocks/fibers/rwlock.c \
|
| /xnu-12377.41.6/tools/lldbmacros/ |
| H A D | memory.py | 2501 def GetRWLockSummary(rwlock): argument 2508 if not rwlock: 2512 if rwlock.lck_rw_type != GetEnumValue('lck_type_t', 'LCK_TYPE_RW'): 2514 lock_word = rwlock.lck_rw 2535 out_str += "Write owner\t\t: {:#x}\n".format(getThreadFromCtidInternal(rwlock.lck_rw_owner))
|