1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 19:45:08 +00:00
serenity/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.h
kleines Filmröllchen 4314c25cf2 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.
2022-08-19 20:26:47 -07:00

33 lines
845 B
C++

/*
* Copyright (c) 2021-2022, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Badge.h>
#include <Kernel/Bus/USB/USBDevice.h>
#include <Kernel/Bus/USB/USBHub.h>
#include <Kernel/FileSystem/SysFS/Component.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.h>
#include <Kernel/Locking/Spinlock.h>
namespace Kernel {
class SysFSUSBBusDirectory final : public SysFSDirectory {
public:
static void initialize();
static SysFSUSBBusDirectory& the();
virtual StringView name() const override { return "usb"sv; }
void plug(Badge<USB::Hub>, SysFSUSBDeviceInformation&);
void unplug(Badge<USB::Hub>, SysFSUSBDeviceInformation&);
private:
explicit SysFSUSBBusDirectory(SysFSBusDirectory&);
mutable Spinlock m_lock { LockRank::None };
};
}