1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00
serenity/Kernel/Devices/DiskDevice.h
Andreas Kling ebf645d72a Kernel: Tidy up IDEDiskDevice a bit.
The main cleanup here is putting the I/O address base in a member variable.
2019-05-24 04:17:15 +02:00

26 lines
727 B
C++

#pragma once
#include <AK/Retainable.h>
#include <AK/Types.h>
// FIXME: Support 64-bit DiskOffset
typedef dword DiskOffset;
class DiskDevice : public Retainable<DiskDevice> {
public:
virtual ~DiskDevice();
virtual unsigned block_size() const = 0;
virtual bool read_block(unsigned index, byte*) const = 0;
virtual bool write_block(unsigned index, const byte*) = 0;
virtual const char* class_name() const = 0;
bool read(DiskOffset, unsigned length, byte*) const;
bool write(DiskOffset, unsigned length, const byte*);
virtual bool read_blocks(unsigned index, word count, byte*) = 0;
virtual bool write_blocks(unsigned index, word count, const byte*) = 0;
protected:
DiskDevice();
};