]> xenbits.xensource.com Git - seabios.git/commitdiff
edd: Pass the segment/offset from int 1348 calls using a 'struct segoff_s'
authorKevin O'Connor <kevin@koconnor.net>
Mon, 27 Jul 2015 14:41:41 +0000 (10:41 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 17 Aug 2015 15:38:48 +0000 (11:38 -0400)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/block.c
src/block.h
src/disk.c

index a1054ac3a3ae8f12b1657fc2b8659c433b6c4941..cd732c191997cbe8cfce961e0e11ea9826ab5ebe 100644 (file)
@@ -288,10 +288,12 @@ map_floppy_drive(struct drive_s *drive)
  ****************************************************************/
 
 static int
-fill_generic_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf
+fill_generic_edd(struct segoff_s edd, struct drive_s *drive_gf
                  , u32 dpte_so, char *iface_type
                  , int bdf, u8 channel, u16 iobase, u64 device_path)
 {
+    u16 seg = edd.seg;
+    struct int13dpt_s *param_far = (void*)(edd.offset+0);
     u16 size = GET_FARVAR(seg, param_far->size);
     u16 t13 = size == 74;
 
@@ -394,7 +396,7 @@ fill_generic_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf
 struct dpte_s DefaultDPTE VARLOW;
 
 static int
-fill_ata_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf)
+fill_ata_edd(struct segoff_s edd, struct drive_s *drive_gf)
 {
     if (!CONFIG_ATA)
         return DISK_RET_EPARAM;
@@ -446,24 +448,24 @@ fill_ata_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf)
     SET_LOW(DefaultDPTE.checksum, -sum);
 
     return fill_generic_edd(
-        seg, param_far, drive_gf, SEGOFF(SEG_LOW, (u32)&DefaultDPTE).segoff
+        edd, drive_gf, SEGOFF(SEG_LOW, (u32)&DefaultDPTE).segoff
         , "ATA     ", bdf, channel, iobase1, slave);
 }
 
 int noinline
-fill_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf)
+fill_edd(struct segoff_s edd, struct drive_s *drive_gf)
 {
     switch (GET_GLOBALFLAT(drive_gf->type)) {
     case DTYPE_ATA:
     case DTYPE_ATA_ATAPI:
-        return fill_ata_edd(seg, param_far, drive_gf);
+        return fill_ata_edd(edd, drive_gf);
     case DTYPE_VIRTIO_BLK:
     case DTYPE_VIRTIO_SCSI:
         return fill_generic_edd(
-            seg, param_far, drive_gf, 0xffffffff
+            edd, drive_gf, 0xffffffff
             , "SCSI    ", GET_GLOBALFLAT(drive_gf->cntl_id), 0, 0, 0);
     default:
-        return fill_generic_edd(seg, param_far, drive_gf, 0, NULL, 0, 0, 0, 0);
+        return fill_generic_edd(edd, drive_gf, 0, NULL, 0, 0, 0, 0);
     }
 }
 
index 702f357fefd3cf0d31bae30ddd1ee949c11a32b8..2ff359fb24d2a4ae69c6ba7712614cdf7fe4cafc 100644 (file)
@@ -110,7 +110,7 @@ void map_floppy_drive(struct drive_s *drive);
 void map_hd_drive(struct drive_s *drive);
 void map_cd_drive(struct drive_s *drive);
 struct int13dpt_s;
-int fill_edd(u16 seg, struct int13dpt_s *param_far, struct drive_s *drive_gf);
+int fill_edd(struct segoff_s edd, struct drive_s *drive_gf);
 int default_process_op(struct disk_op_s *op);
 int process_op(struct disk_op_s *op);
 int send_disk_op(struct disk_op_s *op);
index 91d939aa4d99c399ab5b8105df74f0380bdef8ee..3854d0024b21533e971e9189878a48e4eea84ff9 100644 (file)
@@ -522,7 +522,7 @@ disk_1347(struct bregs *regs, struct drive_s *drive_gf)
 static void
 disk_1348(struct bregs *regs, struct drive_s *drive_gf)
 {
-    int ret = fill_edd(regs->ds, (void*)(regs->si+0), drive_gf);
+    int ret = fill_edd(SEGOFF(regs->ds, regs->si), drive_gf);
     disk_ret(regs, ret);
 }