mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +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:
parent
d76c08c9b0
commit
d8cbda6950
2 changed files with 5 additions and 3 deletions
|
@ -67,11 +67,14 @@ enum I8042Response : u8 {
|
||||||
};
|
};
|
||||||
|
|
||||||
class I8042Controller;
|
class I8042Controller;
|
||||||
|
class PS2KeyboardDevice;
|
||||||
|
class PS2MouseDevice;
|
||||||
class I8042Device {
|
class I8042Device {
|
||||||
public:
|
public:
|
||||||
virtual ~I8042Device() = default;
|
virtual ~I8042Device() = default;
|
||||||
|
|
||||||
virtual void irq_handle_byte_read(u8 byte) = 0;
|
virtual void irq_handle_byte_read(u8 byte) = 0;
|
||||||
|
virtual void enable_interrupts() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit I8042Device(I8042Controller const& ps2_controller)
|
explicit I8042Device(I8042Controller const& ps2_controller)
|
||||||
|
@ -156,8 +159,8 @@ private:
|
||||||
bool m_first_port_available { false };
|
bool m_first_port_available { false };
|
||||||
bool m_second_port_available { false };
|
bool m_second_port_available { false };
|
||||||
bool m_is_dual_channel { false };
|
bool m_is_dual_channel { false };
|
||||||
LockRefPtr<MouseDevice> m_mouse_device;
|
LockRefPtr<PS2MouseDevice> m_mouse_device;
|
||||||
LockRefPtr<KeyboardDevice> m_keyboard_device;
|
LockRefPtr<PS2KeyboardDevice> m_keyboard_device;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual Type instrument_type() const = 0;
|
virtual Type instrument_type() const = 0;
|
||||||
virtual void enable_interrupts() = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HIDDevice(MajorNumber major, MinorNumber minor)
|
HIDDevice(MajorNumber major, MinorNumber minor)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue