diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/sprintf.c | 6 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 10 | ||||
-rw-r--r-- | firmware/drivers/fat.c | 14 | ||||
-rw-r--r-- | firmware/export/fat.h | 2 | ||||
-rw-r--r-- | firmware/kernel.c | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/firmware/common/sprintf.c b/firmware/common/sprintf.c index 3518a1ba5e..0b42f66ba1 100644 --- a/firmware/common/sprintf.c +++ b/firmware/common/sprintf.c | |||
@@ -43,7 +43,7 @@ static int format( | |||
43 | char *str; | 43 | char *str; |
44 | char tmpbuf[12], pad; | 44 | char tmpbuf[12], pad; |
45 | int ch, width, val, sign; | 45 | int ch, width, val, sign; |
46 | long lval; | 46 | long lval, lsign; |
47 | unsigned int uval; | 47 | unsigned int uval; |
48 | unsigned long ulval; | 48 | unsigned long ulval; |
49 | bool ok = true; | 49 | bool ok = true; |
@@ -116,7 +116,7 @@ static int format( | |||
116 | while (ulval); | 116 | while (ulval); |
117 | break; | 117 | break; |
118 | case 'd': | 118 | case 'd': |
119 | lval = sign = va_arg (ap, long); | 119 | lval = lsign = va_arg (ap, long); |
120 | if (lval < 0) | 120 | if (lval < 0) |
121 | lval = -lval; | 121 | lval = -lval; |
122 | do | 122 | do |
@@ -125,7 +125,7 @@ static int format( | |||
125 | lval /= 10; | 125 | lval /= 10; |
126 | } | 126 | } |
127 | while (lval > 0); | 127 | while (lval > 0); |
128 | if (sign < 0) | 128 | if (lsign < 0) |
129 | *--str = '-'; | 129 | *--str = '-'; |
130 | break; | 130 | break; |
131 | 131 | ||
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; | |||
243 | int ata_spinup_time = 0; | 243 | int ata_spinup_time = 0; |
244 | static bool spinup = false; | 244 | static bool spinup = false; |
245 | static bool sleeping = true; | 245 | static bool sleeping = true; |
246 | static int sleep_timeout = 5*HZ; | 246 | static long sleep_timeout = 5*HZ; |
247 | static bool poweroff = false; | 247 | static bool poweroff = false; |
248 | #ifdef HAVE_ATA_POWER_OFF | 248 | #ifdef HAVE_ATA_POWER_OFF |
249 | static int poweroff_timeout = 2*HZ; | 249 | static int poweroff_timeout = 2*HZ; |
@@ -270,7 +270,7 @@ static int set_features(void); | |||
270 | static int wait_for_bsy(void) __attribute__ ((section (".icode"))); | 270 | static int wait_for_bsy(void) __attribute__ ((section (".icode"))); |
271 | static int wait_for_bsy(void) | 271 | static 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) | |||
285 | static int wait_for_rdy(void) __attribute__ ((section (".icode"))); | 285 | static int wait_for_rdy(void) __attribute__ ((section (".icode"))); |
286 | static int wait_for_rdy(void) | 286 | static 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); |
diff --git a/firmware/export/fat.h b/firmware/export/fat.h index c9ce0805aa..3bb895cdc8 100644 --- a/firmware/export/fat.h +++ b/firmware/export/fat.h | |||
@@ -68,7 +68,7 @@ struct fat_dir | |||
68 | { | 68 | { |
69 | unsigned int entry; | 69 | unsigned int entry; |
70 | unsigned int entrycount; | 70 | unsigned int entrycount; |
71 | int sector; | 71 | long sector; |
72 | struct fat_file file; | 72 | struct fat_file file; |
73 | unsigned char sectorcache[3][SECTOR_SIZE]; | 73 | unsigned char sectorcache[3][SECTOR_SIZE]; |
74 | }; | 74 | }; |
diff --git a/firmware/kernel.c b/firmware/kernel.c index d21244202f..6280019e75 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -289,7 +289,7 @@ static void tick_start(unsigned int interval_in_ms) | |||
289 | 289 | ||
290 | if(count > 0xffffL) | 290 | if(count > 0xffffL) |
291 | { | 291 | { |
292 | panicf("Error! The tick interval is too long (%dms->%x)\n", | 292 | panicf("Error! The tick interval is too long (%dms->%lx)\n", |
293 | interval_in_ms, count); | 293 | interval_in_ms, count); |
294 | return; | 294 | return; |
295 | } | 295 | } |