summaryrefslogtreecommitdiff
path: root/Kernel/Devices/HID
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-22 12:21:31 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-23 00:02:09 +0200
commitd60635cb9df9b4e72702db02b88b26ab9123c2a8 (patch)
tree162105dee63773b68678c54d5a7f4016f7574c8f /Kernel/Devices/HID
parent3e3f760808e614ca70d97294013cb58f2a0deaf5 (diff)
downloadserenity-d60635cb9df9b4e72702db02b88b26ab9123c2a8.zip
Kernel: Convert Processor::in_irq() to static current_in_irq()
This closes the race window between Processor::current() and a context switch happening before in_irq().
Diffstat (limited to 'Kernel/Devices/HID')
-rw-r--r--Kernel/Devices/HID/I8042Controller.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Devices/HID/I8042Controller.cpp b/Kernel/Devices/HID/I8042Controller.cpp
index 3f11b70560..a55326ef92 100644
--- a/Kernel/Devices/HID/I8042Controller.cpp
+++ b/Kernel/Devices/HID/I8042Controller.cpp
@@ -132,7 +132,7 @@ UNMAP_AFTER_INIT void I8042Controller::detect_devices()
bool I8042Controller::irq_process_input_buffer(HIDDevice::Type)
{
- VERIFY(Processor::current().in_irq());
+ VERIFY(Processor::current_in_irq());
u8 status = IO::in8(I8042_STATUS);
if (!(status & I8042_BUFFER_FULL))
@@ -167,7 +167,7 @@ bool I8042Controller::do_reset_device(HIDDevice::Type device)
VERIFY(device != HIDDevice::Type::Unknown);
VERIFY(m_lock.is_locked());
- VERIFY(!Processor::current().in_irq());
+ VERIFY(!Processor::current_in_irq());
if (do_send_command(device, 0xff) != I8042_ACK)
return false;
// Wait until we get the self-test result
@@ -179,7 +179,7 @@ u8 I8042Controller::do_send_command(HIDDevice::Type device, u8 command)
VERIFY(device != HIDDevice::Type::Unknown);
VERIFY(m_lock.is_locked());
- VERIFY(!Processor::current().in_irq());
+ VERIFY(!Processor::current_in_irq());
return do_write_to_device(device, command);
}
@@ -189,7 +189,7 @@ u8 I8042Controller::do_send_command(HIDDevice::Type device, u8 command, u8 data)
VERIFY(device != HIDDevice::Type::Unknown);
VERIFY(m_lock.is_locked());
- VERIFY(!Processor::current().in_irq());
+ VERIFY(!Processor::current_in_irq());
u8 response = do_write_to_device(device, command);
if (response == I8042_ACK)
@@ -202,7 +202,7 @@ u8 I8042Controller::do_write_to_device(HIDDevice::Type device, u8 data)
VERIFY(device != HIDDevice::Type::Unknown);
VERIFY(m_lock.is_locked());
- VERIFY(!Processor::current().in_irq());
+ VERIFY(!Processor::current_in_irq());
int attempts = 0;
u8 response;