Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/paravirt.c | 26 +++++++++++++++++++++++++- src/paravirt.h | 21 --------------------- 2 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/src/paravirt.c b/src/paravirt.c index 7080c7f..cc64094 100644 --- a/src/paravirt.c +++ b/src/paravirt.c @@ -19,7 +19,11 @@ #include "mptable.h" // mptable_setup #include "pci.h" // create_pirtable
-int qemu_cfg_present; +struct e820_reservation { + u64 address; + u64 length; + u32 type; +};
/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It * should be used to determine that a VM is running under KVM. @@ -102,6 +106,26 @@ qemu_biostable_setup(void) acpi_setup(); }
+ +/**************************************************************** + * QEMU firmware config (fw_cfg) interface + ****************************************************************/ + +int qemu_cfg_present; + +#define QEMU_CFG_SIGNATURE 0x00 +#define QEMU_CFG_ID 0x01 +#define QEMU_CFG_UUID 0x02 +#define QEMU_CFG_NUMA 0x0d +#define QEMU_CFG_BOOT_MENU 0x0e +#define QEMU_CFG_MAX_CPUS 0x0f +#define QEMU_CFG_FILE_DIR 0x19 +#define QEMU_CFG_ARCH_LOCAL 0x8000 +#define QEMU_CFG_ACPI_TABLES (QEMU_CFG_ARCH_LOCAL + 0) +#define QEMU_CFG_SMBIOS_ENTRIES (QEMU_CFG_ARCH_LOCAL + 1) +#define QEMU_CFG_IRQ0_OVERRIDE (QEMU_CFG_ARCH_LOCAL + 2) +#define QEMU_CFG_E820_TABLE (QEMU_CFG_ARCH_LOCAL + 3) + static void qemu_cfg_select(u16 f) { diff --git a/src/paravirt.h b/src/paravirt.h index 208d0fb..a3da04d 100644 --- a/src/paravirt.h +++ b/src/paravirt.h @@ -23,22 +23,6 @@ static inline int runningOnKVM(void) { return CONFIG_QEMU && GET_GLOBAL(PlatformRunningOn) & PF_KVM; }
-// QEMU "firmware config (fw_cfg)" interface -#define QEMU_CFG_SIGNATURE 0x00 -#define QEMU_CFG_ID 0x01 -#define QEMU_CFG_UUID 0x02 -#define QEMU_CFG_NUMA 0x0d -#define QEMU_CFG_BOOT_MENU 0x0e -#define QEMU_CFG_MAX_CPUS 0x0f -#define QEMU_CFG_FILE_DIR 0x19 -#define QEMU_CFG_ARCH_LOCAL 0x8000 -#define QEMU_CFG_ACPI_TABLES (QEMU_CFG_ARCH_LOCAL + 0) -#define QEMU_CFG_SMBIOS_ENTRIES (QEMU_CFG_ARCH_LOCAL + 1) -#define QEMU_CFG_IRQ0_OVERRIDE (QEMU_CFG_ARCH_LOCAL + 2) -#define QEMU_CFG_E820_TABLE (QEMU_CFG_ARCH_LOCAL + 3) - -extern int qemu_cfg_present; - void qemu_ramsize_preinit(void); void qemu_biostable_setup(void); void qemu_cfg_preinit(void); @@ -55,11 +39,6 @@ int qemu_cfg_smbios_load_external(int type, char **p, unsigned *nr_structs, int qemu_cfg_get_numa_nodes(void); void qemu_cfg_get_numa_data(u64 *data, int n); u16 qemu_cfg_get_max_cpus(void); -struct e820_reservation { - u64 address; - u64 length; - u32 type; -}; u32 qemu_cfg_e820_entries(void); void* qemu_cfg_e820_load_next(void *addr); void qemu_romfile_init(void);