1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:37:34 +00:00

Kernel: Move HIDDevice::enable_interrupts method to I8042Device class

It happens to be that only PS/2 devices that are connected via the i8042
controller can generate interrupt events, so it makes much more sense to
have those devices to implement the enable_interrupts method because of
the I8042Device class and not the HIDDevice class.
This commit is contained in:
Liav A 2022-12-20 08:17:25 +02:00 committed by Jelle Raaijmakers
parent d76c08c9b0
commit d8cbda6950
2 changed files with 5 additions and 3 deletions

View file

@ -67,11 +67,14 @@ enum I8042Response : u8 {
};
class I8042Controller;
class PS2KeyboardDevice;
class PS2MouseDevice;
class I8042Device {
public:
virtual ~I8042Device() = default;
virtual void irq_handle_byte_read(u8 byte) = 0;
virtual void enable_interrupts() = 0;
protected:
explicit I8042Device(I8042Controller const& ps2_controller)
@ -156,8 +159,8 @@ private:
bool m_first_port_available { false };
bool m_second_port_available { false };
bool m_is_dual_channel { false };
LockRefPtr<MouseDevice> m_mouse_device;
LockRefPtr<KeyboardDevice> m_keyboard_device;
LockRefPtr<PS2MouseDevice> m_mouse_device;
LockRefPtr<PS2KeyboardDevice> m_keyboard_device;
};
}

View file

@ -20,7 +20,6 @@ public:
};
virtual Type instrument_type() const = 0;
virtual void enable_interrupts() = 0;
protected:
HIDDevice(MajorNumber major, MinorNumber minor)