1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:37:44 +00:00

Kernel: Rename SpinLock => Spinlock

This commit is contained in:
Andreas Kling 2021-08-22 01:37:17 +02:00
parent 7d5d26b048
commit 55adace359
110 changed files with 491 additions and 491 deletions

View file

@ -15,7 +15,7 @@
#include <Kernel/API/KeyCode.h>
#include <Kernel/API/MousePacket.h>
#include <Kernel/KResult.h>
#include <Kernel/Locking/SpinLock.h>
#include <Kernel/Locking/Spinlock.h>
#include <Kernel/UnixTypes.h>
#include <LibKeyboard/CharacterMap.h>

View file

@ -35,7 +35,7 @@ UNMAP_AFTER_INIT void I8042Controller::detect_devices()
{
u8 configuration;
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock lock(m_lock);
do_wait_then_write(I8042_STATUS, 0x60);
do_wait_then_write(I8042_BUFFER, configuration);
}

View file

@ -9,7 +9,7 @@
#include <AK/RefCounted.h>
#include <Kernel/Devices/HID/KeyboardDevice.h>
#include <Kernel/Devices/HID/MouseDevice.h>
#include <Kernel/Locking/SpinLock.h>
#include <Kernel/Locking/Spinlock.h>
namespace Kernel {
@ -53,36 +53,36 @@ public:
bool reset_device(HIDDevice::Type device)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
return do_reset_device(device);
}
u8 send_command(HIDDevice::Type device, u8 command)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
return do_send_command(device, command);
}
u8 send_command(HIDDevice::Type device, u8 command, u8 data)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
return do_send_command(device, command, data);
}
u8 read_from_device(HIDDevice::Type device)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
return do_read_from_device(device);
}
void wait_then_write(u8 port, u8 data)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
do_wait_then_write(port, data);
}
u8 wait_then_read(u8 port)
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock lock(m_lock);
return do_wait_then_read(port);
}
@ -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<u8> m_lock;
bool m_first_port_available { false };
bool m_second_port_available { false };
bool m_is_dual_channel { false };

View file

@ -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);
ScopedSpinlock 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);
ScopedSpinlock lock(m_queue_lock);
while (nread < size) {
if (m_queue.is_empty())
break;

View file

@ -51,7 +51,7 @@ public:
protected:
KeyboardDevice();
mutable SpinLock<u8> m_queue_lock;
mutable Spinlock<u8> m_queue_lock;
CircularQueue<Event, 16> m_queue;
// ^CharacterDevice
virtual StringView class_name() const override { return "KeyboardDevice"; }

View file

@ -20,7 +20,7 @@ MouseDevice::~MouseDevice()
bool MouseDevice::can_read(const FileDescription&, size_t) const
{
ScopedSpinLock lock(m_queue_lock);
ScopedSpinlock 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);
ScopedSpinlock lock(m_queue_lock);
while (!m_queue.is_empty() && remaining_space_in_buffer) {
auto packet = m_queue.dequeue();
lock.unlock();

View file

@ -41,7 +41,7 @@ protected:
// ^CharacterDevice
virtual StringView class_name() const override { return "MouseDevice"; }
mutable SpinLock<u8> m_queue_lock;
mutable Spinlock<u8> m_queue_lock;
CircularQueue<MousePacket, 100> m_queue;
};

View file

@ -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);
ScopedSpinlock lock(m_queue_lock);
m_queue.enqueue(parse_data_packet(m_data));
}
evaluate_block_conditions();

View file

@ -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);
ScopedSpinlock lock(m_queue_lock);
m_queue.enqueue(mouse_packet.value());
}
evaluate_block_conditions();