1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:18:12 +00:00

Kernel: Require lock rank for Spinlock construction

All users which relied on the default constructor use a None lock rank
for now. This will make it easier to in the future remove LockRank and
actually annotate the ranks by searching for None.
This commit is contained in:
kleines Filmröllchen 2022-08-18 21:46:28 +02:00 committed by Brian Gianforcaro
parent 4809dc8ec2
commit 4314c25cf2
59 changed files with 87 additions and 78 deletions

View file

@ -151,7 +151,7 @@ private:
WaitQueue m_queue;
NonnullRefPtr<Process> m_process;
void* m_private { nullptr };
mutable Spinlock m_lock;
mutable Spinlock m_lock { LockRank::None };
};
}

View file

@ -144,7 +144,7 @@ private:
private:
IOAddress m_channel_base;
AC97& m_device;
SpinlockProtected<bool> m_dma_running { false };
SpinlockProtected<bool> m_dma_running { LockRank::None, false };
StringView m_name;
};

View file

@ -14,7 +14,7 @@
// Output bytes to kernel debug port 0xE9 (Bochs console). It's very handy.
#define CONSOLE_OUT_TO_BOCHS_DEBUG_PORT
static Kernel::Spinlock g_console_lock;
static Kernel::Spinlock g_console_lock { LockRank::None };
UNMAP_AFTER_INIT NonnullRefPtr<ConsoleDevice> ConsoleDevice::must_create()
{

View file

@ -88,7 +88,7 @@ private:
State m_state { State::Normal };
Spinlock m_requests_lock;
Spinlock m_requests_lock { LockRank::None };
DoublyLinkedList<RefPtr<AsyncDeviceRequest>> m_requests;
protected:

View file

@ -74,9 +74,9 @@ private:
RefPtr<ConsoleDevice> m_console_device;
RefPtr<DeviceControlDevice> m_device_control_device;
// FIXME: Once we have a singleton for managing many sound cards, remove this from here
SpinlockProtected<HashMap<u64, Device*>> m_devices;
SpinlockProtected<HashMap<u64, Device*>> m_devices { LockRank::None };
mutable Spinlock m_event_queue_lock;
mutable Spinlock m_event_queue_lock { LockRank::None };
CircularQueue<DeviceEvent, 100> m_event_queue;
};

View file

@ -57,13 +57,13 @@ private:
size_t generate_minor_device_number_for_mouse();
size_t generate_minor_device_number_for_keyboard();
SpinlockProtected<KeymapData> m_keymap_data;
SpinlockProtected<KeymapData> m_keymap_data { LockRank::None };
size_t m_mouse_minor_number { 0 };
size_t m_keyboard_minor_number { 0 };
KeyboardClient* m_client { nullptr };
RefPtr<I8042Controller> m_i8042_controller;
NonnullRefPtrVector<HIDDevice> m_hid_devices;
Spinlock m_client_lock;
Spinlock m_client_lock { LockRank::None };
};
class KeyboardClient {

View file

@ -153,7 +153,7 @@ private:
void do_write(u8 port, u8 data);
u8 do_read(u8 port);
Spinlock m_lock;
Spinlock m_lock { LockRank::None };
bool m_first_port_available { false };
bool m_second_port_available { false };
bool m_is_dual_channel { false };

View file

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

View file

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

View file

@ -58,7 +58,7 @@ private:
// Here to ensure it's not garbage collected at the end of open()
OwnPtr<Memory::Region> m_kernel_region;
Spinlock m_lock;
Spinlock m_lock { LockRank::None };
};
}

View file

@ -130,7 +130,7 @@ private:
bool m_break_enable { false };
u8 m_modem_control { 0 };
bool m_last_put_char_was_carriage_return { false };
Spinlock m_serial_lock;
Spinlock m_serial_lock { LockRank::None };
};
}