Index: kernel/generic/src/synch/condvar.c
===================================================================
--- kernel/generic/src/synch/condvar.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/condvar.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -85,7 +85,7 @@
  * @return		See comment for waitq_sleep_timeout().
  */
-int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)
+errno_t _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)
 {
-	int rc;
+	errno_t rc;
 	ipl_t ipl;
 	bool blocked;
@@ -124,8 +124,8 @@
  * @return See comment for waitq_sleep_timeout().
  */
-int _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 
+errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 
 	uint32_t usec, int flags)
 {
-	int rc;
+	errno_t rc;
 	ipl_t ipl;
 	bool blocked;
@@ -161,8 +161,8 @@
  * @return See comment for waitq_sleep_timeout().
  */
-int _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 
+errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 
 	uint32_t usec, int flags)
 {
-	int rc;
+	errno_t rc;
 	/* Save spinlock's state so we can restore it correctly later on. */
 	ipl_t ipl = irq_lock->ipl;
Index: kernel/generic/src/synch/futex.c
===================================================================
--- kernel/generic/src/synch/futex.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/futex.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -398,10 +398,10 @@
  *                      waitq_sleep_timeout().
  */
-sysarg_t sys_futex_sleep(uintptr_t uaddr)
+sys_errno_t sys_futex_sleep(uintptr_t uaddr)
 {
 	futex_t *futex = get_futex(uaddr);
 	
 	if (!futex) 
-		return (sysarg_t) ENOENT;
+		return (sys_errno_t) ENOENT;
 
 #ifdef CONFIG_UDEBUG
@@ -409,5 +409,5 @@
 #endif
 
-	int rc = waitq_sleep_timeout(
+	errno_t rc = waitq_sleep_timeout(
 	    &futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE, NULL);
 
@@ -416,5 +416,5 @@
 #endif
 
-	return (sysarg_t) rc;
+	return (sys_errno_t) rc;
 }
 
@@ -425,5 +425,5 @@
  * @return		ENOENT if there is no physical mapping for uaddr.
  */
-sysarg_t sys_futex_wakeup(uintptr_t uaddr)
+sys_errno_t sys_futex_wakeup(uintptr_t uaddr)
 {
 	futex_t *futex = get_futex(uaddr);
@@ -433,5 +433,5 @@
 		return EOK;
 	} else {
-		return (sysarg_t) ENOENT;
+		return (sys_errno_t) ENOENT;
 	}
 }
Index: kernel/generic/src/synch/mutex.c
===================================================================
--- kernel/generic/src/synch/mutex.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/mutex.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -85,7 +85,7 @@
  *
  */
-int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags)
+errno_t _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags)
 {
-	int rc;
+	errno_t rc;
 
 	if (mtx->type == MUTEX_PASSIVE && THREAD) {
Index: kernel/generic/src/synch/rcu.c
===================================================================
--- kernel/generic/src/synch/rcu.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/rcu.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -957,5 +957,5 @@
 			
 			/* Wait for the GP to complete. */
-			int ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock, 
+			errno_t ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock, 
 				SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE);
 			
@@ -1013,5 +1013,5 @@
 		spinlock_lock(&rcu.gp_lock);
 
-		int ret = 0;
+		errno_t ret = 0;
 		ret = _condvar_wait_timeout_spinlock(&rcu.expedite_now, &rcu.gp_lock,
 			DETECT_SLEEP_MS * 1000, SYNCH_FLAGS_INTERRUPTIBLE);
Index: kernel/generic/src/synch/semaphore.c
===================================================================
--- kernel/generic/src/synch/semaphore.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/semaphore.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -71,5 +71,5 @@
  *
  */
-int _semaphore_down_timeout(semaphore_t *sem, uint32_t usec, unsigned int flags)
+errno_t _semaphore_down_timeout(semaphore_t *sem, uint32_t usec, unsigned int flags)
 {
 	return waitq_sleep_timeout(&sem->wq, usec, flags, NULL);
Index: kernel/generic/src/synch/smc.c
===================================================================
--- kernel/generic/src/synch/smc.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/smc.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -43,5 +43,5 @@
 #include <mm/as.h>
 
-sysarg_t sys_smc_coherence(uintptr_t va, size_t size)
+sys_errno_t sys_smc_coherence(uintptr_t va, size_t size)
 {
 	if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
Index: kernel/generic/src/synch/smp_memory_barrier.c
===================================================================
--- kernel/generic/src/synch/smp_memory_barrier.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/smp_memory_barrier.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -51,5 +51,5 @@
  * @return Irrelevant.
  */
-sysarg_t sys_smp_memory_barrier(void)
+sys_errno_t sys_smp_memory_barrier(void)
 {
 	for (unsigned int cpu_id = 0; cpu_id < config.cpu_active; ++cpu_id) {
Index: kernel/generic/src/synch/waitq.c
===================================================================
--- kernel/generic/src/synch/waitq.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/waitq.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -268,5 +268,5 @@
  *
  */
-int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)
+errno_t waitq_sleep_timeout(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)
 {
 	assert((!PREEMPTION_DISABLED) || (PARAM_NON_BLOCKING(flags, usec)));
@@ -274,5 +274,5 @@
 	ipl_t ipl = waitq_sleep_prepare(wq);
 	bool nblocked;
-	int rc = waitq_sleep_timeout_unsafe(wq, usec, flags, &nblocked);
+	errno_t rc = waitq_sleep_timeout_unsafe(wq, usec, flags, &nblocked);
 	waitq_sleep_finish(wq, nblocked, ipl);
 
@@ -373,5 +373,5 @@
  *
  */
-int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)
+errno_t waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, unsigned int flags, bool *blocked)
 {
 	*blocked = false;
Index: kernel/generic/src/synch/workqueue.c
===================================================================
--- kernel/generic/src/synch/workqueue.c	(revision 897fd8f11ec6c9c4a63697b4ccc6ab67c8be92f2)
+++ kernel/generic/src/synch/workqueue.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -895,5 +895,5 @@
 	
 	while (list_empty(&info->work_queues) && !stop) {
-		int ret = _condvar_wait_timeout_irq_spinlock(&info->req_cv, 
+		errno_t ret = _condvar_wait_timeout_irq_spinlock(&info->req_cv, 
 			&info->lock, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE);
 		
