mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58:11 +00:00
Kernel: Move the Storage directory to be a new directory under Devices
The Storage subsystem, like the Audio and HID subsystems, exposes Unix device files (for example, in the /dev directory). To ensure consistency across the repository, we should make the Storage subsystem to reside in the Kernel/Devices directory like the two other mentioned subsystems.
This commit is contained in:
parent
f3a58f3a5a
commit
500b7b08d6
59 changed files with 133 additions and 133 deletions
48
Kernel/Devices/Storage/StorageController.h
Normal file
48
Kernel/Devices/Storage/StorageController.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Devices/Device.h>
|
||||
#include <Kernel/Library/LockRefPtr.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Memory/PhysicalPage.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/Random.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class AsyncBlockDeviceRequest;
|
||||
class StorageDevice;
|
||||
class StorageController : public AtomicRefCounted<StorageController> {
|
||||
|
||||
public:
|
||||
virtual ~StorageController() = default;
|
||||
|
||||
virtual LockRefPtr<StorageDevice> device(u32 index) const = 0;
|
||||
virtual size_t devices_count() const = 0;
|
||||
|
||||
u32 controller_id() const { return m_controller_id; }
|
||||
u32 hardware_relative_controller_id() const { return m_hardware_relative_controller_id; }
|
||||
|
||||
protected:
|
||||
virtual ErrorOr<void> reset() = 0;
|
||||
virtual ErrorOr<void> shutdown() = 0;
|
||||
|
||||
virtual void complete_current_request(AsyncDeviceRequest::RequestResult) = 0;
|
||||
|
||||
explicit StorageController(u32 hardware_relative_controller_id);
|
||||
|
||||
private:
|
||||
u32 const m_controller_id { 0 };
|
||||
|
||||
u32 const m_hardware_relative_controller_id { 0 };
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue