summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-12-28 22:16:07 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-12-28 22:16:07 +0000
commitda848576312800dc229624e928d132d0702c1854 (patch)
tree38cd01b8a9c1069a1de734e0f7eb478436715573 /firmware/drivers/ata.c
parentae45d970d874217b779071b414dcd5edbf5647da (diff)
downloadrockbox-da848576312800dc229624e928d132d0702c1854.tar.gz
rockbox-da848576312800dc229624e928d132d0702c1854.zip
prepared to mount multiple partitions into one logical file system (most useful for Ondio, internal memory + external MMC)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c11
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
313int ata_read_sectors(unsigned long start, 313int 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
579int ata_write_sectors(unsigned long start, 580int 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) */
672extern void ata_delayed_write(unsigned long sector, const void* buf) 676extern 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 */
679extern void ata_flush(void) 684extern 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