Changeset b7fd2a0 in mainline for kernel/generic/src/synch
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- kernel/generic/src/synch
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/condvar.c
r36f0738 rb7fd2a0 85 85 * @return See comment for waitq_sleep_timeout(). 86 86 */ 87 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)87 errno_t _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags) 88 88 { 89 int rc;89 errno_t rc; 90 90 ipl_t ipl; 91 91 bool blocked; … … 124 124 * @return See comment for waitq_sleep_timeout(). 125 125 */ 126 int _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock,126 errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 127 127 uint32_t usec, int flags) 128 128 { 129 int rc;129 errno_t rc; 130 130 ipl_t ipl; 131 131 bool blocked; … … 161 161 * @return See comment for waitq_sleep_timeout(). 162 162 */ 163 int _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock,163 errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 164 164 uint32_t usec, int flags) 165 165 { 166 int rc;166 errno_t rc; 167 167 /* Save spinlock's state so we can restore it correctly later on. */ 168 168 ipl_t ipl = irq_lock->ipl; -
kernel/generic/src/synch/futex.c
r36f0738 rb7fd2a0 398 398 * waitq_sleep_timeout(). 399 399 */ 400 sys arg_t sys_futex_sleep(uintptr_t uaddr)400 sys_errno_t sys_futex_sleep(uintptr_t uaddr) 401 401 { 402 402 futex_t *futex = get_futex(uaddr); 403 403 404 404 if (!futex) 405 return (sys arg_t) ENOENT;405 return (sys_errno_t) ENOENT; 406 406 407 407 #ifdef CONFIG_UDEBUG … … 409 409 #endif 410 410 411 int rc = waitq_sleep_timeout(411 errno_t rc = waitq_sleep_timeout( 412 412 &futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE, NULL); 413 413 … … 416 416 #endif 417 417 418 return (sys arg_t) rc;418 return (sys_errno_t) rc; 419 419 } 420 420 … … 425 425 * @return ENOENT if there is no physical mapping for uaddr. 426 426 */ 427 sys arg_t sys_futex_wakeup(uintptr_t uaddr)427 sys_errno_t sys_futex_wakeup(uintptr_t uaddr) 428 428 { 429 429 futex_t *futex = get_futex(uaddr); … … 433 433 return EOK; 434 434 } else { 435 return (sys arg_t) ENOENT;435 return (sys_errno_t) ENOENT; 436 436 } 437 437 } -
kernel/generic/src/synch/mutex.c
r36f0738 rb7fd2a0 85 85 * 86 86 */ 87 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags)87 errno_t _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags) 88 88 { 89 int rc;89 errno_t rc; 90 90 91 91 if (mtx->type == MUTEX_PASSIVE && THREAD) { -
kernel/generic/src/synch/rcu.c
r36f0738 rb7fd2a0 957 957 958 958 /* Wait for the GP to complete. */ 959 int ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock,959 errno_t ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock, 960 960 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE); 961 961 … … 1013 1013 spinlock_lock(&rcu.gp_lock); 1014 1014 1015 int ret = 0;1015 errno_t ret = 0; 1016 1016 ret = _condvar_wait_timeout_spinlock(&rcu.expedite_now, &rcu.gp_lock, 1017 1017 DETECT_SLEEP_MS * 1000, SYNCH_FLAGS_INTERRUPTIBLE); -
kernel/generic/src/synch/semaphore.c
r36f0738 rb7fd2a0 71 71 * 72 72 */ 73 int _semaphore_down_timeout(semaphore_t *sem, uint32_t usec, unsigned int flags)73 errno_t _semaphore_down_timeout(semaphore_t *sem, uint32_t usec, unsigned int flags) 74 74 { 75 75 return waitq_sleep_timeout(&sem->wq, usec, flags, NULL); -
kernel/generic/src/synch/smc.c
r36f0738 rb7fd2a0 43 43 #include <mm/as.h> 44 44 45 sys arg_t sys_smc_coherence(uintptr_t va, size_t size)45 sys_errno_t sys_smc_coherence(uintptr_t va, size_t size) 46 46 { 47 47 if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE)) -
kernel/generic/src/synch/smp_memory_barrier.c
r36f0738 rb7fd2a0 51 51 * @return Irrelevant. 52 52 */ 53 sys arg_t sys_smp_memory_barrier(void)53 sys_errno_t sys_smp_memory_barrier(void) 54 54 { 55 55 for (unsigned int cpu_id = 0; cpu_id < config.cpu_active; ++cpu_id) { -
kernel/generic/src/synch/waitq.c
r36f0738 rb7fd2a0 268 268 * 269 269 */ 270 int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)270 errno_t waitq_sleep_timeout(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked) 271 271 { 272 272 assert((!PREEMPTION_DISABLED) || (PARAM_NON_BLOCKING(flags, usec))); … … 274 274 ipl_t ipl = waitq_sleep_prepare(wq); 275 275 bool nblocked; 276 int rc = waitq_sleep_timeout_unsafe(wq, usec, flags, &nblocked);276 errno_t rc = waitq_sleep_timeout_unsafe(wq, usec, flags, &nblocked); 277 277 waitq_sleep_finish(wq, nblocked, ipl); 278 278 … … 373 373 * 374 374 */ 375 int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)375 errno_t waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked) 376 376 { 377 377 *blocked = false; -
kernel/generic/src/synch/workqueue.c
r36f0738 rb7fd2a0 895 895 896 896 while (list_empty(&info->work_queues) && !stop) { 897 int ret = _condvar_wait_timeout_irq_spinlock(&info->req_cv,897 errno_t ret = _condvar_wait_timeout_irq_spinlock(&info->req_cv, 898 898 &info->lock, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE); 899 899
Note:
See TracChangeset
for help on using the changeset viewer.
