2022-04-22 12:46:19 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/Registry.h>
|
2022-04-22 15:51:45 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/CharacterDevicesDirectory.h>
|
2022-04-22 12:46:19 +03:00
|
|
|
#include <Kernel/Sections.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2022-04-23 00:26:36 +03:00
|
|
|
static SysFSCharacterDevicesDirectory* s_the { nullptr };
|
|
|
|
|
|
2022-08-19 20:53:40 +02:00
|
|
|
NonnullLockRefPtr<SysFSCharacterDevicesDirectory> SysFSCharacterDevicesDirectory::must_create(SysFSDeviceIdentifiersDirectory const& devices_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
{
|
2022-08-19 20:53:40 +02:00
|
|
|
return adopt_lock_ref_if_nonnull(new SysFSCharacterDevicesDirectory(devices_directory)).release_nonnull();
|
2022-04-22 12:46:19 +03:00
|
|
|
}
|
2022-04-22 15:51:45 +03:00
|
|
|
SysFSCharacterDevicesDirectory::SysFSCharacterDevicesDirectory(SysFSDeviceIdentifiersDirectory const& devices_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
: SysFSDirectory(devices_directory)
|
|
|
|
|
{
|
2022-04-23 00:26:36 +03:00
|
|
|
s_the = this;
|
2022-04-22 12:46:19 +03:00
|
|
|
}
|
|
|
|
|
|
2022-04-23 00:26:36 +03:00
|
|
|
SysFSCharacterDevicesDirectory& SysFSCharacterDevicesDirectory::the()
|
|
|
|
|
{
|
|
|
|
|
VERIFY(s_the);
|
|
|
|
|
return *s_the;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-22 12:46:19 +03:00
|
|
|
}
|