summaryrefslogtreecommitdiff
path: root/Kernel/Devices/HID
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-22 01:49:22 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-22 03:34:10 +0200
commitc922a7da090d57ed36cf8526e985b82ec3f4933f (patch)
treed4791565a1149af47eae4cb4470f875e0644f18c /Kernel/Devices/HID
parent55adace359bfda606b445b5177ce5138687d4626 (diff)
downloadserenity-c922a7da090d57ed36cf8526e985b82ec3f4933f.zip
Kernel: Rename ScopedSpinlock => SpinlockLocker
This matches MutexLocker, and doesn't sound like it's a lock itself.
Diffstat (limited to 'Kernel/Devices/HID')
-rw-r--r--Kernel/Devices/HID/I8042Controller.cpp6
-rw-r--r--Kernel/Devices/HID/I8042Controller.h12
-rw-r--r--Kernel/Devices/HID/KeyboardDevice.cpp4
-rw-r--r--Kernel/Devices/HID/MouseDevice.cpp4
-rw-r--r--Kernel/Devices/HID/PS2MouseDevice.cpp2
-rw-r--r--Kernel/Devices/HID/VMWareMouseDevice.cpp2
6 files changed, 15 insertions, 15 deletions
diff --git a/Kernel/Devices/HID/I8042Controller.cpp b/Kernel/Devices/HID/I8042Controller.cpp
index e9ee98a928..3f11b70560 100644
--- a/Kernel/Devices/HID/I8042Controller.cpp
+++ b/Kernel/Devices/HID/I8042Controller.cpp
@@ -35,7 +35,7 @@ UNMAP_AFTER_INIT void I8042Controller::detect_devices()
{
u8 configuration;
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
// Disable devices
do_wait_then_write(I8042_STATUS, 0xad);
do_wait_then_write(I8042_STATUS, 0xa7); // ignored if it doesn't exist
@@ -103,7 +103,7 @@ UNMAP_AFTER_INIT void I8042Controller::detect_devices()
m_first_port_available = false;
configuration &= ~1;
configuration |= 1 << 4;
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
do_wait_then_write(I8042_STATUS, 0x60);
do_wait_then_write(I8042_BUFFER, configuration);
}
@@ -116,7 +116,7 @@ UNMAP_AFTER_INIT void I8042Controller::detect_devices()
dbgln("I8042: Mouse device failed to initialize, disable");
m_second_port_available = false;
configuration |= 1 << 5;
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
do_wait_then_write(I8042_STATUS, 0x60);
do_wait_then_write(I8042_BUFFER, configuration);
}
diff --git a/Kernel/Devices/HID/I8042Controller.h b/Kernel/Devices/HID/I8042Controller.h
index e4983278cc..ab31ff55fa 100644
--- a/Kernel/Devices/HID/I8042Controller.h
+++ b/Kernel/Devices/HID/I8042Controller.h
@@ -53,36 +53,36 @@ public:
bool reset_device(HIDDevice::Type device)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
return do_reset_device(device);
}
u8 send_command(HIDDevice::Type device, u8 command)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
return do_send_command(device, command);
}
u8 send_command(HIDDevice::Type device, u8 command, u8 data)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
return do_send_command(device, command, data);
}
u8 read_from_device(HIDDevice::Type device)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
return do_read_from_device(device);
}
void wait_then_write(u8 port, u8 data)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
do_wait_then_write(port, data);
}
u8 wait_then_read(u8 port)
{
- ScopedSpinlock lock(m_lock);
+ SpinlockLocker lock(m_lock);
return do_wait_then_read(port);
}
diff --git a/Kernel/Devices/HID/KeyboardDevice.cpp b/Kernel/Devices/HID/KeyboardDevice.cpp
index ad81323c0e..85c5611d18 100644
--- a/Kernel/Devices/HID/KeyboardDevice.cpp
+++ b/Kernel/Devices/HID/KeyboardDevice.cpp
@@ -251,7 +251,7 @@ void KeyboardDevice::key_state_changed(u8 scan_code, bool pressed)
HIDManagement::the().m_client->on_key_pressed(event);
{
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
m_queue.enqueue(event);
}
@@ -281,7 +281,7 @@ bool KeyboardDevice::can_read(const FileDescription&, size_t) const
KResultOr<size_t> KeyboardDevice::read(FileDescription&, u64, UserOrKernelBuffer& buffer, size_t size)
{
size_t nread = 0;
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
while (nread < size) {
if (m_queue.is_empty())
break;
diff --git a/Kernel/Devices/HID/MouseDevice.cpp b/Kernel/Devices/HID/MouseDevice.cpp
index 1554335ba6..80c4a1ef73 100644
--- a/Kernel/Devices/HID/MouseDevice.cpp
+++ b/Kernel/Devices/HID/MouseDevice.cpp
@@ -20,7 +20,7 @@ MouseDevice::~MouseDevice()
bool MouseDevice::can_read(const FileDescription&, size_t) const
{
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
return !m_queue.is_empty();
}
@@ -29,7 +29,7 @@ KResultOr<size_t> MouseDevice::read(FileDescription&, u64, UserOrKernelBuffer& b
VERIFY(size > 0);
size_t nread = 0;
size_t remaining_space_in_buffer = static_cast<size_t>(size) - nread;
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
while (!m_queue.is_empty() && remaining_space_in_buffer) {
auto packet = m_queue.dequeue();
lock.unlock();
diff --git a/Kernel/Devices/HID/PS2MouseDevice.cpp b/Kernel/Devices/HID/PS2MouseDevice.cpp
index c6453f41c3..15dec13ae1 100644
--- a/Kernel/Devices/HID/PS2MouseDevice.cpp
+++ b/Kernel/Devices/HID/PS2MouseDevice.cpp
@@ -60,7 +60,7 @@ void PS2MouseDevice::irq_handle_byte_read(u8 byte)
m_entropy_source.add_random_event(m_data.dword);
{
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
m_queue.enqueue(parse_data_packet(m_data));
}
evaluate_block_conditions();
diff --git a/Kernel/Devices/HID/VMWareMouseDevice.cpp b/Kernel/Devices/HID/VMWareMouseDevice.cpp
index a2dab03e04..46ca4b3984 100644
--- a/Kernel/Devices/HID/VMWareMouseDevice.cpp
+++ b/Kernel/Devices/HID/VMWareMouseDevice.cpp
@@ -36,7 +36,7 @@ void VMWareMouseDevice::irq_handle_byte_read(u8)
if (mouse_packet.has_value()) {
m_entropy_source.add_random_event(mouse_packet.value());
{
- ScopedSpinlock lock(m_queue_lock);
+ SpinlockLocker lock(m_queue_lock);
m_queue.enqueue(mouse_packet.value());
}
evaluate_block_conditions();