mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 10:18:51 +00:00
Kernel: Use a const reference to RegisterState in IRQ handling
This commit is contained in:
parent
aa43314e8b
commit
e880fe0765
Notes:
sideshowbarker
2024-07-19 08:14:45 +09:00
Author: https://github.com/supercomputer7
Commit: e880fe0765
Pull-request: https://github.com/SerenityOS/serenity/pull/1396
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/shannonbooth ✅
26 changed files with 27 additions and 27 deletions
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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"; }
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
|
@ -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"; }
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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"; }
|
||||||
|
|
|
@ -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; }
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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&);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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&);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue