-typedef volatile int tSpinlock;
-#define IS_LOCKED(lockptr) (!!(*(tSpinlock*)lockptr))
-#define _LOCK(lockptr,action) do {int v=1;\
- while(v)\
- __asm__ __volatile__("lock xchgl %0, (%2)":"=r"(v):"r"(1),"r"(lockptr));\
- if(v) action;\
- }while(0)
-#define TIGHTLOCK(lockptr) _LOCK(lockptr, __asm__ __volatile__ ("hlt"));
-#define LOCK(lockptr) _LOCK(lockptr, Threads_Yield());
-#define RELEASE(lockptr) __asm__ __volatile__("lock andl $0, (%0)"::"r"(lockptr));
-#define HALT() __asm__ __volatile__ ("hlt")
+// === MACROS ===
+/**
+ * \brief Halt the CPU
+ */
+#define HALT() __asm__ __volatile__ ("sti;\n\thlt")
+/**
+ * \brief Fire a magic breakpoint (bochs)
+ */
+#define MAGIC_BREAK() __asm__ __volatile__ ("xchg %bx, %bx")