mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +00:00
Revert "Kernel/Storage: Remove the ramdisk implementation"
This reverts commit 4e0f85432a
as the
ramdisk code is useful for the bring-up of the aarch64 port. Once the
kernel supports better ram-based filesystems, this code will be removed
again.
This commit is contained in:
parent
4d68dcfca0
commit
187723776a
9 changed files with 227 additions and 0 deletions
41
Kernel/Storage/Ramdisk/Device.h
Normal file
41
Kernel/Storage/Ramdisk/Device.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Storage/StorageDevice.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class RamdiskController;
|
||||
|
||||
class RamdiskDevice final : public StorageDevice {
|
||||
friend class RamdiskController;
|
||||
friend class DeviceManagement;
|
||||
|
||||
public:
|
||||
static NonnullLockRefPtr<RamdiskDevice> create(RamdiskController const&, NonnullOwnPtr<Memory::Region>&& region, int major, int minor);
|
||||
virtual ~RamdiskDevice() override;
|
||||
|
||||
// ^DiskDevice
|
||||
virtual StringView class_name() const override;
|
||||
|
||||
private:
|
||||
RamdiskDevice(RamdiskController const&, NonnullOwnPtr<Memory::Region>&&, int major, int minor);
|
||||
|
||||
// ^BlockDevice
|
||||
virtual void start_request(AsyncBlockDeviceRequest&) override;
|
||||
|
||||
// ^StorageDevice
|
||||
virtual CommandSet command_set() const override { return CommandSet::PlainMemory; }
|
||||
|
||||
Mutex m_lock { "RamdiskDevice"sv };
|
||||
|
||||
NonnullOwnPtr<Memory::Region> m_region;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue