diff options
author | Liav A <liavalb@gmail.com> | 2022-03-19 11:55:55 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-03-19 13:41:06 +0000 |
commit | 462618b68c0b11d169262c30e4cdad9e4065f059 (patch) | |
tree | 7adca89ba83740bc883cf4b589bab44dc29ec941 /Kernel/Storage/Ramdisk/Device.h | |
parent | f5acef0b81690232efb4ea8c7a7701c2aadf2e79 (diff) | |
download | serenity-462618b68c0b11d169262c30e4cdad9e4065f059.zip |
Kernel/Storage: Move Ramdisk code into a separate subdirectory
Diffstat (limited to 'Kernel/Storage/Ramdisk/Device.h')
-rw-r--r-- | Kernel/Storage/Ramdisk/Device.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Kernel/Storage/Ramdisk/Device.h b/Kernel/Storage/Ramdisk/Device.h new file mode 100644 index 0000000000..7d611cfdc9 --- /dev/null +++ b/Kernel/Storage/Ramdisk/Device.h @@ -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 NonnullRefPtr<RamdiskDevice> create(const RamdiskController&, NonnullOwnPtr<Memory::Region>&& region, int major, int minor); + virtual ~RamdiskDevice() override; + + // ^DiskDevice + virtual StringView class_name() const override; + +private: + RamdiskDevice(const RamdiskController&, NonnullOwnPtr<Memory::Region>&&, int major, int minor, NonnullOwnPtr<KString> device_name); + + // ^BlockDevice + virtual void start_request(AsyncBlockDeviceRequest&) override; + + // ^StorageDevice + virtual CommandSet command_set() const override { return CommandSet::PlainMemory; } + + Mutex m_lock { "RamdiskDevice" }; + + NonnullOwnPtr<Memory::Region> m_region; +}; + +} |