mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Kernel: Add a method to check the type of a StorageController
Also, the device method in the StorageController class is public now.
This commit is contained in:
parent
28599af387
commit
e3b3805abf
Notes:
sideshowbarker
2024-07-19 00:42:17 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/e3b3805abfe Pull-request: https://github.com/SerenityOS/serenity/pull/4462
2 changed files with 8 additions and 1 deletions
|
@ -44,6 +44,7 @@ public:
|
|||
static NonnullRefPtr<IDEController> initialize(PCI::Address address, bool force_pio);
|
||||
virtual ~IDEController() override;
|
||||
|
||||
virtual Type type() const override { return Type::IDE; }
|
||||
virtual RefPtr<StorageDevice> device(u32 index) override;
|
||||
virtual bool reset() override;
|
||||
virtual bool shutdown() override;
|
||||
|
|
|
@ -46,13 +46,19 @@ class StorageController : public RefCounted<StorageController>
|
|||
, public PCI::DeviceController {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
enum class Type : u8 {
|
||||
IDE,
|
||||
NVMe
|
||||
};
|
||||
virtual Type type() const = 0;
|
||||
virtual RefPtr<StorageDevice> device(u32 index) = 0;
|
||||
|
||||
protected:
|
||||
explicit StorageController(PCI::Address address)
|
||||
: PCI::DeviceController(address)
|
||||
{
|
||||
}
|
||||
|
||||
virtual RefPtr<StorageDevice> device(u32 index) = 0;
|
||||
virtual void start_request(const StorageDevice&, AsyncBlockDeviceRequest&) = 0;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue