diff options
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 9a0476f5cc..349ba077dd 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -310,7 +310,8 @@ static void copy_read_sectors(unsigned char* buf, int wordcount) | |||
310 | #endif | 310 | #endif |
311 | } | 311 | } |
312 | 312 | ||
313 | int ata_read_sectors(unsigned long start, | 313 | int ata_read_sectors(IF_MV((int drive,)) |
314 | unsigned long start, | ||
314 | int incount, | 315 | int incount, |
315 | void* inbuf) | 316 | void* inbuf) |
316 | { | 317 | { |
@@ -576,7 +577,8 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount) | |||
576 | #endif | 577 | #endif |
577 | } | 578 | } |
578 | 579 | ||
579 | int ata_write_sectors(unsigned long start, | 580 | int ata_write_sectors(IF_MV((int drive,)) |
581 | unsigned long start, | ||
580 | int count, | 582 | int count, |
581 | const void* buf) | 583 | const void* buf) |
582 | { | 584 | { |
@@ -669,6 +671,8 @@ int ata_write_sectors(unsigned long start, | |||
669 | return ret; | 671 | return ret; |
670 | } | 672 | } |
671 | 673 | ||
674 | /* schedule a single sector write, executed with the the next spinup | ||
675 | (volume 0 only, used for config sector) */ | ||
672 | extern void ata_delayed_write(unsigned long sector, const void* buf) | 676 | extern void ata_delayed_write(unsigned long sector, const void* buf) |
673 | { | 677 | { |
674 | memcpy(delayed_sector, buf, SECTOR_SIZE); | 678 | memcpy(delayed_sector, buf, SECTOR_SIZE); |
@@ -676,12 +680,13 @@ extern void ata_delayed_write(unsigned long sector, const void* buf) | |||
676 | delayed_write = true; | 680 | delayed_write = true; |
677 | } | 681 | } |
678 | 682 | ||
683 | /* write the delayed sector to volume 0 */ | ||
679 | extern void ata_flush(void) | 684 | extern void ata_flush(void) |
680 | { | 685 | { |
681 | if ( delayed_write ) { | 686 | if ( delayed_write ) { |
682 | DEBUGF("ata_flush()\n"); | 687 | DEBUGF("ata_flush()\n"); |
683 | delayed_write = false; | 688 | delayed_write = false; |
684 | ata_write_sectors(delayed_sector_num, 1, delayed_sector); | 689 | ata_write_sectors(IF_MV2(0,) delayed_sector_num, 1, delayed_sector); |
685 | } | 690 | } |
686 | } | 691 | } |
687 | 692 | ||