1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

Kernel: Merge unnecessary DiskDevice class into BlockDevice

This commit is contained in:
Andreas Kling 2020-02-08 02:17:26 +01:00
parent 6be880bd10
commit 88ea152b24
27 changed files with 98 additions and 212 deletions

View file

@ -110,7 +110,7 @@ const char* FloppyDiskDevice::class_name() const
FloppyDiskDevice::FloppyDiskDevice(FloppyDiskDevice::DriveType type)
: IRQHandler(IRQ_FLOPPY_DRIVE)
, DiskDevice(89, (type == FloppyDiskDevice::DriveType::Master) ? 0 : 1, BYTES_PER_SECTOR)
, BlockDevice(89, (type == FloppyDiskDevice::DriveType::Master) ? 0 : 1, BYTES_PER_SECTOR)
, m_io_base_addr((type == FloppyDiskDevice::DriveType::Master) ? 0x3F0 : 0x370)
{
initialize();
@ -120,16 +120,6 @@ FloppyDiskDevice::~FloppyDiskDevice()
{
}
bool FloppyDiskDevice::read_block(unsigned index, u8* data) const
{
return const_cast<FloppyDiskDevice*>(this)->read_blocks(index, 1, data);
}
bool FloppyDiskDevice::write_block(unsigned index, const u8* data)
{
return write_sectors_with_dma(index, 1, data);
}
bool FloppyDiskDevice::read_blocks(unsigned index, u16 count, u8* data)
{
return read_sectors_with_dma(index, count, data);