[SeaBIOS] [PATCH 2/4] Move code centered around specific hardware devices to src/hw/

Kevin O'Connor kevin at koconnor.net
Tue Sep 3 03:48:53 CEST 2013


Move many C files from the src/ directory to the new src/hw/ directory.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 Makefile                   | 22 +++++++++++-----------
 src/acpi.c                 |  6 +++---
 src/biostables.c           |  2 +-
 src/block.c                | 10 +++++-----
 src/boot.c                 |  6 +++---
 src/cdrom.c                |  4 ++--
 src/clock.c                |  8 ++++----
 src/coreboot.c             |  2 +-
 src/csm.c                  |  4 ++--
 src/csm.h                  |  2 +-
 src/disk.c                 |  6 +++---
 src/{ => hw}/ahci.c        |  0
 src/{ => hw}/ahci.h        |  0
 src/{ => hw}/ata.c         |  0
 src/{ => hw}/ata.h         |  0
 src/{ => hw}/blockcmd.c    |  0
 src/{ => hw}/blockcmd.h    |  0
 src/{ => hw}/cmos.h        |  0
 src/{ => hw}/esp-scsi.c    |  0
 src/{ => hw}/esp-scsi.h    |  0
 src/{ => hw}/floppy.c      |  0
 src/{ => hw}/lsi-scsi.c    |  0
 src/{ => hw}/lsi-scsi.h    |  0
 src/{ => hw}/megasas.c     |  0
 src/{ => hw}/megasas.h     |  0
 src/{ => hw}/pci.c         |  0
 src/{ => hw}/pci.h         |  0
 src/{ => hw}/pci_ids.h     |  0
 src/{ => hw}/pci_regs.h    |  0
 src/{ => hw}/pic.c         |  0
 src/{ => hw}/pic.h         |  0
 src/{ => hw}/pit.h         |  0
 src/{ => hw}/ps2port.c     |  0
 src/{ => hw}/ps2port.h     |  0
 src/{ => hw}/ramdisk.c     |  0
 src/{ => hw}/timer.c       |  0
 src/{ => hw}/usb-ehci.c    |  0
 src/{ => hw}/usb-ehci.h    |  0
 src/{ => hw}/usb-hid.c     |  0
 src/{ => hw}/usb-hid.h     |  0
 src/{ => hw}/usb-hub.c     |  0
 src/{ => hw}/usb-hub.h     |  0
 src/{ => hw}/usb-msc.c     |  0
 src/{ => hw}/usb-msc.h     |  0
 src/{ => hw}/usb-ohci.c    |  0
 src/{ => hw}/usb-ohci.h    |  0
 src/{ => hw}/usb-uas.c     |  0
 src/{ => hw}/usb-uas.h     |  0
 src/{ => hw}/usb-uhci.c    |  0
 src/{ => hw}/usb-uhci.h    |  0
 src/{ => hw}/usb.c         |  0
 src/{ => hw}/usb.h         |  0
 src/{ => hw}/virtio-blk.c  |  0
 src/{ => hw}/virtio-blk.h  |  0
 src/{ => hw}/virtio-pci.c  |  0
 src/{ => hw}/virtio-pci.h  |  0
 src/{ => hw}/virtio-ring.c |  0
 src/{ => hw}/virtio-ring.h |  0
 src/{ => hw}/virtio-scsi.c |  0
 src/{ => hw}/virtio-scsi.h |  0
 src/kbd.c                  |  4 ++--
 src/misc.c                 |  2 +-
 src/mouse.c                |  4 ++--
 src/mptable.c              |  4 ++--
 src/mtrr.c                 |  2 +-
 src/optionroms.c           |  6 +++---
 src/paravirt.c             |  4 ++--
 src/pcibios.c              |  4 ++--
 src/pciinit.c              |  6 +++---
 src/pirtable.c             |  2 +-
 src/post.c                 | 22 +++++++++++-----------
 src/resume.c               |  8 ++++----
 src/romlayout.S            |  2 +-
 src/shadow.c               |  6 +++---
 src/smm.c                  |  6 +++---
 src/smp.c                  |  2 +-
 src/system.c               |  2 +-
 src/util.h                 |  2 +-
 src/vgahooks.c             |  6 +++---
 vgasrc/bochsvga.c          |  4 ++--
 vgasrc/clext.c             |  4 ++--
 vgasrc/geodevga.c          |  4 ++--
 vgasrc/vgabios.c           |  4 ++--
 83 files changed, 91 insertions(+), 91 deletions(-)
 rename src/{ => hw}/ahci.c (100%)
 rename src/{ => hw}/ahci.h (100%)
 rename src/{ => hw}/ata.c (100%)
 rename src/{ => hw}/ata.h (100%)
 rename src/{ => hw}/blockcmd.c (100%)
 rename src/{ => hw}/blockcmd.h (100%)
 rename src/{ => hw}/cmos.h (100%)
 rename src/{ => hw}/esp-scsi.c (100%)
 rename src/{ => hw}/esp-scsi.h (100%)
 rename src/{ => hw}/floppy.c (100%)
 rename src/{ => hw}/lsi-scsi.c (100%)
 rename src/{ => hw}/lsi-scsi.h (100%)
 rename src/{ => hw}/megasas.c (100%)
 rename src/{ => hw}/megasas.h (100%)
 rename src/{ => hw}/pci.c (100%)
 rename src/{ => hw}/pci.h (100%)
 rename src/{ => hw}/pci_ids.h (100%)
 rename src/{ => hw}/pci_regs.h (100%)
 rename src/{ => hw}/pic.c (100%)
 rename src/{ => hw}/pic.h (100%)
 rename src/{ => hw}/pit.h (100%)
 rename src/{ => hw}/ps2port.c (100%)
 rename src/{ => hw}/ps2port.h (100%)
 rename src/{ => hw}/ramdisk.c (100%)
 rename src/{ => hw}/timer.c (100%)
 rename src/{ => hw}/usb-ehci.c (100%)
 rename src/{ => hw}/usb-ehci.h (100%)
 rename src/{ => hw}/usb-hid.c (100%)
 rename src/{ => hw}/usb-hid.h (100%)
 rename src/{ => hw}/usb-hub.c (100%)
 rename src/{ => hw}/usb-hub.h (100%)
 rename src/{ => hw}/usb-msc.c (100%)
 rename src/{ => hw}/usb-msc.h (100%)
 rename src/{ => hw}/usb-ohci.c (100%)
 rename src/{ => hw}/usb-ohci.h (100%)
 rename src/{ => hw}/usb-uas.c (100%)
 rename src/{ => hw}/usb-uas.h (100%)
 rename src/{ => hw}/usb-uhci.c (100%)
 rename src/{ => hw}/usb-uhci.h (100%)
 rename src/{ => hw}/usb.c (100%)
 rename src/{ => hw}/usb.h (100%)
 rename src/{ => hw}/virtio-blk.c (100%)
 rename src/{ => hw}/virtio-blk.h (100%)
 rename src/{ => hw}/virtio-pci.c (100%)
 rename src/{ => hw}/virtio-pci.h (100%)
 rename src/{ => hw}/virtio-ring.c (100%)
 rename src/{ => hw}/virtio-ring.h (100%)
 rename src/{ => hw}/virtio-scsi.c (100%)
 rename src/{ => hw}/virtio-scsi.h (100%)

diff --git a/Makefile b/Makefile
index bafa246..a43fa14 100644
--- a/Makefile
+++ b/Makefile
@@ -8,19 +8,19 @@
 OUT=out/
 
 # Source files
-SRCBOTH=misc.c stacks.c output.c util.c block.c floppy.c ata.c mouse.c \
-    kbd.c pci.c serial.c timer.c clock.c pic.c cdrom.c ps2port.c smp.c resume.c \
-    pnpbios.c vgahooks.c ramdisk.c pcibios.c blockcmd.c \
-    usb.c usb-uhci.c usb-ohci.c usb-ehci.c usb-hid.c usb-msc.c \
-    virtio-ring.c virtio-pci.c virtio-blk.c virtio-scsi.c apm.c ahci.c \
-    usb-uas.c lsi-scsi.c esp-scsi.c megasas.c
+SRCBOTH=misc.c stacks.c output.c util.c block.c hw/floppy.c hw/ata.c mouse.c \
+    kbd.c hw/pci.c serial.c hw/timer.c clock.c hw/pic.c cdrom.c hw/ps2port.c smp.c resume.c \
+    pnpbios.c vgahooks.c hw/ramdisk.c pcibios.c hw/blockcmd.c \
+    hw/usb.c hw/usb-uhci.c hw/usb-ohci.c hw/usb-ehci.c hw/usb-hid.c hw/usb-msc.c \
+    hw/virtio-ring.c hw/virtio-pci.c hw/virtio-blk.c hw/virtio-scsi.c apm.c hw/ahci.c \
+    hw/usb-uas.c hw/lsi-scsi.c hw/esp-scsi.c hw/megasas.c
 SRC16=$(SRCBOTH) system.c disk.c font.c
 SRC32FLAT=$(SRCBOTH) post.c shadow.c memmap.c pmm.c coreboot.c boot.c \
     acpi.c smm.c mptable.c pirtable.c smbios.c pciinit.c optionroms.c mtrr.c \
-    lzmadecode.c bootsplash.c jpeg.c usb-hub.c paravirt.c \
+    lzmadecode.c bootsplash.c jpeg.c hw/usb-hub.c paravirt.c \
     biostables.c xen.c bmp.c romfile.c csm.c
-SRC32SEG=util.c output.c pci.c pcibios.c apm.c stacks.c
-DIRS=src vgasrc
+SRC32SEG=util.c output.c hw/pci.c pcibios.c apm.c stacks.c
+DIRS=src src/hw vgasrc
 
 # Default compiler flags
 cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
@@ -28,7 +28,7 @@ cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
 
 CPPFLAGS = -P -MD -MT $@
 
-COMMONCFLAGS := -I$(OUT) -Os -MD -g \
+COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -g \
     -Wall -Wno-strict-aliasing -Wold-style-definition \
     $(call cc-option,$(CC),-Wtype-limits,) \
     -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
@@ -175,7 +175,7 @@ $(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o scripts/checkrom.py
 ################ VGA build rules
 
 # VGA src files
-SRCVGA=src/output.c src/util.c src/pci.c \
+SRCVGA=src/output.c src/util.c src/hw/pci.c \
     vgasrc/vgabios.c vgasrc/vgafb.c vgasrc/vgafonts.c vgasrc/vbe.c \
     vgasrc/stdvga.c vgasrc/stdvgamodes.c vgasrc/stdvgaio.c \
     vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c
diff --git a/src/acpi.c b/src/acpi.c
index 8db1ed4..774ff95 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -8,9 +8,9 @@
 #include "acpi.h" // struct rsdp_descriptor
 #include "util.h" // memcpy
 #include "byteorder.h" // cpu_to_le16
-#include "pci.h" // pci_find_init_device
-#include "pci_ids.h" // PCI_VENDOR_ID_INTEL
-#include "pci_regs.h" // PCI_INTERRUPT_LINE
+#include "hw/pci.h" // pci_find_init_device
+#include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL
+#include "hw/pci_regs.h" // PCI_INTERRUPT_LINE
 #include "ioport.h" // inl
 #include "config.h" // CONFIG_*
 #include "paravirt.h" // RamSize
diff --git a/src/biostables.c b/src/biostables.c
index 7b860e1..beb0bed 100644
--- a/src/biostables.c
+++ b/src/biostables.c
@@ -6,7 +6,7 @@
 
 #include "config.h" // CONFIG_*
 #include "util.h" // dprintf
-#include "pci.h" // struct pir_header
+#include "hw/pci.h" // struct pir_header
 #include "acpi.h" // struct rsdp_descriptor
 #include "mptable.h" // MPTABLE_SIGNATURE
 #include "smbios.h" // struct smbios_entry_point
diff --git a/src/block.c b/src/block.c
index af73630..74c6497 100644
--- a/src/block.c
+++ b/src/block.c
@@ -7,12 +7,12 @@
 
 #include "disk.h" // struct ata_s
 #include "biosvar.h" // GET_GLOBAL
-#include "cmos.h" // inb_cmos
+#include "hw/cmos.h" // inb_cmos
 #include "util.h" // dprintf
-#include "ata.h" // process_ata_op
-#include "ahci.h" // process_ahci_op
-#include "virtio-blk.h" // process_virtio_blk_op
-#include "blockcmd.h" // cdb_*
+#include "hw/ata.h" // process_ata_op
+#include "hw/ahci.h" // process_ahci_op
+#include "hw/virtio-blk.h" // process_virtio_blk_op
+#include "hw/blockcmd.h" // cdb_*
 
 u8 FloppyCount VARFSEG;
 u8 CDCount;
diff --git a/src/boot.c b/src/boot.c
index c343840..4d8f161 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -10,10 +10,10 @@
 #include "disk.h" // cdrom_boot
 #include "bregs.h" // struct bregs
 #include "boot.h" // func defs
-#include "cmos.h" // inb_cmos
+#include "hw/cmos.h" // inb_cmos
 #include "paravirt.h" // qemu_cfg_show_boot_menu
-#include "pci.h" // pci_bdf_to_*
-#include "usb.h" // struct usbdevice_s
+#include "hw/pci.h" // pci_bdf_to_*
+#include "hw/usb.h" // struct usbdevice_s
 #include "csm.h" // csm_bootprio_*
 #include "list.h" // hlist_node
 
diff --git a/src/cdrom.c b/src/cdrom.c
index b2811cd..94265b0 100644
--- a/src/cdrom.c
+++ b/src/cdrom.c
@@ -9,8 +9,8 @@
 #include "util.h" // memset
 #include "bregs.h" // struct bregs
 #include "biosvar.h" // GET_GLOBAL
-#include "ata.h" // ATA_CMD_REQUEST_SENSE
-#include "blockcmd.h" // CDB_CMD_REQUEST_SENSE
+#include "hw/ata.h" // ATA_CMD_REQUEST_SENSE
+#include "hw/blockcmd.h" // CDB_CMD_REQUEST_SENSE
 
 // Locks for removable devices
 u8 CDRom_locks[BUILD_MAX_EXTDRIVE] VARLOW;
diff --git a/src/clock.c b/src/clock.c
index 5014b60..cc962e4 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -8,12 +8,12 @@
 #include "biosvar.h" // SET_BDA
 #include "util.h" // debug_enter
 #include "disk.h" // floppy_tick
-#include "cmos.h" // inb_cmos
-#include "pic.h" // pic_eoi1
-#include "pit.h" // PM_SEL_TIMER0
+#include "hw/cmos.h" // inb_cmos
+#include "hw/pic.h" // pic_eoi1
+#include "hw/pit.h" // PM_SEL_TIMER0
 #include "bregs.h" // struct bregs
 #include "biosvar.h" // GET_GLOBAL
-#include "usb-hid.h" // usb_check_event
+#include "hw/usb-hid.h" // usb_check_event
 
 // RTC register flags
 #define RTC_A_UIP 0x80
diff --git a/src/coreboot.c b/src/coreboot.c
index 983a2b5..126649a 100644
--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -13,7 +13,7 @@
 #include "disk.h" // MAXDESCSIZE
 #include "config.h" // CONFIG_*
 #include "acpi.h" // find_acpi_features
-#include "pci.h" // pci_probe_devices
+#include "hw/pci.h" // pci_probe_devices
 #include "paravirt.h" // PlatformRunningOn
 
 
diff --git a/src/csm.c b/src/csm.c
index 2021701..0093bee 100644
--- a/src/csm.c
+++ b/src/csm.c
@@ -9,14 +9,14 @@
 #include "util.h" // checksum
 #include "bregs.h"
 #include "optionroms.h"
-#include "pci.h"
+#include "hw/pci.h"
 #include "memmap.h"
 #include "biosvar.h"
 #include "post.h"
 #include "acpi.h"
 #include "boot.h"
 #include "smbios.h"
-#include "pic.h"
+#include "hw/pic.h"
 
 struct rsdp_descriptor csm_rsdp VARFSEG __aligned(16);
 
diff --git a/src/csm.h b/src/csm.h
index 77e5bf0..997e3f7 100644
--- a/src/csm.h
+++ b/src/csm.h
@@ -2,13 +2,13 @@
 #define __CSM_H
 
 #include "types.h"
-#include "pci.h"
 
 #define UINT8 u8
 #define UINT16 u16
 #define UINT32 u32
 
 // csm.c
+struct pci_device;
 int csm_bootprio_fdc(struct pci_device *pci, int port, int fdid);
 int csm_bootprio_ata(struct pci_device *pci, int chanid, int slave);
 int csm_bootprio_pci(struct pci_device *pci);
diff --git a/src/disk.c b/src/disk.c
index 975d053..78252b1 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -9,10 +9,10 @@
 #include "biosvar.h" // SET_BDA
 #include "config.h" // CONFIG_*
 #include "util.h" // debug_enter
-#include "pic.h" // pic_eoi2
+#include "hw/pic.h" // pic_eoi2
 #include "bregs.h" // struct bregs
-#include "pci.h" // pci_bdf_to_bus
-#include "ata.h" // ATA_CB_DC
+#include "hw/pci.h" // pci_bdf_to_bus
+#include "hw/ata.h" // ATA_CB_DC
 
 
 /****************************************************************
diff --git a/src/ahci.c b/src/hw/ahci.c
similarity index 100%
rename from src/ahci.c
rename to src/hw/ahci.c
diff --git a/src/ahci.h b/src/hw/ahci.h
similarity index 100%
rename from src/ahci.h
rename to src/hw/ahci.h
diff --git a/src/ata.c b/src/hw/ata.c
similarity index 100%
rename from src/ata.c
rename to src/hw/ata.c
diff --git a/src/ata.h b/src/hw/ata.h
similarity index 100%
rename from src/ata.h
rename to src/hw/ata.h
diff --git a/src/blockcmd.c b/src/hw/blockcmd.c
similarity index 100%
rename from src/blockcmd.c
rename to src/hw/blockcmd.c
diff --git a/src/blockcmd.h b/src/hw/blockcmd.h
similarity index 100%
rename from src/blockcmd.h
rename to src/hw/blockcmd.h
diff --git a/src/cmos.h b/src/hw/cmos.h
similarity index 100%
rename from src/cmos.h
rename to src/hw/cmos.h
diff --git a/src/esp-scsi.c b/src/hw/esp-scsi.c
similarity index 100%
rename from src/esp-scsi.c
rename to src/hw/esp-scsi.c
diff --git a/src/esp-scsi.h b/src/hw/esp-scsi.h
similarity index 100%
rename from src/esp-scsi.h
rename to src/hw/esp-scsi.h
diff --git a/src/floppy.c b/src/hw/floppy.c
similarity index 100%
rename from src/floppy.c
rename to src/hw/floppy.c
diff --git a/src/lsi-scsi.c b/src/hw/lsi-scsi.c
similarity index 100%
rename from src/lsi-scsi.c
rename to src/hw/lsi-scsi.c
diff --git a/src/lsi-scsi.h b/src/hw/lsi-scsi.h
similarity index 100%
rename from src/lsi-scsi.h
rename to src/hw/lsi-scsi.h
diff --git a/src/megasas.c b/src/hw/megasas.c
similarity index 100%
rename from src/megasas.c
rename to src/hw/megasas.c
diff --git a/src/megasas.h b/src/hw/megasas.h
similarity index 100%
rename from src/megasas.h
rename to src/hw/megasas.h
diff --git a/src/pci.c b/src/hw/pci.c
similarity index 100%
rename from src/pci.c
rename to src/hw/pci.c
diff --git a/src/pci.h b/src/hw/pci.h
similarity index 100%
rename from src/pci.h
rename to src/hw/pci.h
diff --git a/src/pci_ids.h b/src/hw/pci_ids.h
similarity index 100%
rename from src/pci_ids.h
rename to src/hw/pci_ids.h
diff --git a/src/pci_regs.h b/src/hw/pci_regs.h
similarity index 100%
rename from src/pci_regs.h
rename to src/hw/pci_regs.h
diff --git a/src/pic.c b/src/hw/pic.c
similarity index 100%
rename from src/pic.c
rename to src/hw/pic.c
diff --git a/src/pic.h b/src/hw/pic.h
similarity index 100%
rename from src/pic.h
rename to src/hw/pic.h
diff --git a/src/pit.h b/src/hw/pit.h
similarity index 100%
rename from src/pit.h
rename to src/hw/pit.h
diff --git a/src/ps2port.c b/src/hw/ps2port.c
similarity index 100%
rename from src/ps2port.c
rename to src/hw/ps2port.c
diff --git a/src/ps2port.h b/src/hw/ps2port.h
similarity index 100%
rename from src/ps2port.h
rename to src/hw/ps2port.h
diff --git a/src/ramdisk.c b/src/hw/ramdisk.c
similarity index 100%
rename from src/ramdisk.c
rename to src/hw/ramdisk.c
diff --git a/src/timer.c b/src/hw/timer.c
similarity index 100%
rename from src/timer.c
rename to src/hw/timer.c
diff --git a/src/usb-ehci.c b/src/hw/usb-ehci.c
similarity index 100%
rename from src/usb-ehci.c
rename to src/hw/usb-ehci.c
diff --git a/src/usb-ehci.h b/src/hw/usb-ehci.h
similarity index 100%
rename from src/usb-ehci.h
rename to src/hw/usb-ehci.h
diff --git a/src/usb-hid.c b/src/hw/usb-hid.c
similarity index 100%
rename from src/usb-hid.c
rename to src/hw/usb-hid.c
diff --git a/src/usb-hid.h b/src/hw/usb-hid.h
similarity index 100%
rename from src/usb-hid.h
rename to src/hw/usb-hid.h
diff --git a/src/usb-hub.c b/src/hw/usb-hub.c
similarity index 100%
rename from src/usb-hub.c
rename to src/hw/usb-hub.c
diff --git a/src/usb-hub.h b/src/hw/usb-hub.h
similarity index 100%
rename from src/usb-hub.h
rename to src/hw/usb-hub.h
diff --git a/src/usb-msc.c b/src/hw/usb-msc.c
similarity index 100%
rename from src/usb-msc.c
rename to src/hw/usb-msc.c
diff --git a/src/usb-msc.h b/src/hw/usb-msc.h
similarity index 100%
rename from src/usb-msc.h
rename to src/hw/usb-msc.h
diff --git a/src/usb-ohci.c b/src/hw/usb-ohci.c
similarity index 100%
rename from src/usb-ohci.c
rename to src/hw/usb-ohci.c
diff --git a/src/usb-ohci.h b/src/hw/usb-ohci.h
similarity index 100%
rename from src/usb-ohci.h
rename to src/hw/usb-ohci.h
diff --git a/src/usb-uas.c b/src/hw/usb-uas.c
similarity index 100%
rename from src/usb-uas.c
rename to src/hw/usb-uas.c
diff --git a/src/usb-uas.h b/src/hw/usb-uas.h
similarity index 100%
rename from src/usb-uas.h
rename to src/hw/usb-uas.h
diff --git a/src/usb-uhci.c b/src/hw/usb-uhci.c
similarity index 100%
rename from src/usb-uhci.c
rename to src/hw/usb-uhci.c
diff --git a/src/usb-uhci.h b/src/hw/usb-uhci.h
similarity index 100%
rename from src/usb-uhci.h
rename to src/hw/usb-uhci.h
diff --git a/src/usb.c b/src/hw/usb.c
similarity index 100%
rename from src/usb.c
rename to src/hw/usb.c
diff --git a/src/usb.h b/src/hw/usb.h
similarity index 100%
rename from src/usb.h
rename to src/hw/usb.h
diff --git a/src/virtio-blk.c b/src/hw/virtio-blk.c
similarity index 100%
rename from src/virtio-blk.c
rename to src/hw/virtio-blk.c
diff --git a/src/virtio-blk.h b/src/hw/virtio-blk.h
similarity index 100%
rename from src/virtio-blk.h
rename to src/hw/virtio-blk.h
diff --git a/src/virtio-pci.c b/src/hw/virtio-pci.c
similarity index 100%
rename from src/virtio-pci.c
rename to src/hw/virtio-pci.c
diff --git a/src/virtio-pci.h b/src/hw/virtio-pci.h
similarity index 100%
rename from src/virtio-pci.h
rename to src/hw/virtio-pci.h
diff --git a/src/virtio-ring.c b/src/hw/virtio-ring.c
similarity index 100%
rename from src/virtio-ring.c
rename to src/hw/virtio-ring.c
diff --git a/src/virtio-ring.h b/src/hw/virtio-ring.h
similarity index 100%
rename from src/virtio-ring.h
rename to src/hw/virtio-ring.h
diff --git a/src/virtio-scsi.c b/src/hw/virtio-scsi.c
similarity index 100%
rename from src/virtio-scsi.c
rename to src/hw/virtio-scsi.c
diff --git a/src/virtio-scsi.h b/src/hw/virtio-scsi.h
similarity index 100%
rename from src/virtio-scsi.h
rename to src/hw/virtio-scsi.h
diff --git a/src/kbd.c b/src/kbd.c
index 05845e5..2e2ced7 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -9,8 +9,8 @@
 #include "util.h" // debug_enter
 #include "config.h" // CONFIG_*
 #include "bregs.h" // struct bregs
-#include "ps2port.h" // ps2_kbd_command
-#include "usb-hid.h" // usb_kbd_command
+#include "hw/ps2port.h" // ps2_kbd_command
+#include "hw/usb-hid.h" // usb_kbd_command
 
 // Bit definitions for BDA kbd_flag[012]
 #define KF0_RSHIFT       (1<<0)
diff --git a/src/misc.c b/src/misc.c
index c84cac8..338c607 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -8,7 +8,7 @@
 #include "bregs.h" // struct bregs
 #include "biosvar.h" // GET_BDA
 #include "util.h" // debug_enter
-#include "pic.h" // enable_hwirq
+#include "hw/pic.h" // enable_hwirq
 
 
 /****************************************************************
diff --git a/src/mouse.c b/src/mouse.c
index 5371cf6..5a7ae0a 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -8,8 +8,8 @@
 #include "biosvar.h" // GET_EBDA
 #include "util.h" // dprintf
 #include "bregs.h" // struct bregs
-#include "ps2port.h" // ps2_mouse_command
-#include "usb-hid.h" // usb_mouse_command
+#include "hw/ps2port.h" // ps2_mouse_command
+#include "hw/usb-hid.h" // usb_mouse_command
 
 void
 mouse_init(void)
diff --git a/src/mptable.c b/src/mptable.c
index 0413063..2d12865 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -8,8 +8,8 @@
 #include "util.h" // dprintf
 #include "config.h" // CONFIG_*
 #include "mptable.h" // MPTABLE_SIGNATURE
-#include "pci.h"
-#include "pci_regs.h"
+#include "hw/pci.h"
+#include "hw/pci_regs.h"
 
 void
 mptable_setup(void)
diff --git a/src/mtrr.c b/src/mtrr.c
index 0f94c2c..001e275 100644
--- a/src/mtrr.c
+++ b/src/mtrr.c
@@ -6,7 +6,7 @@
 
 #include "util.h" // dprintf
 #include "config.h" // CONFIG_*
-#include "pci.h" // pcimem_start
+#include "hw/pci.h" // pcimem_start
 #include "paravirt.h" // RamSize
 
 #define MSR_MTRRcap                    0x000000fe
diff --git a/src/optionroms.c b/src/optionroms.c
index ac92613..ffa426d 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -9,9 +9,9 @@
 #include "farptr.h" // FLATPTR_TO_SEG
 #include "config.h" // CONFIG_*
 #include "util.h" // dprintf
-#include "pci.h" // foreachpci
-#include "pci_regs.h" // PCI_ROM_ADDRESS
-#include "pci_ids.h" // PCI_CLASS_DISPLAY_VGA
+#include "hw/pci.h" // foreachpci
+#include "hw/pci_regs.h" // PCI_ROM_ADDRESS
+#include "hw/pci_ids.h" // PCI_CLASS_DISPLAY_VGA
 #include "boot.h" // IPL
 #include "optionroms.h" // struct rom_header
 
diff --git a/src/paravirt.c b/src/paravirt.c
index d1a5d3e..b1dd8b0 100644
--- a/src/paravirt.c
+++ b/src/paravirt.c
@@ -15,10 +15,10 @@
 #include "paravirt.h" // qemu_cfg_preinit
 #include "smbios.h" // smbios_setup
 #include "memmap.h" // add_e820
-#include "cmos.h" // CMOS_*
+#include "hw/cmos.h" // CMOS_*
 #include "acpi.h" // acpi_setup
 #include "mptable.h" // mptable_setup
-#include "pci.h" // create_pirtable
+#include "hw/pci.h" // create_pirtable
 #include "xen.h" // xen_biostable_setup
 
 // Amount of continuous ram under 4Gig
diff --git a/src/pcibios.c b/src/pcibios.c
index 3c5f519..43eb547 100644
--- a/src/pcibios.c
+++ b/src/pcibios.c
@@ -7,10 +7,10 @@
 
 #include "types.h" // u32
 #include "util.h" // handle_1ab1
-#include "pci.h" // pci_config_readl
+#include "hw/pci.h" // pci_config_readl
 #include "bregs.h" // struct bregs
 #include "biosvar.h" // GET_GLOBAL
-#include "pci_regs.h" // PCI_VENDOR_ID
+#include "hw/pci_regs.h" // PCI_VENDOR_ID
 
 // romlayout.S
 extern void entry_bios32(void);
diff --git a/src/pciinit.c b/src/pciinit.c
index 5259853..ca32d43 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -6,9 +6,9 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "util.h" // dprintf
-#include "pci.h" // pci_config_readl
-#include "pci_ids.h" // PCI_VENDOR_ID_INTEL
-#include "pci_regs.h" // PCI_COMMAND
+#include "hw/pci.h" // pci_config_readl
+#include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL
+#include "hw/pci_regs.h" // PCI_COMMAND
 #include "ioport.h" // PORT_ATA1_CMD_BASE
 #include "config.h" // CONFIG_*
 #include "memmap.h" // add_e820
diff --git a/src/pirtable.c b/src/pirtable.c
index 02e2a67..57fb48f 100644
--- a/src/pirtable.c
+++ b/src/pirtable.c
@@ -5,7 +5,7 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "pci.h" // struct pir_header
+#include "hw/pci.h" // struct pir_header
 #include "config.h" // CONFIG_*
 #include "util.h" // checksum
 
diff --git a/src/post.c b/src/post.c
index 27f5709..9e61580 100644
--- a/src/post.c
+++ b/src/post.c
@@ -6,25 +6,25 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "config.h" // CONFIG_*
-#include "cmos.h" // CMOS_*
+#include "hw/cmos.h" // CMOS_*
 #include "util.h" // memset
 #include "biosvar.h" // struct bios_data_area_s
 #include "disk.h" // floppy_setup
-#include "ata.h" // ata_setup
-#include "ahci.h" // ahci_setup
+#include "hw/ata.h" // ata_setup
+#include "hw/ahci.h" // ahci_setup
 #include "memmap.h" // add_e820
-#include "pic.h" // pic_setup
+#include "hw/pic.h" // pic_setup
 #include "bregs.h" // struct bregs
 #include "boot.h" // boot_init
-#include "usb.h" // usb_setup
+#include "hw/usb.h" // usb_setup
 #include "paravirt.h" // qemu_cfg_preinit
 #include "xen.h" // xen_preinit
-#include "ps2port.h" // ps2port_setup
-#include "virtio-blk.h" // virtio_blk_setup
-#include "virtio-scsi.h" // virtio_scsi_setup
-#include "lsi-scsi.h" // lsi_scsi_setup
-#include "esp-scsi.h" // esp_scsi_setup
-#include "megasas.h" // megasas_setup
+#include "hw/ps2port.h" // ps2port_setup
+#include "hw/virtio-blk.h" // virtio_blk_setup
+#include "hw/virtio-scsi.h" // virtio_scsi_setup
+#include "hw/lsi-scsi.h" // lsi_scsi_setup
+#include "hw/esp-scsi.h" // esp_scsi_setup
+#include "hw/megasas.h" // megasas_setup
 #include "post.h" // interface_init
 
 
diff --git a/src/resume.c b/src/resume.c
index 48e1bd8..8ec6e37 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -6,13 +6,13 @@
 
 #include "util.h" // dprintf
 #include "ioport.h" // outb
-#include "pic.h" // pic_eoi2
+#include "hw/pic.h" // pic_eoi2
 #include "biosvar.h" // struct bios_data_area_s
 #include "bregs.h" // struct bregs
 #include "acpi.h" // find_resume_vector
-#include "ps2port.h" // i8042_reboot
-#include "pci.h" // pci_reboot
-#include "cmos.h" // inb_cmos
+#include "hw/ps2port.h" // i8042_reboot
+#include "hw/pci.h" // pci_reboot
+#include "hw/cmos.h" // inb_cmos
 
 // Indicator if POST phase has been run.
 int HaveRunPost VARFSEG;
diff --git a/src/romlayout.S b/src/romlayout.S
index 291b798..cc97f9a 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -8,7 +8,7 @@
 #include "config.h" // CONFIG_*
 #include "ioport.h" // PORT_A20
 #include "bregs.h" // CR0_*
-#include "cmos.h" // CMOS_RESET_CODE
+#include "hw/cmos.h" // CMOS_RESET_CODE
 #include "asm-offsets.h" // BREGS_*
 #include "entryfuncs.S" // ENTRY_*
 
diff --git a/src/shadow.c b/src/shadow.c
index 966e88d..67e943f 100644
--- a/src/shadow.c
+++ b/src/shadow.c
@@ -6,10 +6,10 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "util.h" // memcpy
-#include "pci.h" // pci_config_writeb
+#include "hw/pci.h" // pci_config_writeb
 #include "config.h" // CONFIG_*
-#include "pci_ids.h" // PCI_VENDOR_ID_INTEL
-#include "pci_regs.h" // PCI_VENDOR_ID
+#include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL
+#include "hw/pci_regs.h" // PCI_VENDOR_ID
 #include "paravirt.h" // runningOnXen
 #include "dev-q35.h" // PCI_VENDOR_ID_INTEL
 
diff --git a/src/smm.c b/src/smm.c
index 8abf15b..3f01207 100644
--- a/src/smm.c
+++ b/src/smm.c
@@ -5,12 +5,12 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "pci.h" // pci_config_writel
-#include "pci_regs.h" // PCI_DEVICE_ID
+#include "hw/pci.h" // pci_config_writel
+#include "hw/pci_regs.h" // PCI_DEVICE_ID
 #include "util.h" // wbinvd
 #include "config.h" // CONFIG_*
 #include "ioport.h" // outb
-#include "pci_ids.h" // PCI_VENDOR_ID_INTEL
+#include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL
 #include "dev-q35.h"
 
 extern u8 smm_relocation_start, smm_relocation_end;
diff --git a/src/smp.c b/src/smp.c
index 0b31573..6379d36 100644
--- a/src/smp.c
+++ b/src/smp.c
@@ -7,7 +7,7 @@
 
 #include "util.h" // dprintf
 #include "config.h" // CONFIG_*
-#include "cmos.h" // CMOS_BIOS_SMP_COUNT
+#include "hw/cmos.h" // CMOS_BIOS_SMP_COUNT
 
 #define APIC_ICR_LOW ((u8*)BUILD_APIC_ADDR + 0x300)
 #define APIC_SVR     ((u8*)BUILD_APIC_ADDR + 0x0F0)
diff --git a/src/system.c b/src/system.c
index 3c815b3..5269ccf 100644
--- a/src/system.c
+++ b/src/system.c
@@ -9,7 +9,7 @@
 #include "biosvar.h" // BIOS_CONFIG_TABLE
 #include "ioport.h" // inb
 #include "memmap.h" // E820_RAM
-#include "pic.h" // pic_reset
+#include "hw/pic.h" // pic_reset
 #include "bregs.h" // struct bregs
 
 // Use PS2 System Control port A to set A20 enable
diff --git a/src/util.h b/src/util.h
index 6944cfb..9b1b774 100644
--- a/src/util.h
+++ b/src/util.h
@@ -281,7 +281,7 @@ void handle_1586(struct bregs *regs);
 void useRTC(void);
 void releaseRTC(void);
 
-// timer.c
+// hw/timer.c
 void timer_setup(void);
 void pmtimer_setup(u16 ioport);
 u32 timer_calc(u32 msecs);
diff --git a/src/vgahooks.c b/src/vgahooks.c
index c9a4448..83d5a74 100644
--- a/src/vgahooks.c
+++ b/src/vgahooks.c
@@ -6,9 +6,9 @@
 
 #include "bregs.h" // set_code_invalid
 #include "biosvar.h" // GET_GLOBAL
-#include "pci.h" // pci_find_device
-#include "pci_regs.h" // PCI_VENDOR_ID
-#include "pci_ids.h" // PCI_VENDOR_ID_VIA
+#include "hw/pci.h" // pci_find_device
+#include "hw/pci_regs.h" // PCI_VENDOR_ID
+#include "hw/pci_ids.h" // PCI_VENDOR_ID_VIA
 #include "util.h" // handle_155f
 #include "config.h" // CONFIG_*
 
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index b0ba1ec..2002118 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -13,8 +13,8 @@
 #include "config.h" // CONFIG_*
 #include "biosvar.h" // GET_GLOBAL
 #include "stdvga.h" // VGAREG_SEQU_ADDRESS
-#include "pci.h" // pci_config_readl
-#include "pci_regs.h" // PCI_BASE_ADDRESS_0
+#include "hw/pci.h" // pci_config_readl
+#include "hw/pci_regs.h" // PCI_BASE_ADDRESS_0
 
 
 /****************************************************************
diff --git a/vgasrc/clext.c b/vgasrc/clext.c
index 8eb226a..012e2b1 100644
--- a/vgasrc/clext.c
+++ b/vgasrc/clext.c
@@ -11,8 +11,8 @@
 #include "util.h" // dprintf
 #include "bregs.h" // struct bregs
 #include "stdvga.h" // VGAREG_SEQU_ADDRESS
-#include "pci.h" // pci_config_readl
-#include "pci_regs.h" // PCI_BASE_ADDRESS_0
+#include "hw/pci.h" // pci_config_readl
+#include "hw/pci_regs.h" // PCI_BASE_ADDRESS_0
 
 
 /****************************************************************
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c
index e508cbd..cdc9e44 100644
--- a/vgasrc/geodevga.c
+++ b/vgasrc/geodevga.c
@@ -12,8 +12,8 @@
 #include "vgabios.h" // VGAREG_*
 #include "util.h" // memset
 #include "stdvga.h" // stdvga_crtc_write
-#include "pci.h" // pci_config_readl
-#include "pci_regs.h" // PCI_BASE_ADDRESS_0
+#include "hw/pci.h" // pci_config_readl
+#include "hw/pci_regs.h" // PCI_BASE_ADDRESS_0
 
 
 /****************************************************************
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index 987a259..506dd8d 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -15,8 +15,8 @@
 #include "clext.h" // clext_1012
 #include "vgahw.h" // vgahw_set_mode
 #include "vbe.h" // VBE_RETURN_STATUS_FAILED
-#include "pci.h" // pci_config_readw
-#include "pci_regs.h" // PCI_VENDOR_ID
+#include "hw/pci.h" // pci_config_readw
+#include "hw/pci_regs.h" // PCI_VENDOR_ID
 
 // Standard Video Save Pointer Table
 struct VideoSavePointer_s {
-- 
1.8.3.1




More information about the SeaBIOS mailing list