Index: kernel/arch/amd64/include/asm.h
===================================================================
--- kernel/arch/amd64/include/asm.h	(revision d99c1d2ba8c7b2c687d430f2e9fd237046606545)
+++ kernel/arch/amd64/include/asm.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
@@ -38,4 +38,5 @@
 #include <config.h>
 #include <typedefs.h>
+#include <arch/cpu.h>
 
 extern void asm_delay_loop(uint32_t t);
@@ -269,4 +270,23 @@
 	return v;
 }
+
+/** Check interrupts state.
+ *
+ * @return True if interrupts are disabled.
+ *
+ */
+static inline bool interrupts_disabled(void)
+{
+	ipl_t v;
+	
+	asm volatile (
+		"pushfq\n"
+		"popq %[v]\n"
+		: [v] "=r" (v)
+	);
+	
+	return ((v & RFLAGS_IF) == 0);
+}
+
 
 /** Write to MSR */
