Interrupts: ensure is_in_handler is true if we know we are in a handler

This commit is contained in:
apio 2022-09-21 21:03:49 +02:00
parent 4401b31440
commit ee49caa6d3
2 changed files with 6 additions and 0 deletions

View File

@ -7,5 +7,6 @@ namespace Interrupts
void disable();
bool is_in_handler();
void ensure_handler();
void return_from_handler(Context* context);
}

View File

@ -16,6 +16,11 @@ bool Interrupts::is_in_handler()
return __is_in_interrupt_handler;
}
void Interrupts::ensure_handler()
{
__is_in_interrupt_handler = true;
}
void Interrupts::return_from_handler(Context* context)
{
asm volatile("mov %0, %%rsp\n"