Compile fixes for gcc 4.3.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 13 Apr 2008 22:17:02 +0000 (18:17 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 13 Apr 2008 22:17:02 +0000 (18:17 -0400)
Clean up some warnings.
Make sure floppy_dbt structure is aliagned to 1 byte boundary.

src/ata.c
src/cdrom.c
src/floppy.c
src/floppy_dbt.c
src/system.c
src/util.h

index 9280f46082361e2309c0e077d275aa4889831a57..ecda021809501549e8706aeaaf2c879a8ff549bf 100644 (file)
--- a/src/ata.c
+++ b/src/ata.c
@@ -39,7 +39,7 @@ await_ide(u8 when_done, u16 base, u16 timeout)
     for (;;) {
         u8 status = inb(base+ATA_CB_STAT);
         time++;
-        u8 result;
+        u8 result = 0;
         if (when_done == BSY)
             result = status & ATA_CB_STAT_BSY;
         else if (when_done == NOT_BSY)
@@ -50,8 +50,6 @@ await_ide(u8 when_done, u16 base, u16 timeout)
             result = !(status & ATA_CB_STAT_BSY) && !(status & ATA_CB_STAT_DRQ);
         else if (when_done == NOT_BSY_RDY)
             result = !(status & ATA_CB_STAT_BSY) && (status & ATA_CB_STAT_RDY);
-        else if (when_done == TIMEOUT)
-            result = 0;
 
         if (result)
             return status;
index 24a9f1f53cd12f2de9bf3c57cc68f256aeb0e3ab..2921b44579d9ddad60ed966a0130a5537bea7c9c 100644 (file)
@@ -209,7 +209,7 @@ cdemu_1308(struct bregs *regs, u8 device)
         regs->bl = media * 2;
 
     regs->es = SEG_BIOS;
-    regs->di = (u16)&diskette_param_table2;
+    regs->di = (u32)&diskette_param_table2;
 
     disk_ret(regs, DISK_RET_SUCCESS);
 }
index fc5e43fc106d552e0a8915267a5e285798e41835..bb8cd279ae3622fc6110e1e290afc389712769d9 100644 (file)
@@ -669,7 +669,7 @@ floppy_1308(struct bregs *regs, u8 drive)
 
     /* set es & di to point to 11 byte diskette param table in ROM */
     regs->es = SEG_BIOS;
-    regs->di = (u16)&diskette_param_table2;
+    regs->di = (u32)&diskette_param_table2;
     /* disk status not changed upon success */
 }
 
index 4c83f6939988aeb4213758ce6ae75efb94e04b08..987568bce5edc3d7401fa9f6b41989c6dd22d194 100644 (file)
@@ -9,7 +9,7 @@
 // Since no provisions are made for multiple drive types, most
 // values in this table are ignored.  I set parameters for 1.44M
 // floppy here
-struct floppy_dbt_s diskette_param_table VISIBLE16 = {
+struct floppy_dbt_s diskette_param_table __attribute__((aligned (1))) VISIBLE16 = {
     .specify1       = 0xAF,
     .specify2       = 0x02, // head load time 0000001, DMA used
     .shutoff_ticks  = 0x25,
index c01813d5c1aff3ad64c921b4ac3128f7849c87be..1db679b229ad023479cb557605568f2e6d01a043 100644 (file)
@@ -238,7 +238,7 @@ static void
 handle_15c0(struct bregs *regs)
 {
     regs->es = SEG_BIOS;
-    regs->bx = (u16)&BIOS_CONFIG_TABLE;
+    regs->bx = (u32)&BIOS_CONFIG_TABLE;
     set_code_success(regs);
 }
 
index e304a0b83a2213a061e7fcec43000af280785fc1..10d18350e49ece9da089178512ab30b9d6b9c393 100644 (file)
@@ -90,7 +90,7 @@ void __call16_int(struct bregs *callregs, u16 offset)
 #ifdef MODE16
 #define call16_int(nr, callregs) do {                           \
         extern void irq_trampoline_ ##nr ();                    \
-        __call16_int((callregs), (u16)&irq_trampoline_ ##nr );  \
+        __call16_int((callregs), (u32)&irq_trampoline_ ##nr );  \
     } while (0)
 #else
 #include "../out/rom16.offset.auto.h"