diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-09-05 10:02:03 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-05 20:46:02 +0200 |
commit | bb58a4d94394ae19e0b850b15cfb105c91a1ee7b (patch) | |
tree | 95e33e16bd0685ff3a7e5f3c287be64cea0f7532 /Kernel/Devices | |
parent | 5905d2e9e9380f6c4d0fc370ba8271371e87e1d3 (diff) | |
download | serenity-bb58a4d94394ae19e0b850b15cfb105c91a1ee7b.zip |
Kernel: Make all Spinlocks use u8 for storage, remove template
The default template argument is only used in one place, and it
looks like it was probably just an oversight. The rest of the Kernel
code all uses u8 as the type. So lets make that the default and remove
the unused template argument, as there doesn't seem to be a reason to
allow the size to be customizable.
Diffstat (limited to 'Kernel/Devices')
-rw-r--r-- | Kernel/Devices/AsyncDeviceRequest.h | 4 | ||||
-rw-r--r-- | Kernel/Devices/Device.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/HID/I8042Controller.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/HID/KeyboardDevice.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/HID/MouseDevice.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/KCOVInstance.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/SerialDevice.h | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/Devices/AsyncDeviceRequest.h b/Kernel/Devices/AsyncDeviceRequest.h index 07e581fb1f..a67ddcd501 100644 --- a/Kernel/Devices/AsyncDeviceRequest.h +++ b/Kernel/Devices/AsyncDeviceRequest.h @@ -61,7 +61,7 @@ public: [[nodiscard]] RequestWaitResult wait(Time* = nullptr); - void do_start(SpinlockLocker<Spinlock<u8>>&& requests_lock) + void do_start(SpinlockLocker<Spinlock>&& requests_lock) { if (is_completed_result(m_result)) return; @@ -150,7 +150,7 @@ private: WaitQueue m_queue; NonnullRefPtr<Process> m_process; void* m_private { nullptr }; - mutable Spinlock<u8> m_lock; + mutable Spinlock m_lock; }; } diff --git a/Kernel/Devices/Device.h b/Kernel/Devices/Device.h index 3a3e8bcfdb..0011f4636e 100644 --- a/Kernel/Devices/Device.h +++ b/Kernel/Devices/Device.h @@ -72,7 +72,7 @@ private: UserID m_uid { 0 }; GroupID m_gid { 0 }; - Spinlock<u8> m_requests_lock; + Spinlock m_requests_lock; DoublyLinkedList<RefPtr<AsyncDeviceRequest>> m_requests; }; diff --git a/Kernel/Devices/HID/I8042Controller.h b/Kernel/Devices/HID/I8042Controller.h index ab31ff55fa..cc67b636ab 100644 --- a/Kernel/Devices/HID/I8042Controller.h +++ b/Kernel/Devices/HID/I8042Controller.h @@ -105,7 +105,7 @@ private: void do_wait_then_write(u8 port, u8 data); u8 do_wait_then_read(u8 port); - Spinlock<u8> m_lock; + Spinlock m_lock; bool m_first_port_available { false }; bool m_second_port_available { false }; bool m_is_dual_channel { false }; diff --git a/Kernel/Devices/HID/KeyboardDevice.h b/Kernel/Devices/HID/KeyboardDevice.h index 2a7fff18c7..cbb705b605 100644 --- a/Kernel/Devices/HID/KeyboardDevice.h +++ b/Kernel/Devices/HID/KeyboardDevice.h @@ -51,7 +51,7 @@ public: protected: KeyboardDevice(); - mutable Spinlock<u8> m_queue_lock; + mutable Spinlock m_queue_lock; CircularQueue<Event, 16> m_queue; // ^CharacterDevice virtual StringView class_name() const override { return "KeyboardDevice"; } diff --git a/Kernel/Devices/HID/MouseDevice.h b/Kernel/Devices/HID/MouseDevice.h index 1c2eaee488..ad1c94cbe6 100644 --- a/Kernel/Devices/HID/MouseDevice.h +++ b/Kernel/Devices/HID/MouseDevice.h @@ -41,7 +41,7 @@ protected: // ^CharacterDevice virtual StringView class_name() const override { return "MouseDevice"; } - mutable Spinlock<u8> m_queue_lock; + mutable Spinlock m_queue_lock; CircularQueue<MousePacket, 100> m_queue; }; diff --git a/Kernel/Devices/KCOVInstance.h b/Kernel/Devices/KCOVInstance.h index 393c9ad078..8a5ecfc86b 100644 --- a/Kernel/Devices/KCOVInstance.h +++ b/Kernel/Devices/KCOVInstance.h @@ -35,7 +35,7 @@ public: bool has_buffer() const { return m_buffer != nullptr; } void buffer_add_pc(u64 pc); - Spinlock<u8> lock; + Spinlock lock; enum { UNUSED = 0, OPENED = 1, diff --git a/Kernel/Devices/SerialDevice.h b/Kernel/Devices/SerialDevice.h index 6daf8fea34..81aedfd8ce 100644 --- a/Kernel/Devices/SerialDevice.h +++ b/Kernel/Devices/SerialDevice.h @@ -133,7 +133,7 @@ private: bool m_break_enable { false }; u8 m_modem_control { 0 }; bool m_last_put_char_was_carriage_return { false }; - Spinlock<u8> m_serial_lock; + Spinlock m_serial_lock; }; } |