Index: kernel/generic/src/syscall/syscall.c
===================================================================
--- kernel/generic/src/syscall/syscall.c	(revision e2fcdb15a346346bb5ae9143203e376ce5a4dc9d)
+++ kernel/generic/src/syscall/syscall.c	(revision ffe4a87f6f04e3b1afccf14bda789427236053b1)
@@ -59,24 +59,20 @@
     unative_t a4, unative_t a5, unative_t a6, unative_t id)
 {
-	unative_t rc;
-	ipl_t ipl;
-
 	/* Do userpace accounting */
-	ipl = interrupts_disable();
-	spinlock_lock(&THREAD->lock);
+	irq_spinlock_lock(&THREAD->lock, true);
 	thread_update_accounting(true);
-	spinlock_unlock(&THREAD->lock);
-	interrupts_restore(ipl);
-
+	irq_spinlock_unlock(&THREAD->lock, true);
+	
 #ifdef CONFIG_UDEBUG
 	/*
 	 * Early check for undebugged tasks. We do not lock anything as this
 	 * test need not be precise in either direction.
+	 *
 	 */
-	if (THREAD->udebug.active) {
+	if (THREAD->udebug.active)
 		udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
-	}
 #endif
 	
+	unative_t rc;
 	if (id < SYSCALL_END) {
 		rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
@@ -93,5 +89,5 @@
 	if (THREAD->udebug.active) {
 		udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
-	
+		
 		/*
 		 * Stopping point needed for tasks that only invoke
@@ -103,11 +99,9 @@
 	}
 #endif
-
+	
 	/* Do kernel accounting */
-	(void) interrupts_disable();
-	spinlock_lock(&THREAD->lock);
+	irq_spinlock_lock(&THREAD->lock, true);
 	thread_update_accounting(false);
-	spinlock_unlock(&THREAD->lock);
-	interrupts_restore(ipl);
+	irq_spinlock_unlock(&THREAD->lock, true);
 	
 	return rc;
