This patch series attempts to cleanup some of the include files within SeaBIOS. There are three main goals: split out the complex users of util.h into their own header files, introduce a new directory std/ for header files that just define standard bios interfaces, and make sure no header files (with the exception of util.h) have declarations for more than one c file.
At the end of this series util.h, only contains simple function and variable prototypes (ie, no macros, inline code, or struct definitions).
This series is also available at:
https://github.com/KevinOConnor/seabios/tree/testing
-Kevin
Kevin O'Connor (23): Split x86 specific functions out of util.c/h to new files x86.c/h. Move keyboard calling code from util.c to boot.c. Rename util.c to string.c and introduce string.h. Move stacks.c definitions from util.h to new file stacks.h. Move stacks.c definitions from util.h to new file stacks.h. Move romfile definitions from util.h to new file romfile.h. Move malloc code from pmm.c to new files malloc.c and malloc.h. Move function definitions for output.c from util.h to new file output.h. Move definition of struct segoff_s from farptr.h to types.h. build: Fix import of gcc dependency files. Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h. Move optionroms.h to std/optionrom.h and util.h. Move vbe.h to std/vbe.h. Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h. Move fw/smbios.h to std/smbios.h. Move fw/mptable.h to std/mptable.h. Move fw/acpi.h to std/acpi.h. Move pnpbios definition to new file std/pnpbios.h. Move pmm definitions to new file std/pmm.h. Split disk.h into block.h and std/disk.h. Move standard bda type info from biosvar.h to std/bda.h. Merge bmp.h, boot.h, jpeg.h, and post.h into util.h. Sort the sections of util.h.
Makefile | 12 +- src/apm.c | 9 +- src/biosvar.h | 161 +--------- src/block.c | 44 ++- src/block.h | 129 ++++++++ src/bmp.c | 18 +- src/bmp.h | 25 -- src/boot.c | 59 +++- src/boot.h | 26 -- src/bootsplash.c | 14 +- src/bregs.h | 21 +- src/byteorder.h | 2 + src/cdrom.c | 25 +- src/clock.c | 9 +- src/disk.c | 38 +-- src/disk.h | 292 ----------------- src/farptr.h | 10 - src/fw/acpi.c | 15 +- src/fw/biostables.c | 13 +- src/fw/coreboot.c | 16 +- src/fw/csm.c | 29 +- src/fw/csm.h | 18 -- src/fw/mptable.c | 9 +- src/fw/mtrr.c | 4 +- src/fw/paravirt.c | 18 +- src/fw/pciinit.c | 12 +- src/fw/pirtable.c | 5 +- src/fw/shadow.c | 10 +- src/fw/smbios.c | 9 +- src/fw/smm.c | 11 +- src/fw/smp.c | 6 +- src/fw/xen.c | 10 +- src/hw/ahci.c | 18 +- src/hw/ahci.h | 3 + src/hw/ata.c | 21 +- src/hw/ata.h | 4 +- src/hw/blockcmd.c | 20 +- src/hw/esp-scsi.c | 17 +- src/hw/floppy.c | 18 +- src/hw/lsi-scsi.c | 17 +- src/hw/megasas.c | 16 +- src/hw/pci.c | 14 +- src/hw/pci.h | 40 --- src/hw/pic.c | 6 +- src/hw/pic.h | 1 - src/hw/ps2port.c | 9 +- src/hw/ramdisk.c | 13 +- src/hw/timer.c | 11 +- src/hw/usb-ehci.c | 14 +- src/hw/usb-hid.c | 9 +- src/hw/usb-hub.c | 6 +- src/hw/usb-msc.c | 15 +- src/hw/usb-ohci.c | 12 +- src/hw/usb-uas.c | 13 +- src/hw/usb-uhci.c | 11 +- src/hw/usb.c | 18 +- src/hw/usb.h | 2 +- src/hw/virtio-blk.c | 13 +- src/hw/virtio-pci.c | 8 +- src/hw/virtio-ring.c | 4 +- src/hw/virtio-scsi.c | 15 +- src/jpeg.c | 3 +- src/jpeg.h | 11 - src/kbd.c | 7 +- src/malloc.c | 529 +++++++++++++++++++++++++++++++ src/malloc.h | 70 +++++ src/memmap.c | 5 +- src/misc.c | 6 +- src/mouse.c | 4 +- src/optionroms.c | 15 +- src/output.c | 6 +- src/output.h | 68 ++++ src/pcibios.c | 10 +- src/pmm.c | 573 ++-------------------------------- src/pnpbios.c | 23 +- src/post.c | 30 +- src/post.h | 10 - src/resume.c | 18 +- src/romfile.c | 5 +- src/romfile.h | 19 ++ src/romlayout.S | 2 +- src/serial.c | 4 +- src/stacks.c | 5 +- src/stacks.h | 34 ++ src/{fw => std}/LegacyBios.h | 0 src/{fw => std}/acpi.h | 10 - src/std/bda.h | 159 ++++++++++ src/std/disk.h | 177 +++++++++++ src/{fw => std}/mptable.h | 3 - src/{optionroms.h => std/optionrom.h} | 3 - src/std/pirtable.h | 35 +++ src/std/pmm.h | 19 ++ src/std/pnpbios.h | 24 ++ src/{fw => std}/smbios.h | 6 +- src/{ => std}/vbe.h | 1 - src/{util.c => string.c} | 67 +--- src/string.h | 30 ++ src/system.c | 11 +- src/types.h | 11 + src/util.h | 557 ++++++++++----------------------- src/vgahooks.c | 8 +- src/x86.c | 23 ++ src/x86.h | 168 ++++++++++ vgasrc/bochsvga.c | 10 +- vgasrc/clext.c | 9 +- vgasrc/geodevga.c | 10 +- vgasrc/stdvga.c | 2 +- vgasrc/stdvgamodes.c | 5 +- vgasrc/vbe.c | 11 +- vgasrc/vgabios.c | 18 +- vgasrc/vgafb.c | 5 +- 111 files changed, 2273 insertions(+), 2013 deletions(-) create mode 100644 src/block.h delete mode 100644 src/bmp.h delete mode 100644 src/boot.h delete mode 100644 src/disk.h delete mode 100644 src/fw/csm.h delete mode 100644 src/jpeg.h create mode 100644 src/malloc.c create mode 100644 src/malloc.h create mode 100644 src/output.h delete mode 100644 src/post.h create mode 100644 src/romfile.h create mode 100644 src/stacks.h rename src/{fw => std}/LegacyBios.h (100%) rename src/{fw => std}/acpi.h (96%) create mode 100644 src/std/bda.h create mode 100644 src/std/disk.h rename src/{fw => std}/mptable.h (96%) rename src/{optionroms.h => std/optionrom.h} (95%) create mode 100644 src/std/pirtable.h create mode 100644 src/std/pmm.h create mode 100644 src/std/pnpbios.h rename src/{fw => std}/smbios.h (97%) rename src/{ => std}/vbe.h (99%) rename src/{util.c => string.c} (76%) create mode 100644 src/string.h create mode 100644 src/x86.c create mode 100644 src/x86.h