aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsshwarts <sshwarts>2008-10-15 19:04:09 +0000
committersshwarts <sshwarts>2008-10-15 19:04:09 +0000
commit8ec3c2b45610a81adefff8224bf28dd2f629449c (patch)
treed4c25448a3085f52d410287ced71bf85001a81bf /kvm/bios/rombios32.c
parentThis one is easy :) (diff)
downloadqemu-kvm-8ec3c2b45610a81adefff8224bf28dd2f629449c.tar.gz
qemu-kvm-8ec3c2b45610a81adefff8224bf28dd2f629449c.tar.bz2
qemu-kvm-8ec3c2b45610a81adefff8224bf28dd2f629449c.zip
QEMU UUID support - QEMU only is affected
Diffstat (limited to 'kvm/bios/rombios32.c')
-rw-r--r--kvm/bios/rombios32.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/kvm/bios/rombios32.c b/kvm/bios/rombios32.c
index 133009115..3410f3e7e 100644
--- a/kvm/bios/rombios32.c
+++ b/kvm/bios/rombios32.c
@@ -393,8 +393,50 @@ int pm_sci_int;
unsigned long bios_table_cur_addr;
unsigned long bios_table_end_addr;
+#ifdef BX_QEMU
+#define QEMU_CFG_CTL_PORT 0x510
+#define QEMU_CFG_DATA_PORT 0x511
+#define QEMU_CFG_SIGNATURE 0x00
+#define QEMU_CFG_ID 0x01
+#define QEMU_CFG_UUID 0x02
+
+int qemu_cfg_port;
+
+void qemu_cfg_select(int f)
+{
+ outw(QEMU_CFG_CTL_PORT, f);
+}
+
+int qemu_cfg_port_probe()
+{
+ char *sig = "QEMU";
+ int i;
+
+ qemu_cfg_select(QEMU_CFG_SIGNATURE);
+
+ for (i = 0; i < 4; i++)
+ if (inb(QEMU_CFG_DATA_PORT) != sig[i])
+ return 0;
+
+ return 1;
+}
+
+void qemu_cfg_read(uint8_t *buf, int len)
+{
+ while (len--)
+ *(buf++) = inb(QEMU_CFG_DATA_PORT);
+}
+#endif
+
void uuid_probe(void)
{
+#ifdef BX_QEMU
+ if(qemu_cfg_port) {
+ qemu_cfg_select(QEMU_CFG_UUID);
+ qemu_cfg_read(bios_uuid, 16);
+ return;
+ }
+#endif
memset(bios_uuid, 0, 16);
}
@@ -1973,6 +2015,10 @@ void rombios32_init(void)
{
BX_INFO("Starting rombios32\n");
+#ifdef BX_QEMU
+ qemu_cfg_port = qemu_cfg_port_probe();
+#endif
+
ram_probe();
cpu_probe();