summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c10
-rw-r--r--firmware/drivers/fat.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 12ad11532a..b1910c6a7a 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -243,7 +243,7 @@ bool old_recorder = false;
243int ata_spinup_time = 0; 243int ata_spinup_time = 0;
244static bool spinup = false; 244static bool spinup = false;
245static bool sleeping = true; 245static bool sleeping = true;
246static int sleep_timeout = 5*HZ; 246static long sleep_timeout = 5*HZ;
247static bool poweroff = false; 247static bool poweroff = false;
248#ifdef HAVE_ATA_POWER_OFF 248#ifdef HAVE_ATA_POWER_OFF
249static int poweroff_timeout = 2*HZ; 249static int poweroff_timeout = 2*HZ;
@@ -270,7 +270,7 @@ static int set_features(void);
270static int wait_for_bsy(void) __attribute__ ((section (".icode"))); 270static int wait_for_bsy(void) __attribute__ ((section (".icode")));
271static int wait_for_bsy(void) 271static int wait_for_bsy(void)
272{ 272{
273 int timeout = current_tick + HZ*30; 273 long timeout = current_tick + HZ*30;
274 while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) { 274 while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
275 last_disk_activity = current_tick; 275 last_disk_activity = current_tick;
276 yield(); 276 yield();
@@ -285,7 +285,7 @@ static int wait_for_bsy(void)
285static int wait_for_rdy(void) __attribute__ ((section (".icode"))); 285static int wait_for_rdy(void) __attribute__ ((section (".icode")));
286static int wait_for_rdy(void) 286static int wait_for_rdy(void)
287{ 287{
288 int timeout; 288 long timeout;
289 289
290 if (!wait_for_bsy()) 290 if (!wait_for_bsy())
291 return 0; 291 return 0;
@@ -479,7 +479,7 @@ int ata_read_sectors(IF_MV2(int drive,)
479 void* inbuf) 479 void* inbuf)
480{ 480{
481 int ret = 0; 481 int ret = 0;
482 int timeout; 482 long timeout;
483 int count; 483 int count;
484 void* buf; 484 void* buf;
485 long spinup_start; 485 long spinup_start;
@@ -762,7 +762,7 @@ int ata_write_sectors(IF_MV2(int drive,)
762{ 762{
763 int i; 763 int i;
764 int ret = 0; 764 int ret = 0;
765 int spinup_start; 765 long spinup_start;
766 766
767#ifdef HAVE_MULTIVOLUME 767#ifdef HAVE_MULTIVOLUME
768 (void)drive; /* unused for now */ 768 (void)drive; /* unused for now */
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 374e951996..9056870bc5 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -629,7 +629,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce,
629 sectorbuf); 629 sectorbuf);
630 if(rc < 0) 630 if(rc < 0)
631 { 631 {
632 panicf("flush_fat_sector() - Could not write sector %d" 632 panicf("flush_fat_sector() - Could not write sector %ld"
633 " (error %d)\n", 633 " (error %d)\n",
634 secnum, rc); 634 secnum, rc);
635 } 635 }
@@ -649,7 +649,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce,
649 secnum, 1, sectorbuf); 649 secnum, 1, sectorbuf);
650 if(rc < 0) 650 if(rc < 0)
651 { 651 {
652 panicf("flush_fat_sector() - Could not write sector %d" 652 panicf("flush_fat_sector() - Could not write sector %ld"
653 " (error %d)\n", 653 " (error %d)\n",
654 secnum, rc); 654 secnum, rc);
655 } 655 }
@@ -832,15 +832,15 @@ static int update_fat_entry(IF_MV2(struct bpb* fat_bpb,)
832 { 832 {
833 long sector = entry / CLUSTERS_PER_FAT_SECTOR; 833 long sector = entry / CLUSTERS_PER_FAT_SECTOR;
834 int offset = entry % CLUSTERS_PER_FAT_SECTOR; 834 int offset = entry % CLUSTERS_PER_FAT_SECTOR;
835 long unsigned int* sec; 835 unsigned long* sec;
836 836
837 LDEBUGF("update_fat_entry(%lx,%lx)\n",entry,val); 837 LDEBUGF("update_fat_entry(%lx,%lx)\n",entry,val);
838 838
839 if (entry==val) 839 if (entry==val)
840 panicf("Creating FAT loop: %x,%x\n",entry,val); 840 panicf("Creating FAT loop: %lx,%lx\n",entry,val);
841 841
842 if ( entry < 2 ) 842 if ( entry < 2 )
843 panicf("Updating reserved FAT entry %d.\n",entry); 843 panicf("Updating reserved FAT entry %ld.\n",entry);
844 844
845 sec = cache_fat_sector(IF_MV2(fat_bpb,) sector, true); 845 sec = cache_fat_sector(IF_MV2(fat_bpb,) sector, true);
846 if (!sec) 846 if (!sec)
@@ -2012,9 +2012,9 @@ static int transfer(IF_MV2(struct bpb* fat_bpb,)
2012 firstallowed = fat_bpb->firstdatasector; 2012 firstallowed = fat_bpb->firstdatasector;
2013 2013
2014 if (start < firstallowed) 2014 if (start < firstallowed)
2015 panicf("Write %d before data\n", firstallowed - start); 2015 panicf("Write %ld before data\n", firstallowed - start);
2016 if (start + count > fat_bpb->totalsectors) 2016 if (start + count > fat_bpb->totalsectors)
2017 panicf("Write %d after data\n", 2017 panicf("Write %ld after data\n",
2018 start + count - fat_bpb->totalsectors); 2018 start + count - fat_bpb->totalsectors);
2019 rc = ata_write_sectors(IF_MV2(fat_bpb->drive,) 2019 rc = ata_write_sectors(IF_MV2(fat_bpb->drive,)
2020 start + fat_bpb->startsector, count, buf); 2020 start + fat_bpb->startsector, count, buf);