[SeaBIOS] [PATCH 3/4] Move code cenetered around firmware initialization to src/fw/

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


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

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 Makefile                               | 16 ++++++++--------
 src/apm.c                              |  4 ++--
 src/boot.c                             |  4 ++--
 src/bootsplash.c                       |  2 +-
 src/{ => fw}/LegacyBios.h              |  0
 src/{ => fw}/acpi-dsdt-cpu-hotplug.dsl |  0
 src/{ => fw}/acpi-dsdt-dbug.dsl        |  0
 src/{ => fw}/acpi-dsdt-hpet.dsl        |  0
 src/{ => fw}/acpi-dsdt-isa.dsl         |  0
 src/{ => fw}/acpi-dsdt-pci-crs.dsl     |  0
 src/{ => fw}/acpi-dsdt.dsl             |  0
 src/{ => fw}/acpi.c                    |  8 ++++----
 src/{ => fw}/acpi.h                    |  0
 src/{ => fw}/biostables.c              |  0
 src/{ => fw}/coreboot.c                |  0
 src/{ => fw}/csm.c                     |  0
 src/{ => fw}/csm.h                     |  0
 src/{ => fw}/dev-q35.h                 |  0
 src/{ => fw}/lzmadecode.c              |  0
 src/{ => fw}/lzmadecode.h              |  0
 src/{ => fw}/mptable.c                 |  0
 src/{ => fw}/mptable.h                 |  0
 src/{ => fw}/mtrr.c                    |  0
 src/{ => fw}/paravirt.c                |  0
 src/{ => fw}/paravirt.h                |  0
 src/{ => fw}/pciinit.c                 |  0
 src/{ => fw}/pirtable.c                |  0
 src/{ => fw}/q35-acpi-dsdt.dsl         |  0
 src/{ => fw}/shadow.c                  |  0
 src/{ => fw}/smbios.c                  |  0
 src/{ => fw}/smbios.h                  |  0
 src/{ => fw}/smm.c                     |  0
 src/{ => fw}/smp.c                     |  0
 src/{ => fw}/ssdt-misc.dsl             |  0
 src/{ => fw}/ssdt-pcihp.dsl            |  0
 src/{ => fw}/ssdt-proc.dsl             |  0
 src/{ => fw}/xen.c                     |  0
 src/{ => fw}/xen.h                     |  0
 src/hw/esp-scsi.c                      |  2 +-
 src/hw/lsi-scsi.c                      |  2 +-
 src/output.c                           |  2 +-
 src/post.c                             |  4 ++--
 src/resume.c                           |  2 +-
 src/util.h                             | 14 +++++++-------
 44 files changed, 30 insertions(+), 30 deletions(-)
 rename src/{ => fw}/LegacyBios.h (100%)
 rename src/{ => fw}/acpi-dsdt-cpu-hotplug.dsl (100%)
 rename src/{ => fw}/acpi-dsdt-dbug.dsl (100%)
 rename src/{ => fw}/acpi-dsdt-hpet.dsl (100%)
 rename src/{ => fw}/acpi-dsdt-isa.dsl (100%)
 rename src/{ => fw}/acpi-dsdt-pci-crs.dsl (100%)
 rename src/{ => fw}/acpi-dsdt.dsl (100%)
 rename src/{ => fw}/acpi.c (99%)
 rename src/{ => fw}/acpi.h (100%)
 rename src/{ => fw}/biostables.c (100%)
 rename src/{ => fw}/coreboot.c (100%)
 rename src/{ => fw}/csm.c (100%)
 rename src/{ => fw}/csm.h (100%)
 rename src/{ => fw}/dev-q35.h (100%)
 rename src/{ => fw}/lzmadecode.c (100%)
 rename src/{ => fw}/lzmadecode.h (100%)
 rename src/{ => fw}/mptable.c (100%)
 rename src/{ => fw}/mptable.h (100%)
 rename src/{ => fw}/mtrr.c (100%)
 rename src/{ => fw}/paravirt.c (100%)
 rename src/{ => fw}/paravirt.h (100%)
 rename src/{ => fw}/pciinit.c (100%)
 rename src/{ => fw}/pirtable.c (100%)
 rename src/{ => fw}/q35-acpi-dsdt.dsl (100%)
 rename src/{ => fw}/shadow.c (100%)
 rename src/{ => fw}/smbios.c (100%)
 rename src/{ => fw}/smbios.h (100%)
 rename src/{ => fw}/smm.c (100%)
 rename src/{ => fw}/smp.c (100%)
 rename src/{ => fw}/ssdt-misc.dsl (100%)
 rename src/{ => fw}/ssdt-pcihp.dsl (100%)
 rename src/{ => fw}/ssdt-proc.dsl (100%)
 rename src/{ => fw}/xen.c (100%)
 rename src/{ => fw}/xen.h (100%)

diff --git a/Makefile b/Makefile
index a43fa14..ae6253c 100644
--- a/Makefile
+++ b/Makefile
@@ -9,18 +9,18 @@ OUT=out/
 
 # Source files
 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 \
+    kbd.c hw/pci.c serial.c hw/timer.c clock.c hw/pic.c cdrom.c hw/ps2port.c fw/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 hw/usb-hub.c paravirt.c \
-    biostables.c xen.c bmp.c romfile.c csm.c
+SRC32FLAT=$(SRCBOTH) post.c fw/shadow.c memmap.c pmm.c fw/coreboot.c boot.c \
+    fw/acpi.c fw/smm.c fw/mptable.c fw/pirtable.c fw/smbios.c fw/pciinit.c optionroms.c fw/mtrr.c \
+    fw/lzmadecode.c bootsplash.c jpeg.c hw/usb-hub.c fw/paravirt.c \
+    fw/biostables.c fw/xen.c bmp.c romfile.c fw/csm.c
 SRC32SEG=util.c output.c hw/pci.c pcibios.c apm.c stacks.c
-DIRS=src src/hw vgasrc
+DIRS=src src/hw src/fw vgasrc
 
 # Default compiler flags
 cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
@@ -213,7 +213,7 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw scripts/buildrom.py
 iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
     ; then echo "$(2)"; else echo "$(3)"; fi ;)
 
-$(OUT)%.hex: src/%.dsl ./scripts/acpi_extract_preprocess.py ./scripts/acpi_extract.py
+$(OUT)%.hex: %.dsl ./scripts/acpi_extract_preprocess.py ./scripts/acpi_extract.py
 	@echo "  Compiling IASL $@"
 	$(Q)$(CPP) $(CPPFLAGS) $< -o $(OUT)$*.dsl.i.orig
 	$(Q)$(PYTHON) ./scripts/acpi_extract_preprocess.py $(OUT)$*.dsl.i.orig > $(OUT)$*.dsl.i
@@ -221,7 +221,7 @@ $(OUT)%.hex: src/%.dsl ./scripts/acpi_extract_preprocess.py ./scripts/acpi_extra
 	$(Q)$(PYTHON) ./scripts/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
-$(OUT)src/acpi.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-misc.hex $(OUT)q35-acpi-dsdt.hex
+$(OUT)src/fw/acpi.o: $(OUT)src/fw/acpi-dsdt.hex $(OUT)src/fw/ssdt-proc.hex $(OUT)src/fw/ssdt-pcihp.hex $(OUT)src/fw/ssdt-misc.hex $(OUT)src/fw/q35-acpi-dsdt.hex
 
 ################ Kconfig rules
 
diff --git a/src/apm.c b/src/apm.c
index de6bd99..211424c 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -11,8 +11,8 @@
 #include "util.h" // dprintf
 #include "config.h" // CONFIG_*
 #include "biosvar.h" // GET_GLOBAL
-#include "paravirt.h" // runningOnQEMU
-#include "acpi.h" // acpi_pm_ctl
+#include "fw/paravirt.h" // runningOnQEMU
+#include "fw/acpi.h" // acpi_pm_ctl
 
 static void
 out_str(const char *str_cs)
diff --git a/src/boot.c b/src/boot.c
index 4d8f161..bbe9155 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -11,10 +11,10 @@
 #include "bregs.h" // struct bregs
 #include "boot.h" // func defs
 #include "hw/cmos.h" // inb_cmos
-#include "paravirt.h" // qemu_cfg_show_boot_menu
+#include "fw/paravirt.h" // qemu_cfg_show_boot_menu
 #include "hw/pci.h" // pci_bdf_to_*
 #include "hw/usb.h" // struct usbdevice_s
-#include "csm.h" // csm_bootprio_*
+#include "fw/csm.h" // csm_bootprio_*
 #include "list.h" // hlist_node
 
 
diff --git a/src/bootsplash.c b/src/bootsplash.c
index 84fca7f..bd91102 100644
--- a/src/bootsplash.c
+++ b/src/bootsplash.c
@@ -12,7 +12,7 @@
 #include "jpeg.h" // splash
 #include "vbe.h" // struct vbe_info
 #include "bmp.h" // bmp_alloc
-#include "smbios.h" // display_uuid
+#include "fw/smbios.h" // display_uuid
 
 
 /****************************************************************
diff --git a/src/LegacyBios.h b/src/fw/LegacyBios.h
similarity index 100%
rename from src/LegacyBios.h
rename to src/fw/LegacyBios.h
diff --git a/src/acpi-dsdt-cpu-hotplug.dsl b/src/fw/acpi-dsdt-cpu-hotplug.dsl
similarity index 100%
rename from src/acpi-dsdt-cpu-hotplug.dsl
rename to src/fw/acpi-dsdt-cpu-hotplug.dsl
diff --git a/src/acpi-dsdt-dbug.dsl b/src/fw/acpi-dsdt-dbug.dsl
similarity index 100%
rename from src/acpi-dsdt-dbug.dsl
rename to src/fw/acpi-dsdt-dbug.dsl
diff --git a/src/acpi-dsdt-hpet.dsl b/src/fw/acpi-dsdt-hpet.dsl
similarity index 100%
rename from src/acpi-dsdt-hpet.dsl
rename to src/fw/acpi-dsdt-hpet.dsl
diff --git a/src/acpi-dsdt-isa.dsl b/src/fw/acpi-dsdt-isa.dsl
similarity index 100%
rename from src/acpi-dsdt-isa.dsl
rename to src/fw/acpi-dsdt-isa.dsl
diff --git a/src/acpi-dsdt-pci-crs.dsl b/src/fw/acpi-dsdt-pci-crs.dsl
similarity index 100%
rename from src/acpi-dsdt-pci-crs.dsl
rename to src/fw/acpi-dsdt-pci-crs.dsl
diff --git a/src/acpi-dsdt.dsl b/src/fw/acpi-dsdt.dsl
similarity index 100%
rename from src/acpi-dsdt.dsl
rename to src/fw/acpi-dsdt.dsl
diff --git a/src/acpi.c b/src/fw/acpi.c
similarity index 99%
rename from src/acpi.c
rename to src/fw/acpi.c
index 774ff95..9fd1c05 100644
--- a/src/acpi.c
+++ b/src/fw/acpi.c
@@ -16,7 +16,7 @@
 #include "paravirt.h" // RamSize
 #include "dev-q35.h"
 
-#include "acpi-dsdt.hex"
+#include "src/fw/acpi-dsdt.hex"
 
 u32 acpi_pm1a_cnt VARFSEG;
 
@@ -234,7 +234,7 @@ encodeLen(u8 *ssdt_ptr, int length, int bytes)
     return ssdt_ptr + bytes;
 }
 
-#include "ssdt-proc.hex"
+#include "src/fw/ssdt-proc.hex"
 
 /* 0x5B 0x83 ProcessorOp PkgLength NameString ProcID */
 #define PROC_OFFSET_CPUHEX (*ssdt_proc_name - *ssdt_proc_start + 2)
@@ -255,8 +255,8 @@ encodeLen(u8 *ssdt_ptr, int length, int bytes)
 #define SSDT_SIGNATURE 0x54445353 // SSDT
 #define SSDT_HEADER_LENGTH 36
 
-#include "ssdt-misc.hex"
-#include "ssdt-pcihp.hex"
+#include "src/fw/ssdt-misc.hex"
+#include "src/fw/ssdt-pcihp.hex"
 
 #define PCI_RMV_BASE 0xae0c
 
diff --git a/src/acpi.h b/src/fw/acpi.h
similarity index 100%
rename from src/acpi.h
rename to src/fw/acpi.h
diff --git a/src/biostables.c b/src/fw/biostables.c
similarity index 100%
rename from src/biostables.c
rename to src/fw/biostables.c
diff --git a/src/coreboot.c b/src/fw/coreboot.c
similarity index 100%
rename from src/coreboot.c
rename to src/fw/coreboot.c
diff --git a/src/csm.c b/src/fw/csm.c
similarity index 100%
rename from src/csm.c
rename to src/fw/csm.c
diff --git a/src/csm.h b/src/fw/csm.h
similarity index 100%
rename from src/csm.h
rename to src/fw/csm.h
diff --git a/src/dev-q35.h b/src/fw/dev-q35.h
similarity index 100%
rename from src/dev-q35.h
rename to src/fw/dev-q35.h
diff --git a/src/lzmadecode.c b/src/fw/lzmadecode.c
similarity index 100%
rename from src/lzmadecode.c
rename to src/fw/lzmadecode.c
diff --git a/src/lzmadecode.h b/src/fw/lzmadecode.h
similarity index 100%
rename from src/lzmadecode.h
rename to src/fw/lzmadecode.h
diff --git a/src/mptable.c b/src/fw/mptable.c
similarity index 100%
rename from src/mptable.c
rename to src/fw/mptable.c
diff --git a/src/mptable.h b/src/fw/mptable.h
similarity index 100%
rename from src/mptable.h
rename to src/fw/mptable.h
diff --git a/src/mtrr.c b/src/fw/mtrr.c
similarity index 100%
rename from src/mtrr.c
rename to src/fw/mtrr.c
diff --git a/src/paravirt.c b/src/fw/paravirt.c
similarity index 100%
rename from src/paravirt.c
rename to src/fw/paravirt.c
diff --git a/src/paravirt.h b/src/fw/paravirt.h
similarity index 100%
rename from src/paravirt.h
rename to src/fw/paravirt.h
diff --git a/src/pciinit.c b/src/fw/pciinit.c
similarity index 100%
rename from src/pciinit.c
rename to src/fw/pciinit.c
diff --git a/src/pirtable.c b/src/fw/pirtable.c
similarity index 100%
rename from src/pirtable.c
rename to src/fw/pirtable.c
diff --git a/src/q35-acpi-dsdt.dsl b/src/fw/q35-acpi-dsdt.dsl
similarity index 100%
rename from src/q35-acpi-dsdt.dsl
rename to src/fw/q35-acpi-dsdt.dsl
diff --git a/src/shadow.c b/src/fw/shadow.c
similarity index 100%
rename from src/shadow.c
rename to src/fw/shadow.c
diff --git a/src/smbios.c b/src/fw/smbios.c
similarity index 100%
rename from src/smbios.c
rename to src/fw/smbios.c
diff --git a/src/smbios.h b/src/fw/smbios.h
similarity index 100%
rename from src/smbios.h
rename to src/fw/smbios.h
diff --git a/src/smm.c b/src/fw/smm.c
similarity index 100%
rename from src/smm.c
rename to src/fw/smm.c
diff --git a/src/smp.c b/src/fw/smp.c
similarity index 100%
rename from src/smp.c
rename to src/fw/smp.c
diff --git a/src/ssdt-misc.dsl b/src/fw/ssdt-misc.dsl
similarity index 100%
rename from src/ssdt-misc.dsl
rename to src/fw/ssdt-misc.dsl
diff --git a/src/ssdt-pcihp.dsl b/src/fw/ssdt-pcihp.dsl
similarity index 100%
rename from src/ssdt-pcihp.dsl
rename to src/fw/ssdt-pcihp.dsl
diff --git a/src/ssdt-proc.dsl b/src/fw/ssdt-proc.dsl
similarity index 100%
rename from src/ssdt-proc.dsl
rename to src/fw/ssdt-proc.dsl
diff --git a/src/xen.c b/src/fw/xen.c
similarity index 100%
rename from src/xen.c
rename to src/fw/xen.c
diff --git a/src/xen.h b/src/fw/xen.h
similarity index 100%
rename from src/xen.h
rename to src/fw/xen.h
diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c
index fe70366..42a790f 100644
--- a/src/hw/esp-scsi.c
+++ b/src/hw/esp-scsi.c
@@ -18,7 +18,7 @@
 #include "pci_regs.h" // PCI_VENDOR_ID
 #include "boot.h" // bootprio_find_scsi_device
 #include "blockcmd.h" // scsi_drive_setup
-#include "paravirt.h" // runningOnQEMU
+#include "fw/paravirt.h" // runningOnQEMU
 #include "disk.h"
 
 #define ESP_TCLO      0x00
diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c
index 305610a..cebe967 100644
--- a/src/hw/lsi-scsi.c
+++ b/src/hw/lsi-scsi.c
@@ -18,7 +18,7 @@
 #include "pci_regs.h" // PCI_VENDOR_ID
 #include "boot.h" // bootprio_find_scsi_device
 #include "blockcmd.h" // scsi_drive_setup
-#include "paravirt.h" // runningOnQEMU
+#include "fw/paravirt.h" // runningOnQEMU
 #include "disk.h"
 
 #define LSI_REG_DSTAT     0x0c
diff --git a/src/output.c b/src/output.c
index fb2dd76..8b63d9a 100644
--- a/src/output.c
+++ b/src/output.c
@@ -11,7 +11,7 @@
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "biosvar.h" // GET_GLOBAL
-#include "paravirt.h" // PlatformRunningOn
+#include "fw/paravirt.h" // PlatformRunningOn
 
 struct putcinfo {
     void (*func)(struct putcinfo *info, char c);
diff --git a/src/post.c b/src/post.c
index 9e61580..7d6fbd2 100644
--- a/src/post.c
+++ b/src/post.c
@@ -17,8 +17,8 @@
 #include "bregs.h" // struct bregs
 #include "boot.h" // boot_init
 #include "hw/usb.h" // usb_setup
-#include "paravirt.h" // qemu_cfg_preinit
-#include "xen.h" // xen_preinit
+#include "fw/paravirt.h" // qemu_cfg_preinit
+#include "fw/xen.h" // xen_preinit
 #include "hw/ps2port.h" // ps2port_setup
 #include "hw/virtio-blk.h" // virtio_blk_setup
 #include "hw/virtio-scsi.h" // virtio_scsi_setup
diff --git a/src/resume.c b/src/resume.c
index 8ec6e37..5323d7e 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -9,7 +9,7 @@
 #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 "fw/acpi.h" // find_resume_vector
 #include "hw/ps2port.h" // i8042_reboot
 #include "hw/pci.h" // pci_reboot
 #include "hw/cmos.h" // inb_cmos
diff --git a/src/util.h b/src/util.h
index 9b1b774..f2a1671 100644
--- a/src/util.h
+++ b/src/util.h
@@ -307,27 +307,27 @@ void handle_1553(struct bregs *regs);
 void handle_1ab1(struct bregs *regs);
 void bios32_init(void);
 
-// shadow.c
+// fw/shadow.c
 void make_bios_writable(void);
 void make_bios_readonly(void);
 void qemu_prep_reset(void);
 
-// pciinit.c
+// fw/pciinit.c
 extern const u8 pci_irqs[4];
 void pci_setup(void);
 
-// smm.c
+// fw/smm.c
 void smm_device_setup(void);
 void smm_setup(void);
 
-// smp.c
+// fw/smp.c
 extern u32 CountCPUs;
 extern u32 MaxCountCPUs;
 void wrmsr_smp(u32 index, u64 val);
 void smp_setup(void);
 int apic_id_is_present(u8 apic_id);
 
-// coreboot.c
+// fw/coreboot.c
 extern const char *CBvendor, *CBpart;
 struct cbfs_file;
 void debug_cbmem(char c);
@@ -337,7 +337,7 @@ void cbfs_payload_setup(void);
 void coreboot_preinit(void);
 void coreboot_cbfs_init(void);
 
-// biostable.c
+// fw/biostable.c
 void copy_smbios(void *pos);
 void copy_table(void *pos);
 
@@ -431,7 +431,7 @@ static inline void free(void *data) {
     pmm_free(data);
 }
 
-// mtrr.c
+// fw/mtrr.c
 void mtrr_setup(void);
 
 // romfile.c
-- 
1.8.3.1




More information about the SeaBIOS mailing list