mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
Kernel: Make self-contained locking smart pointers their own classes
Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
This commit is contained in:
parent
e475263113
commit
11eee67b85
360 changed files with 1703 additions and 1672 deletions
|
@ -34,7 +34,7 @@ public:
|
|||
LowSpeed
|
||||
};
|
||||
|
||||
static ErrorOr<NonnullRefPtr<Device>> try_create(USBController const&, u8, DeviceSpeed);
|
||||
static ErrorOr<NonnullLockRefPtr<Device>> try_create(USBController const&, u8, DeviceSpeed);
|
||||
|
||||
Device(USBController const&, u8, DeviceSpeed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
Device(Device const& device, NonnullOwnPtr<Pipe> default_pipe);
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
SysFSUSBDeviceInformation& sysfs_device_info_node(Badge<USB::Hub>) { return *m_sysfs_device_info_node; }
|
||||
|
||||
protected:
|
||||
Device(NonnullRefPtr<USBController> controller, u8 address, u8 port, DeviceSpeed speed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
Device(NonnullLockRefPtr<USBController> controller, u8 address, u8 port, DeviceSpeed speed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
|
||||
u8 m_device_port { 0 }; // What port is this device attached to. NOTE: This is 1-based.
|
||||
DeviceSpeed m_device_speed; // What speed is this device running at
|
||||
|
@ -71,14 +71,14 @@ protected:
|
|||
USBDeviceDescriptor m_device_descriptor {}; // Device Descriptor obtained from USB Device
|
||||
Vector<USBConfiguration> m_configurations; // Configurations for this device
|
||||
|
||||
NonnullRefPtr<USBController> m_controller;
|
||||
NonnullLockRefPtr<USBController> m_controller;
|
||||
NonnullOwnPtr<Pipe> m_default_pipe; // Default communication pipe (endpoint0) used during enumeration
|
||||
|
||||
private:
|
||||
IntrusiveListNode<Device, NonnullRefPtr<Device>> m_hub_child_node;
|
||||
IntrusiveListNode<Device, NonnullLockRefPtr<Device>> m_hub_child_node;
|
||||
|
||||
protected:
|
||||
RefPtr<SysFSUSBDeviceInformation> m_sysfs_device_info_node;
|
||||
LockRefPtr<SysFSUSBDeviceInformation> m_sysfs_device_info_node;
|
||||
|
||||
public:
|
||||
using List = IntrusiveList<&Device::m_hub_child_node>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue