summaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-18 18:27:29 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-18 18:27:29 +0000
commit3cce62435ccdab61336c6b0ec709252c79f553ba (patch)
treee5eac803b085d5354ada0a8dfb3339b9f9c4de64 /hw/pc.c
parentb03d0971b3744cf5778264c9aedb4084f779c774 (diff)
downloadqemu-3cce62435ccdab61336c6b0ec709252c79f553ba.tar.gz
qemu-3cce62435ccdab61336c6b0ec709252c79f553ba.tar.bz2
qemu-3cce62435ccdab61336c6b0ec709252c79f553ba.zip
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
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c7
1 files changed, 7 insertions, 0 deletions
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