Index: kernel/arch/amd64/src/userspace.c
===================================================================
--- kernel/arch/amd64/src/userspace.c	(revision 9732e98d6638fbe3f59b52d0c3bfad4e8aa965ec)
+++ kernel/arch/amd64/src/userspace.c	(revision 8688a6e3018ec48f77ff663f1f31da00cd6b6e2b)
@@ -34,4 +34,5 @@
 
 #include <userspace.h>
+#include <arch/cpu.h>
 #include <arch/pm.h>
 #include <arch/types.h>
@@ -50,6 +51,6 @@
 	ipl_t ipl = interrupts_disable();
 	
-	/* Clear CF, PF, AF, ZF, SF, DF, OF */
-	ipl &= ~(0xcd4);
+	ipl &= ~(RFLAGS_CF | RFLAGS_PF | RFLAGS_AF | RFLAGS_ZF | RFLAGS_SF |
+	    RFLAGS_DF | RFLAGS_OF);
 	
 	asm volatile (
