#pragma once #ifndef __x86_64__ #include "interrupts.h" struct InterruptLock { bool was_on; InterruptLock() : was_on(EnableInterrupts(false)) {} ~InterruptLock() { EnableInterrupts(was_on); } }; #else // __x86_64__ #include struct InterruptLock { static std::recursive_mutex m; InterruptLock() { m.lock(); } ~InterruptLock() { m.unlock(); } }; #endif // __x86_64__