1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

Kernel: Use a const reference to RegisterState in IRQ handling

This commit is contained in:
Liav A 2020-03-09 16:24:29 +02:00 committed by Andreas Kling
parent aa43314e8b
commit e880fe0765
26 changed files with 27 additions and 27 deletions

View file

@ -44,7 +44,7 @@ class GenericInterruptHandler {
public:
static GenericInterruptHandler& from(u8 interrupt_number);
virtual ~GenericInterruptHandler();
virtual void handle_interrupt(RegisterState& regs) = 0;
virtual void handle_interrupt(const RegisterState& regs) = 0;
u8 interrupt_number() const { return m_interrupt_number; }

View file

@ -39,8 +39,8 @@ class IRQHandler : public GenericInterruptHandler {
public:
virtual ~IRQHandler();
virtual void handle_interrupt(RegisterState& regs) { handle_irq(regs); }
virtual void handle_irq(RegisterState&) = 0;
virtual void handle_interrupt(const RegisterState& regs) { handle_irq(regs); }
virtual void handle_irq(const RegisterState&) = 0;
void enable_irq();
void disable_irq();

View file

@ -84,7 +84,7 @@ SharedIRQHandler::~SharedIRQHandler()
disable_interrupt_vector();
}
void SharedIRQHandler::handle_interrupt(RegisterState& regs)
void SharedIRQHandler::handle_interrupt(const RegisterState& regs)
{
ASSERT_INTERRUPTS_DISABLED();
increment_invoking_counter();

View file

@ -39,7 +39,7 @@ class SharedIRQHandler final : public GenericInterruptHandler {
public:
static void initialize(u8 interrupt_number);
virtual ~SharedIRQHandler();
virtual void handle_interrupt(RegisterState& regs) override;
virtual void handle_interrupt(const RegisterState& regs) override;
void register_handler(GenericInterruptHandler&);
void unregister_handler(GenericInterruptHandler&);

View file

@ -59,7 +59,7 @@ SpuriousInterruptHandler::~SpuriousInterruptHandler()
{
}
void SpuriousInterruptHandler::handle_interrupt(RegisterState&)
void SpuriousInterruptHandler::handle_interrupt(const RegisterState&)
{
// FIXME: Actually check if IRQ7 or IRQ15 are spurious, and if not, call the real handler to handle the IRQ.
klog() << "Spurious Interrupt, vector " << interrupt_number();

View file

@ -39,7 +39,7 @@ class SpuriousInterruptHandler final : public GenericInterruptHandler {
public:
static void initialize(u8 interrupt_number);
virtual ~SpuriousInterruptHandler();
virtual void handle_interrupt(RegisterState& regs) override;
virtual void handle_interrupt(const RegisterState& regs) override;
void register_handler(GenericInterruptHandler&);
void unregister_handler(GenericInterruptHandler&);

View file

@ -32,7 +32,7 @@ UnhandledInterruptHandler::UnhandledInterruptHandler(u8 interrupt_vector)
{
}
void UnhandledInterruptHandler::handle_interrupt(RegisterState&)
void UnhandledInterruptHandler::handle_interrupt(const RegisterState&)
{
dbg() << "Interrupt: Unhandled vector " << interrupt_number() << " was invoked for handle_interrupt(RegisterState&).";
hang();

View file

@ -37,7 +37,7 @@ public:
explicit UnhandledInterruptHandler(u8 interrupt_vector);
virtual ~UnhandledInterruptHandler();
virtual void handle_interrupt(RegisterState&) override;
virtual void handle_interrupt(const RegisterState&) override;
virtual bool eoi() override;