1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 20:15:11 +00:00
serenity/Kernel/Storage/Ramdisk/Device.h
Liav A c3eaa73113 Kernel/Storage: Remove InterfaceType enum
This enum was created to help put distinction between the commandset and
the interface type, as ATAPI devices are simply ATA devices utilizing
the SCSI commandset. Because we don't support ATAPI, putting such type
of distinction is pointless, so let's remove this for now.
2022-08-14 01:09:03 +01:00

41 lines
1 KiB
C++

/*
* 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(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, 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"sv };
NonnullOwnPtr<Memory::Region> m_region;
};
}