ata: read/write optimization - hardcode blocksize in transfer routines

It will always be 512 anyway, no need to hit memory for every loop iteration
This commit is contained in:
Matt Harlum 2025-01-07 00:47:07 +00:00
parent 4185bc5b8e
commit af771f9534

4
ata.c
View File

@ -604,7 +604,7 @@ BYTE ata_read(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
for (int i = 0; i < unit->multipleCount && txn_count; i++) {
ata_xfer((void *)unit->drive.data,buffer);
txn_count--;
buffer += unit->blockSize;
buffer += 512;
}
}
@ -691,7 +691,7 @@ BYTE ata_write(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
for (int i = 0; i < unit->multipleCount && txn_count; i++) {
ata_xfer(buffer,(void *)unit->drive.data);
txn_count--;
buffer += unit->blockSize;
buffer += 512;
}
}