]> xenbits.xensource.com Git - seabios.git/commitdiff
block: Move drive setup to new function block_setup()
authorKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 16:00:17 +0000 (11:00 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 4 Feb 2016 17:53:05 +0000 (12:53 -0500)
Move the list of drive setup calls from post.c to a new function in
block.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/block.c
src/block.h
src/post.c

index b4530fc88916aa5e86538f5a6ae61cbc8cd23f0f..515ac9d94e335fc703ebc2faf7a13e3c3c9bfa0a 100644 (file)
@@ -9,7 +9,6 @@
 #include "block.h" // process_op
 #include "hw/ata.h" // process_ata_op
 #include "hw/ahci.h" // process_ahci_op
-#include "hw/blockcmd.h" // cdb_*
 #include "hw/esp-scsi.h" // esp_scsi_process_op
 #include "hw/lsi-scsi.h" // lsi_scsi_process_op
 #include "hw/megasas.h" // megasas_process_op
@@ -487,6 +486,22 @@ fill_edd(struct segoff_s edd, struct drive_s *drive_gf)
  * Disk driver dispatch
  ****************************************************************/
 
+void
+block_setup(void)
+{
+    floppy_setup();
+    ata_setup();
+    ahci_setup();
+    sdcard_setup();
+    ramdisk_setup();
+    virtio_blk_setup();
+    virtio_scsi_setup();
+    lsi_scsi_setup();
+    esp_scsi_setup();
+    megasas_setup();
+    pvscsi_setup();
+}
+
 // Fallback handler for command requests not implemented by drivers
 int
 default_process_op(struct disk_op_s *op)
index 2ff359fb24d2a4ae69c6ba7712614cdf7fe4cafc..8f4c1aa437d731ade32380b818f6c6373e41c7ff 100644 (file)
@@ -111,6 +111,7 @@ void map_hd_drive(struct drive_s *drive);
 void map_cd_drive(struct drive_s *drive);
 struct int13dpt_s;
 int fill_edd(struct segoff_s edd, struct drive_s *drive_gf);
+void block_setup(void);
 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 e5fa4be0dfd946de00abed1ba54d5c00a8966f5f..2c4f12b9e34a32e3b3a844aa1566f766aa8d5d1c 100644 (file)
@@ -6,24 +6,17 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "biosvar.h" // SET_BDA
+#include "block.h" // block_setup
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "e820map.h" // e820_add
 #include "fw/paravirt.h" // qemu_cfg_preinit
 #include "fw/xen.h" // xen_preinit
-#include "hw/ahci.h" // ahci_setup
-#include "hw/ata.h" // ata_setup
-#include "hw/esp-scsi.h" // esp_scsi_setup
-#include "hw/lsi-scsi.h" // lsi_scsi_setup
-#include "hw/megasas.h" // megasas_setup
-#include "hw/pvscsi.h" // pvscsi_setup
 #include "hw/pic.h" // pic_setup
 #include "hw/ps2port.h" // ps2port_setup
 #include "hw/rtc.h" // rtc_write
 #include "hw/serialio.h" // serial_debug_preinit
 #include "hw/usb.h" // usb_setup
-#include "hw/virtio-blk.h" // virtio_blk_setup
-#include "hw/virtio-scsi.h" // virtio_scsi_setup
 #include "malloc.h" // malloc_init
 #include "memmap.h" // SYMBOL
 #include "output.h" // dprintf
@@ -134,21 +127,10 @@ device_hardware_setup(void)
 {
     usb_setup();
     ps2port_setup();
+    block_setup();
     lpt_setup();
     serial_setup();
-
-    floppy_setup();
-    ata_setup();
-    ahci_setup();
-    sdcard_setup();
     cbfs_payload_setup();
-    ramdisk_setup();
-    virtio_blk_setup();
-    virtio_scsi_setup();
-    lsi_scsi_setup();
-    esp_scsi_setup();
-    megasas_setup();
-    pvscsi_setup();
 }
 
 static void