mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
CPU: Simplify handle_interrupt() function
This commit is contained in:
parent
800a46ace9
commit
86395810a9
1 changed files with 7 additions and 9 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <Kernel/Interrupts/IRQHandler.h>
|
#include <Kernel/Interrupts/IRQHandler.h>
|
||||||
#include <Kernel/Interrupts/InterruptManagement.h>
|
#include <Kernel/Interrupts/InterruptManagement.h>
|
||||||
#include <Kernel/Interrupts/SharedIRQHandler.h>
|
#include <Kernel/Interrupts/SharedIRQHandler.h>
|
||||||
|
#include <Kernel/Interrupts/SpuriousInterruptHandler.h>
|
||||||
#include <Kernel/Interrupts/UnhandledInterruptHandler.h>
|
#include <Kernel/Interrupts/UnhandledInterruptHandler.h>
|
||||||
#include <Kernel/KSyms.h>
|
#include <Kernel/KSyms.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
|
@ -245,7 +246,8 @@ void page_fault_handler(RegisterState regs)
|
||||||
|
|
||||||
#ifdef PAGE_FAULT_DEBUG
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
u32 fault_page_directory = read_cr3();
|
u32 fault_page_directory = read_cr3();
|
||||||
dbg() << (current ? Process::current->name().characters() : "(none)") << "(" << (current ? Process::current->pid() : 0) << "): ring" << (regs.cs & 3) << " " << (regs.exception_code & 1 ? "PV" : "NP") << " page fault in PD=" << String::format("%x", fault_page_directory) << ", " << (regs.exception_code & 8 ? "reserved-bit " : "") << regs.exception_code & 2 ? "write" : "read" <<" V" << String::format("%08x", fault_address);
|
dbg() << (current ? Process::current->name().characters() : "(none)") << "(" << (current ? Process::current->pid() : 0) << "): ring" << (regs.cs & 3) << " " << (regs.exception_code & 1 ? "PV" : "NP") << " page fault in PD=" << String::format("%x", fault_page_directory) << ", " << (regs.exception_code & 8 ? "reserved-bit " : "") << regs.exception_code & 2 ? "write" : "read"
|
||||||
|
<< " V" << String::format("%08x", fault_address);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PAGE_FAULT_DEBUG
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
|
@ -661,14 +663,10 @@ void handle_interrupt(RegisterState regs)
|
||||||
++g_in_irq;
|
++g_in_irq;
|
||||||
ASSERT(regs.isr_number >= 0x50 && regs.isr_number <= 0x5f);
|
ASSERT(regs.isr_number >= 0x50 && regs.isr_number <= 0x5f);
|
||||||
u8 irq = (u8)(regs.isr_number - 0x50);
|
u8 irq = (u8)(regs.isr_number - 0x50);
|
||||||
if (s_interrupt_handler[irq]) {
|
ASSERT(s_interrupt_handler[irq]);
|
||||||
s_interrupt_handler[irq]->handle_interrupt(regs);
|
s_interrupt_handler[irq]->handle_interrupt(regs);
|
||||||
s_interrupt_handler[irq]->increment_invoking_counter();
|
s_interrupt_handler[irq]->increment_invoking_counter();
|
||||||
s_interrupt_handler[irq]->eoi();
|
s_interrupt_handler[irq]->eoi();
|
||||||
} else {
|
|
||||||
dbg() << "No IRQ " << irq << " Handler installed!";
|
|
||||||
hang();
|
|
||||||
}
|
|
||||||
--g_in_irq;
|
--g_in_irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue