The main src/ directory is getting pretty crowded - it has 133 files in the directory. This patch series breaks up the main src/ directory into three directories src/, src/hw/, and src/fw/. The idea is to put "hardware" files (eg, disk drivers, keyboard drivers, etc.) into the hw/ sub-directory and "firmware" files (mainly qemu initialization code) into the fw/ sub-directory.
After this series, there remain 52 files in the src/ directory, 49 files in the src/hw/ directory, and 34 files in the src/fw/ directory.
There are other ways to split up the code files in the repository, but splitting up by hardware, firmware, and everything else does do a good job of segmenting the files into reasonable buckets.
Thoughts? -Kevin
Kevin O'Connor (4): build: Don't use vpath makefile directive. Move code centered around specific hardware devices to src/hw/ Move code cenetered around firmware initialization to src/fw/ build: Reorder makefile source list to group like files together.
Makefile | 59 ++++++++++++++++++---------------- src/apm.c | 4 +-- src/block.c | 10 +++--- src/boot.c | 10 +++--- src/bootsplash.c | 2 +- src/cdrom.c | 4 +-- src/clock.c | 8 ++--- src/disk.c | 6 ++-- 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 | 14 ++++---- src/{ => fw}/acpi.h | 0 src/{ => fw}/biostables.c | 2 +- src/{ => fw}/coreboot.c | 2 +- src/{ => fw}/csm.c | 4 +-- src/{ => fw}/csm.h | 2 +- src/{ => fw}/dev-q35.h | 0 src/{ => fw}/lzmadecode.c | 0 src/{ => fw}/lzmadecode.h | 0 src/{ => fw}/mptable.c | 4 +-- src/{ => fw}/mptable.h | 0 src/{ => fw}/mtrr.c | 2 +- src/{ => fw}/paravirt.c | 4 +-- src/{ => fw}/paravirt.h | 0 src/{ => fw}/pciinit.c | 6 ++-- src/{ => fw}/pirtable.c | 2 +- src/{ => fw}/q35-acpi-dsdt.dsl | 0 src/{ => fw}/shadow.c | 6 ++-- src/{ => fw}/smbios.c | 0 src/{ => fw}/smbios.h | 0 src/{ => fw}/smm.c | 6 ++-- src/{ => fw}/smp.c | 2 +- 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}/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 | 2 +- src/{ => hw}/esp-scsi.h | 0 src/{ => hw}/floppy.c | 0 src/{ => hw}/lsi-scsi.c | 2 +- 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/optionroms.c | 6 ++-- src/output.c | 2 +- src/pcibios.c | 4 +-- src/post.c | 26 +++++++-------- src/resume.c | 10 +++--- src/romlayout.S | 2 +- src/system.c | 2 +- src/util.h | 16 ++++----- src/vgahooks.c | 6 ++-- vgasrc/bochsvga.c | 4 +-- vgasrc/clext.c | 4 +-- vgasrc/geodevga.c | 4 +-- vgasrc/vgabios.c | 4 +-- 107 files changed, 133 insertions(+), 130 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 (98%) rename src/{ => fw}/acpi.h (100%) rename src/{ => fw}/biostables.c (98%) rename src/{ => fw}/coreboot.c (99%) rename src/{ => fw}/csm.c (99%) rename src/{ => fw}/csm.h (94%) rename src/{ => fw}/dev-q35.h (100%) rename src/{ => fw}/lzmadecode.c (100%) rename src/{ => fw}/lzmadecode.h (100%) rename src/{ => fw}/mptable.c (99%) rename src/{ => fw}/mptable.h (100%) rename src/{ => fw}/mtrr.c (98%) rename src/{ => fw}/paravirt.c (99%) rename src/{ => fw}/paravirt.h (100%) rename src/{ => fw}/pciinit.c (99%) rename src/{ => fw}/pirtable.c (98%) rename src/{ => fw}/q35-acpi-dsdt.dsl (100%) rename src/{ => fw}/shadow.c (97%) rename src/{ => fw}/smbios.c (100%) rename src/{ => fw}/smbios.h (100%) rename src/{ => fw}/smm.c (97%) rename src/{ => fw}/smp.c (98%) 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%) 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 (99%) rename src/{ => hw}/esp-scsi.h (100%) rename src/{ => hw}/floppy.c (100%) rename src/{ => hw}/lsi-scsi.c (99%) 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%)
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- Makefile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile index 1588522..bafa246 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ SRC32FLAT=$(SRCBOTH) post.c shadow.c memmap.c pmm.c coreboot.c boot.c \ lzmadecode.c bootsplash.c jpeg.c 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
# Default compiler flags cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \ @@ -71,7 +72,7 @@ IASL:=iasl # Default targets -include $(KCONFIG_CONFIG)
-target-y = $(OUT) $(OUT)bios.bin +target-y = $(OUT) $(addprefix $(OUT), $(DIRS)) $(OUT)bios.bin target-$(CONFIG_BUILD_VGABIOS) += $(OUT)vgabios.bin
all: $(target-y) @@ -80,9 +81,6 @@ all: $(target-y) .PHONY : all clean distclean FORCE .DELETE_ON_ERROR:
-vpath %.c src vgasrc -vpath %.S src vgasrc -
################ Common build rules
@@ -125,17 +123,17 @@ $(OUT)%.lds: %.lds.S
$(OUT)asm-offsets.s: $(OUT)autoconf.h
-$(OUT)asm-offsets.h: $(OUT)asm-offsets.s +$(OUT)asm-offsets.h: $(OUT)src/asm-offsets.s @echo " Generating offset file $@" $(Q)./scripts/gen-offsets.sh $< $@
-$(OUT)ccode16.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC16)) ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@) +$(OUT)ccode16.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)src/%.o,$(SRC16)) ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@)
-$(OUT)code32seg.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC32SEG)) ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@) +$(OUT)code32seg.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)src/%.o,$(SRC32SEG)) ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@)
-$(OUT)ccode32flat.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC32FLAT)) ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@) +$(OUT)ccode32flat.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)src/%.o,$(SRC32FLAT)) ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@)
-$(OUT)romlayout.o: romlayout.S $(OUT)asm-offsets.h +$(OUT)romlayout.o: src/romlayout.S $(OUT)asm-offsets.h @echo " Compiling (16bit) $@" $(Q)$(CC) $(CFLAGS16) -c -D__ASSEMBLY__ $< -o $@
@@ -191,15 +189,15 @@ $(OUT)vgaccode16.o: $(OUT)vgaccode16.raw.s scripts/vgafixup.py $(Q)$(PYTHON) ./scripts/vgafixup.py $< $(OUT)vgaccode16.s $(Q)$(AS) --32 src/code16gcc.s $(OUT)vgaccode16.s -o $@
-$(OUT)vgaentry.o: vgaentry.S $(OUT)autoconf.h +$(OUT)vgaentry.o: vgasrc/vgaentry.S $(OUT)autoconf.h @echo " Compiling (16bit) $@" $(Q)$(CC) $(CFLAGS16VGA) -c -D__ASSEMBLY__ $< -o $@
-$(OUT)vgarom.o: $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgalayout.lds scripts/buildversion.sh +$(OUT)vgarom.o: $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgasrc/vgalayout.lds scripts/buildversion.sh @echo " Linking $@" $(Q)./scripts/buildversion.sh $(OUT)vgaversion.c VAR16 $(Q)$(CC) $(CFLAGS16VGA) -c $(OUT)vgaversion.c -o $(OUT)vgaversion.o - $(Q)$(LD) --gc-sections -T $(OUT)vgalayout.lds $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgaversion.o -o $@ + $(Q)$(LD) --gc-sections -T $(OUT)vgasrc/vgalayout.lds $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgaversion.o -o $@
$(OUT)vgabios.bin.raw: $(OUT)vgarom.o @echo " Extracting binary $@" @@ -223,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)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/acpi.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-misc.hex $(OUT)q35-acpi-dsdt.hex
################ Kconfig rules
@@ -247,7 +245,7 @@ clean: distclean: clean $(Q)rm -f .config .config.old
-$(OUT): +$(OUT) $(addprefix $(OUT), $(DIRS)): $(Q)mkdir $@
-include $(OUT)*.d
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor kevin@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 {
Move many C files from the src/ directory to the new src/fw/ directory.
Signed-off-by: Kevin O'Connor kevin@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
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- Makefile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile index ae6253c..9b7ed33 100644 --- a/Makefile +++ b/Makefile @@ -8,18 +8,23 @@ 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 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 +SRCBOTH=misc.c stacks.c output.c util.c block.c cdrom.c mouse.c kbd.c \ + serial.c clock.c resume.c pnpbios.c vgahooks.c pcibios.c apm.c \ + fw/smp.c \ + hw/pci.c hw/timer.c hw/pic.c hw/ps2port.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/usb-uas.c \ + hw/blockcmd.c hw/floppy.c hw/ata.c hw/ahci.c hw/ramdisk.c \ + hw/virtio-ring.c hw/virtio-pci.c hw/virtio-blk.c hw/virtio-scsi.c \ + hw/lsi-scsi.c hw/esp-scsi.c hw/megasas.c SRC16=$(SRCBOTH) system.c disk.c font.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 +SRC32FLAT=$(SRCBOTH) post.c memmap.c pmm.c romfile.c optionroms.c \ + boot.c bootsplash.c jpeg.c bmp.c \ + hw/usb-hub.c \ + fw/coreboot.c fw/lzmadecode.c fw/csm.c fw/biostables.c \ + fw/paravirt.c fw/shadow.c fw/pciinit.c fw/smm.c fw/mtrr.c fw/xen.c \ + fw/acpi.c fw/mptable.c fw/pirtable.c fw/smbios.c +SRC32SEG=util.c output.c pcibios.c apm.c stacks.c hw/pci.c DIRS=src src/hw src/fw vgasrc
# Default compiler flags
On Mon, Sep 02, 2013 at 09:48:17PM -0400, Kevin O'Connor wrote:
The main src/ directory is getting pretty crowded - it has 133 files in the directory. This patch series breaks up the main src/ directory into three directories src/, src/hw/, and src/fw/. The idea is to put "hardware" files (eg, disk drivers, keyboard drivers, etc.) into the hw/ sub-directory and "firmware" files (mainly qemu initialization code) into the fw/ sub-directory.
After this series, there remain 52 files in the src/ directory, 49 files in the src/hw/ directory, and 34 files in the src/fw/ directory.
There are other ways to split up the code files in the repository, but splitting up by hardware, firmware, and everything else does do a good job of segmenting the files into reasonable buckets.
FYI, I committed this change. This change will likely break some pending patches.
-Kevin