mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Kernel/riscv64: Only enable interrupts in trap handler if they were on
Always enabling interrupts is in hindsight obviously a bug, as trapping code that has interrupts disabled very likely expects that they stay disabled.
This commit is contained in:
parent
6a223c6210
commit
1a312f4265
Notes:
sideshowbarker
2024-07-17 06:40:35 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/1a312f4265 Pull-request: https://github.com/SerenityOS/serenity/pull/23387 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ extern "C" void trap_handler(TrapFrame& trap_frame)
|
|||
// Exception
|
||||
|
||||
Processor::current().enter_trap(trap_frame, false);
|
||||
Processor::enable_interrupts();
|
||||
if (trap_frame.regs->sstatus.SPIE == 1)
|
||||
Processor::enable_interrupts();
|
||||
|
||||
using enum RISCV64::CSR::SCAUSE;
|
||||
switch (scause) {
|
||||
|
|
Loading…
Reference in a new issue