Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/boot.c | 1 - src/fw/csm.c | 6 +++++- src/fw/csm.h | 18 ------------------ src/{fw => std}/LegacyBios.h | 0 src/util.h | 7 ++++++- 5 files changed, 11 insertions(+), 21 deletions(-) delete mode 100644 src/fw/csm.h rename src/{fw => std}/LegacyBios.h (100%)
diff --git a/src/boot.c b/src/boot.c index 1cb49d4..fbfbf34 100644 --- a/src/boot.c +++ b/src/boot.c @@ -9,7 +9,6 @@ #include "bregs.h" // struct bregs #include "config.h" // CONFIG_* #include "disk.h" // cdrom_boot -#include "fw/csm.h" // csm_bootprio_* #include "fw/paravirt.h" // qemu_cfg_show_boot_menu #include "hw/cmos.h" // inb_cmos #include "hw/pci.h" // pci_bdf_to_* diff --git a/src/fw/csm.c b/src/fw/csm.c index b98dc96..7829c1e 100644 --- a/src/fw/csm.c +++ b/src/fw/csm.c @@ -9,7 +9,6 @@ #include "boot.h" #include "bregs.h" #include "config.h" // CONFIG_* -#include "csm.h" #include "hw/pci.h" #include "hw/pic.h" #include "malloc.h" // csm_malloc_preinit @@ -21,6 +20,11 @@ #include "std/optionrom.h" // struct rom_header #include "util.h" // copy_smbios
+#define UINT8 u8 +#define UINT16 u16 +#define UINT32 u32 +#include "std/LegacyBios.h" + struct rsdp_descriptor csm_rsdp VARFSEG __aligned(16);
EFI_COMPATIBILITY16_TABLE csm_compat_table VARFSEG __aligned(16) = { diff --git a/src/fw/csm.h b/src/fw/csm.h deleted file mode 100644 index 997e3f7..0000000 --- a/src/fw/csm.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __CSM_H -#define __CSM_H - -#include "types.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); - -#include "LegacyBios.h" - -#endif // __CSM_H diff --git a/src/fw/LegacyBios.h b/src/std/LegacyBios.h similarity index 100% rename from src/fw/LegacyBios.h rename to src/std/LegacyBios.h diff --git a/src/util.h b/src/util.h index 06483ba..dfd6faf 100644 --- a/src/util.h +++ b/src/util.h @@ -55,6 +55,12 @@ void callrom(struct rom_header *rom, u16 bdf); void handle_1ab1(struct bregs *regs); void bios32_init(void);
+// fw/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); + // fw/shadow.c void make_bios_writable(void); void make_bios_readonly(void); @@ -95,7 +101,6 @@ void copy_table(void *pos);
// vgahooks.c void handle_155f(struct bregs *regs); -struct pci_device; void vgahook_setup(struct pci_device *pci);
// optionroms.c