Skip to content

Commit

Permalink
Remove extraneous delays and reduce status wait
Browse files Browse the repository at this point in the history
  • Loading branch information
LIV2 committed Dec 15, 2023
1 parent 38c22b9 commit d47b737
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static BYTE write_taskfile_chs(struct IDEUnit *unit, UBYTE command, ULONG lba, U
*/
static void __attribute__((always_inline)) ata_status_reg_delay(struct IDEUnit *unit) {
asm volatile (
".rep 6 \n\t"
".rep 4 \n\t"
"tst.l (%0) \n\t" // Use tst.l so we don't need to save/restore some other register
".endr \n\t"
:
Expand Down Expand Up @@ -69,7 +69,6 @@ static void ata_save_error(struct IDEUnit *unit) {
* @returns True if error is indicated
*/
static bool __attribute__((always_inline)) ata_check_error(struct IDEUnit *unit) {
ata_status_reg_delay(unit);
return (*unit->drive->status_command & (ata_flag_error | ata_flag_df));
}

Expand All @@ -84,8 +83,6 @@ static bool ata_wait_drq(struct IDEUnit *unit, ULONG tries) {
struct timerequest *tr = unit->itask->tr;
Info("wait_drq enter\n");

ata_status_reg_delay(unit);

for (int i=0; i < tries; i++) {
// Try a bunch of times before imposing the speed penalty of the timer...
for (int j=0; j<1000; j++) {
Expand Down

0 comments on commit d47b737

Please sign in to comment.