Commit 9a970ebd by malcolm

nested cli and sti fix

parent a9a9bf75
Showing with 10 additions and 1 deletions
...@@ -35,14 +35,23 @@ inline uint32_t inl(uint16_t port) ...@@ -35,14 +35,23 @@ inline uint32_t inl(uint16_t port)
return ret; return ret;
} }
uint32_t __int_depth;
inline void disable_int() inline void disable_int()
{ {
asm volatile ("cli"); asm volatile ("cli");
__int_depth++;
} }
inline void enable_int() inline void enable_int()
{ {
asm volatile ("sti"); if(__int_depth>0)
{
if(--__int_depth == 0)
{
asm volatile ("sti");
}
}
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment