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
Notes: sideshowbarker 2024-07-19 08:14:45 +09:00
26 changed files with 27 additions and 27 deletions

View file

@ -56,7 +56,7 @@ namespace ACPI {
klog() << "ACPI: Dynamic Parsing Enabled, Can parse AML"; klog() << "ACPI: Dynamic Parsing Enabled, Can parse AML";
} }
void DynamicParser::handle_irq(RegisterState&) void DynamicParser::handle_irq(const RegisterState&)
{ {
// FIXME: Implement IRQ handling of ACPI signals! // FIXME: Implement IRQ handling of ACPI signals!
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();

View file

@ -56,7 +56,7 @@ namespace ACPI {
private: private:
void build_namespace(); void build_namespace();
// ^IRQHandler // ^IRQHandler
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
OwnPtr<Region> m_acpi_namespace; OwnPtr<Region> m_acpi_namespace;
}; };

View file

@ -348,7 +348,7 @@ bool FloppyDiskDevice::wait_for_irq()
return true; return true;
} }
void FloppyDiskDevice::handle_irq(RegisterState&) void FloppyDiskDevice::handle_irq(const RegisterState&)
{ {
// The only thing we need to do is acknowledge the IRQ happened // The only thing we need to do is acknowledge the IRQ happened
m_interrupted = true; m_interrupted = true;

View file

@ -179,7 +179,7 @@ protected:
private: private:
// ^IRQHandler // ^IRQHandler
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
// ^DiskDevice // ^DiskDevice
virtual const char* class_name() const override; virtual const char* class_name() const override;

View file

@ -485,7 +485,7 @@ void KeyboardDevice::key_state_changed(u8 raw, bool pressed)
m_has_e0_prefix = false; m_has_e0_prefix = false;
} }
void KeyboardDevice::handle_irq(RegisterState&) void KeyboardDevice::handle_irq(const RegisterState&)
{ {
for (;;) { for (;;) {
u8 status = IO::in8(I8042_STATUS); u8 status = IO::in8(I8042_STATUS);

View file

@ -61,7 +61,7 @@ public:
private: private:
// ^IRQHandler // ^IRQHandler
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
// ^CharacterDevice // ^CharacterDevice
virtual const char* class_name() const override { return "KeyboardDevice"; } virtual const char* class_name() const override { return "KeyboardDevice"; }

View file

@ -180,7 +180,7 @@ void PATAChannel::wait_for_irq()
disable_irq(); disable_irq();
} }
void PATAChannel::handle_irq(RegisterState&) void PATAChannel::handle_irq(const RegisterState&)
{ {
u8 status = m_io_base.offset(ATA_REG_STATUS).in<u8>(); u8 status = m_io_base.offset(ATA_REG_STATUS).in<u8>();
if (status & ATA_SR_ERR) { if (status & ATA_SR_ERR) {

View file

@ -76,7 +76,7 @@ public:
private: private:
//^ IRQHandler //^ IRQHandler
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
void initialize(bool force_pio); void initialize(bool force_pio);
void detect_disks(); void detect_disks();

View file

@ -130,7 +130,7 @@ void PS2MouseDevice::handle_vmmouse_absolute_pointer()
m_queue.enqueue(packet); m_queue.enqueue(packet);
} }
void PS2MouseDevice::handle_irq(RegisterState&) void PS2MouseDevice::handle_irq(const RegisterState&)
{ {
if (VMWareBackdoor::the().vmmouse_is_absolute()) { if (VMWareBackdoor::the().vmmouse_is_absolute()) {

View file

@ -52,7 +52,7 @@ public:
private: private:
// ^IRQHandler // ^IRQHandler
void handle_vmmouse_absolute_pointer(); void handle_vmmouse_absolute_pointer();
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
// ^CharacterDevice // ^CharacterDevice
virtual const char* class_name() const override { return "PS2MouseDevice"; } virtual const char* class_name() const override { return "PS2MouseDevice"; }

View file

@ -207,7 +207,7 @@ void SB16::dma_start(uint32_t length)
IO::out8(0xd4, (channel % 4)); IO::out8(0xd4, (channel % 4));
} }
void SB16::handle_irq(RegisterState&) void SB16::handle_irq(const RegisterState&)
{ {
// Stop sound output ready for the next block. // Stop sound output ready for the next block.
dsp_write(0xd5); dsp_write(0xd5);

View file

@ -54,7 +54,7 @@ public:
private: private:
// ^IRQHandler // ^IRQHandler
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
// ^CharacterDevice // ^CharacterDevice
virtual const char* class_name() const override { return "SB16"; } virtual const char* class_name() const override { return "SB16"; }

View file

@ -44,7 +44,7 @@ class GenericInterruptHandler {
public: public:
static GenericInterruptHandler& from(u8 interrupt_number); static GenericInterruptHandler& from(u8 interrupt_number);
virtual ~GenericInterruptHandler(); 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; } u8 interrupt_number() const { return m_interrupt_number; }

View file

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

View file

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

View file

@ -39,7 +39,7 @@ class SharedIRQHandler final : public GenericInterruptHandler {
public: public:
static void initialize(u8 interrupt_number); static void initialize(u8 interrupt_number);
virtual ~SharedIRQHandler(); virtual ~SharedIRQHandler();
virtual void handle_interrupt(RegisterState& regs) override; virtual void handle_interrupt(const RegisterState& regs) override;
void register_handler(GenericInterruptHandler&); void register_handler(GenericInterruptHandler&);
void unregister_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. // 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(); klog() << "Spurious Interrupt, vector " << interrupt_number();

View file

@ -39,7 +39,7 @@ class SpuriousInterruptHandler final : public GenericInterruptHandler {
public: public:
static void initialize(u8 interrupt_number); static void initialize(u8 interrupt_number);
virtual ~SpuriousInterruptHandler(); virtual ~SpuriousInterruptHandler();
virtual void handle_interrupt(RegisterState& regs) override; virtual void handle_interrupt(const RegisterState& regs) override;
void register_handler(GenericInterruptHandler&); void register_handler(GenericInterruptHandler&);
void unregister_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&)."; dbg() << "Interrupt: Unhandled vector " << interrupt_number() << " was invoked for handle_interrupt(RegisterState&).";
hang(); hang();

View file

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

View file

@ -177,7 +177,7 @@ E1000NetworkAdapter::~E1000NetworkAdapter()
{ {
} }
void E1000NetworkAdapter::handle_irq(RegisterState&) void E1000NetworkAdapter::handle_irq(const RegisterState&)
{ {
out32(REG_IMASK, 0x1); out32(REG_IMASK, 0x1);

View file

@ -49,7 +49,7 @@ public:
virtual const char* purpose() const override { return class_name(); } virtual const char* purpose() const override { return class_name(); }
private: private:
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
virtual const char* class_name() const override { return "E1000NetworkAdapter"; } virtual const char* class_name() const override { return "E1000NetworkAdapter"; }
struct [[gnu::packed]] e1000_rx_desc struct [[gnu::packed]] e1000_rx_desc

View file

@ -177,7 +177,7 @@ RTL8139NetworkAdapter::~RTL8139NetworkAdapter()
{ {
} }
void RTL8139NetworkAdapter::handle_irq(RegisterState&) void RTL8139NetworkAdapter::handle_irq(const RegisterState&)
{ {
for (;;) { for (;;) {
int status = in16(REG_ISR); int status = in16(REG_ISR);

View file

@ -50,7 +50,7 @@ public:
virtual const char* purpose() const override { return class_name(); } virtual const char* purpose() const override { return class_name(); }
private: private:
virtual void handle_irq(RegisterState&) override; virtual void handle_irq(const RegisterState&) override;
virtual const char* class_name() const override { return "RTL8139NetworkAdapter"; } virtual const char* class_name() const override { return "RTL8139NetworkAdapter"; }
void reset(); void reset();

View file

@ -580,7 +580,7 @@ void Scheduler::initialize()
load_task_register(s_redirection.selector); load_task_register(s_redirection.selector);
} }
void Scheduler::timer_tick(RegisterState& regs) void Scheduler::timer_tick(const RegisterState& regs)
{ {
if (!Thread::current) if (!Thread::current)
return; return;

View file

@ -49,7 +49,7 @@ extern SchedulerData* g_scheduler_data;
class Scheduler { class Scheduler {
public: public:
static void initialize(); static void initialize();
static void timer_tick(RegisterState&); static void timer_tick(const RegisterState&);
static bool pick_next(); static bool pick_next();
static void pick_next_and_switch_now(); static void pick_next_and_switch_now();
static void switch_now(); static void switch_now();