mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05: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: https://github.com/SerenityOS/serenity/commit/e880fe0765f 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";
|
||||
}
|
||||
|
||||
void DynamicParser::handle_irq(RegisterState&)
|
||||
void DynamicParser::handle_irq(const RegisterState&)
|
||||
{
|
||||
// FIXME: Implement IRQ handling of ACPI signals!
|
||||
ASSERT_NOT_REACHED();
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace ACPI {
|
|||
private:
|
||||
void build_namespace();
|
||||
// ^IRQHandler
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
OwnPtr<Region> m_acpi_namespace;
|
||||
};
|
||||
|
|
|
@ -348,7 +348,7 @@ bool FloppyDiskDevice::wait_for_irq()
|
|||
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
|
||||
m_interrupted = true;
|
||||
|
|
|
@ -179,7 +179,7 @@ protected:
|
|||
|
||||
private:
|
||||
// ^IRQHandler
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
// ^DiskDevice
|
||||
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;
|
||||
}
|
||||
|
||||
void KeyboardDevice::handle_irq(RegisterState&)
|
||||
void KeyboardDevice::handle_irq(const RegisterState&)
|
||||
{
|
||||
for (;;) {
|
||||
u8 status = IO::in8(I8042_STATUS);
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
private:
|
||||
// ^IRQHandler
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
// ^CharacterDevice
|
||||
virtual const char* class_name() const override { return "KeyboardDevice"; }
|
||||
|
|
|
@ -180,7 +180,7 @@ void PATAChannel::wait_for_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>();
|
||||
if (status & ATA_SR_ERR) {
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
private:
|
||||
//^ IRQHandler
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
void initialize(bool force_pio);
|
||||
void detect_disks();
|
||||
|
|
|
@ -130,7 +130,7 @@ void PS2MouseDevice::handle_vmmouse_absolute_pointer()
|
|||
m_queue.enqueue(packet);
|
||||
}
|
||||
|
||||
void PS2MouseDevice::handle_irq(RegisterState&)
|
||||
void PS2MouseDevice::handle_irq(const RegisterState&)
|
||||
{
|
||||
|
||||
if (VMWareBackdoor::the().vmmouse_is_absolute()) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
private:
|
||||
// ^IRQHandler
|
||||
void handle_vmmouse_absolute_pointer();
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
// ^CharacterDevice
|
||||
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));
|
||||
}
|
||||
|
||||
void SB16::handle_irq(RegisterState&)
|
||||
void SB16::handle_irq(const RegisterState&)
|
||||
{
|
||||
// Stop sound output ready for the next block.
|
||||
dsp_write(0xd5);
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
private:
|
||||
// ^IRQHandler
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
|
||||
// ^CharacterDevice
|
||||
virtual const char* class_name() const override { return "SB16"; }
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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&);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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&);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ E1000NetworkAdapter::~E1000NetworkAdapter()
|
|||
{
|
||||
}
|
||||
|
||||
void E1000NetworkAdapter::handle_irq(RegisterState&)
|
||||
void E1000NetworkAdapter::handle_irq(const RegisterState&)
|
||||
{
|
||||
out32(REG_IMASK, 0x1);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
virtual const char* purpose() const override { return class_name(); }
|
||||
|
||||
private:
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
virtual const char* class_name() const override { return "E1000NetworkAdapter"; }
|
||||
|
||||
struct [[gnu::packed]] e1000_rx_desc
|
||||
|
|
|
@ -177,7 +177,7 @@ RTL8139NetworkAdapter::~RTL8139NetworkAdapter()
|
|||
{
|
||||
}
|
||||
|
||||
void RTL8139NetworkAdapter::handle_irq(RegisterState&)
|
||||
void RTL8139NetworkAdapter::handle_irq(const RegisterState&)
|
||||
{
|
||||
for (;;) {
|
||||
int status = in16(REG_ISR);
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
virtual const char* purpose() const override { return class_name(); }
|
||||
|
||||
private:
|
||||
virtual void handle_irq(RegisterState&) override;
|
||||
virtual void handle_irq(const RegisterState&) override;
|
||||
virtual const char* class_name() const override { return "RTL8139NetworkAdapter"; }
|
||||
|
||||
void reset();
|
||||
|
|
|
@ -580,7 +580,7 @@ void Scheduler::initialize()
|
|||
load_task_register(s_redirection.selector);
|
||||
}
|
||||
|
||||
void Scheduler::timer_tick(RegisterState& regs)
|
||||
void Scheduler::timer_tick(const RegisterState& regs)
|
||||
{
|
||||
if (!Thread::current)
|
||||
return;
|
||||
|
|
|
@ -49,7 +49,7 @@ extern SchedulerData* g_scheduler_data;
|
|||
class Scheduler {
|
||||
public:
|
||||
static void initialize();
|
||||
static void timer_tick(RegisterState&);
|
||||
static void timer_tick(const RegisterState&);
|
||||
static bool pick_next();
|
||||
static void pick_next_and_switch_now();
|
||||
static void switch_now();
|
||||
|
|
Loading…
Add table
Reference in a new issue