Move code cenetered around firmware initialization to src/fw/
Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
5d369d8d9e
commit
ccee6e8491
16
Makefile
16
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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
/****************************************************************
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
14
src/util.h
14
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
|
||||
|
|
Loading…
Reference in New Issue