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

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.
This commit is contained in:
Brian Gianforcaro 2021-09-05 10:02:03 -07:00 committed by Andreas Kling
parent 5905d2e9e9
commit bb58a4d943
38 changed files with 56 additions and 58 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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,

View file

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