aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/pvpanic.c
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2013-04-26 11:24:44 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-30 10:30:01 -0500
commit10a584b2875a391d1036adac18955a892e56f5e3 (patch)
tree8c87ec63eae4dec13b228588a157838ccac1c230 /hw/misc/pvpanic.c
parent1dfe5057e5cf45b296ae67a7f84bdc6fa618d602 (diff)
downloadqemu-10a584b2875a391d1036adac18955a892e56f5e3.zip
qemu-10a584b2875a391d1036adac18955a892e56f5e3.tar.gz
qemu-10a584b2875a391d1036adac18955a892e56f5e3.tar.bz2
pvpanic: pass configurable ioport to seabios
This lets seabios patch the corresponding SSDT entry. Also add fw_cfg object to /machine/fw_cfg so we can reference it elsewhere. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 60c65d95fe2b23b12bea67099126566010a11a1a.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/misc/pvpanic.c')
-rw-r--r--hw/misc/pvpanic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 01cfe0b..a80fae5 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -18,6 +18,8 @@
#include "sysemu/sysemu.h"
#include "qemu/log.h"
+#include "hw/nvram/fw_cfg.h"
+
/* The bit of supported pv event */
#define PVPANIC_F_PANICKED 0
@@ -86,10 +88,22 @@ static const MemoryRegionOps pvpanic_ops = {
static int pvpanic_isa_initfn(ISADevice *dev)
{
PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
+ static bool port_configured;
+ void *fw_cfg;
memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1);
isa_register_ioport(dev, &s->io, s->ioport);
+ if (!port_configured) {
+ fw_cfg = object_resolve_path("/machine/fw_cfg", NULL);
+ if (fw_cfg) {
+ fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",
+ g_memdup(&s->ioport, sizeof(s->ioport)),
+ sizeof(s->ioport));
+ port_configured = true;
+ }
+ }
+
return 0;
}