1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

Kernel/USB: Split SysFS code into its own file

This makes it controller agnostic and allows us to access it from the
USB hub code.

The copyright says "Liav A." because git blame says he wrote this.
This commit is contained in:
Luke 2021-08-14 04:31:00 +01:00 committed by Andreas Kling
parent b6a2bbba3b
commit 872c75ac44
5 changed files with 187 additions and 150 deletions

View file

@ -6,6 +6,7 @@
#include <AK/Singleton.h>
#include <Kernel/Bus/PCI/Access.h>
#include <Kernel/Bus/USB/SysFSUSB.h>
#include <Kernel/Bus/USB/UHCIController.h>
#include <Kernel/Bus/USB/USBManagement.h>
#include <Kernel/CommandLine.h>
@ -14,6 +15,7 @@
namespace Kernel::USB {
static Singleton<USBManagement> s_the;
READONLY_AFTER_INIT bool s_initialized_sys_fs_directory = false;
UNMAP_AFTER_INIT USBManagement::USBManagement()
{
@ -64,6 +66,11 @@ bool USBManagement::initialized()
UNMAP_AFTER_INIT void USBManagement::initialize()
{
if (!s_initialized_sys_fs_directory) {
USB::SysFSUSBBusDirectory::initialize();
s_initialized_sys_fs_directory = true;
}
s_the.ensure_instance();
}