-#define LOCK(lockptr) do {\
- int v=1;\
- while(v) {\
- __ASM__("xchgl %%eax, (%%edi)":"=a"(v):"a"(1),"D"(lockptr));\
- if(v) Threads_Yield();\
- }\
-}while(0)
-/**
- * \brief Tight spinlock (does a HLT)
- */
-#define TIGHTLOCK(lockptr) do{\
- int v=1;\
- while(v) {\
- __ASM__("xchgl %%eax,(%%edi)":"=a"(v):"a"(1),"D"(lockptr));\
- if(v) __ASM__("hlt");\
- }\
-}while(0)
-/**
- * \brief Very Tight spinlock (short inter-cpu lock)
- */
-#define VTIGHTLOCK(lockptr) do{\
- int v=1;\
- while(v)__ASM__("xchgl %%eax,(%%edi)":"=a"(v):"a"(1),"D"(lockptr));\
-}while(0)
-/**
- * \brief Release a held spinlock
- */
-#define RELEASE(lockptr) __ASM__("lock andl $0, (%%edi)"::"D"(lockptr));
+struct sShortSpinlock {
+ #if STACKED_LOCKS == 2
+ volatile void *Lock; //!< Lock value
+ #else
+ volatile int Lock; //!< Lock value
+ #endif
+
+ #if LOCK_DISABLE_INTS
+ int IF; //!< Interrupt state on call to SHORTLOCK
+ #endif
+ #if STACKED_LOCKS
+ int Depth;
+ #endif
+};
+
+// === MACROS ===