mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Added Interrupt::SetEnabled(bool).
This commit is contained in:
parent
f59b53ddce
commit
3b63a70191
1 changed files with 6 additions and 0 deletions
|
@ -52,6 +52,12 @@ extern "C" unsigned long asm_interrupts_are_enabled();
|
|||
inline bool IsEnabled() { return asm_interrupts_are_enabled(); }
|
||||
inline void Enable() { asm volatile("sti"); }
|
||||
inline void Disable() { asm volatile("cli"); }
|
||||
inline bool SetEnabled(bool isenabled)
|
||||
{
|
||||
bool wasenabled = IsEnabled();
|
||||
if ( isenabled ) { Enable(); } else { Disable(); }
|
||||
return wasenabled;
|
||||
}
|
||||
|
||||
typedef void (*Handler)(CPU::InterruptRegisters* regs, void* user);
|
||||
void RegisterHandler(unsigned index, Handler handler, void* user);
|
||||
|
|
Loading…
Add table
Reference in a new issue