From 3cce62435ccdab61336c6b0ec709252c79f553ba Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Thu, 18 Sep 2008 18:27:29 +0000 Subject: Key/value based qemu<->guest firmware communication mechanism (Gleb Natapov) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5256 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/pc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/pc.c') diff --git a/hw/pc.c b/hw/pc.c index 9fd1bdfd40..12b8119b2a 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -32,6 +32,7 @@ #include "smbus.h" #include "boards.h" #include "console.h" +#include "fw_cfg.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -44,6 +45,7 @@ /* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */ #define ACPI_DATA_SIZE 0x10000 +#define BIOS_CFG_IOPORT 0x510 #define MAX_IDE_BUS 2 @@ -416,6 +418,8 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) static void bochs_bios_init(void) { + void *fw_cfg; + register_ioport_write(0x400, 1, 2, bochs_bios_write, NULL); register_ioport_write(0x401, 1, 2, bochs_bios_write, NULL); register_ioport_write(0x402, 1, 1, bochs_bios_write, NULL); @@ -426,6 +430,9 @@ static void bochs_bios_init(void) register_ioport_write(0x502, 1, 2, bochs_bios_write, NULL); register_ioport_write(0x500, 1, 1, bochs_bios_write, NULL); register_ioport_write(0x503, 1, 1, bochs_bios_write, NULL); + + fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0); + fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); } /* Generate an initial boot sector which sets state and jump to -- cgit v1.2.3