Переглянути джерело

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.
Liav A 2 роки тому
батько
коміт
d8cbda6950

+ 5 - 2
Kernel/Arch/x86_64/ISABus/I8042Controller.h

@@ -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;
 };
 
 }

+ 0 - 1
Kernel/Devices/HID/Device.h

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