1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

IDEDiskDevice: Support reading multiple sectors at a time with DMA.

This is another sizable improvement to GCC compile times.
This commit is contained in:
Andreas Kling 2019-05-19 04:40:30 +02:00
parent ed79116e94
commit c7d8aa6969
4 changed files with 27 additions and 14 deletions

View file

@ -15,12 +15,8 @@ bool DiskDevice::read(DiskOffset offset, unsigned length, byte* out) const
dword first_block = offset / block_size();
dword end_block = (offset + length) / block_size();
byte* outptr = out;
for (unsigned bi = first_block; bi < end_block; ++bi) {
if (!read_block(bi, outptr))
return false;
outptr += block_size();
}
return true;
return const_cast<DiskDevice*>(this)->read_blocks(first_block, end_block - first_block, outptr);
}
bool DiskDevice::write(DiskOffset offset, unsigned length, const byte* in)