summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-06-16 23:48:42 +0300
committerMichael S. Tsirkin <mst@redhat.com>2013-07-04 10:42:51 +0300
commitfea7d5966a54a5e5400cd38897a95ea576b5af4d (patch)
tree17841e7aa7e6a5f45f41d7ca174abf79b60168d7
parentbc3e6a0d6c8ab6cd7cd4b576ed567756f1dcabd2 (diff)
pvpanic: fix fwcfg for big endian hosts
Convert port number to little endian when exposing it in fw cfg. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/misc/pvpanic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 83ed226081..792d8e48ba 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -104,10 +104,11 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp)
static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
{
PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
+ uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port));
+ *pvpanic_port = cpu_to_le16(s->ioport);
- fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",
- g_memdup(&s->ioport, sizeof(s->ioport)),
- sizeof(s->ioport));
+ fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
+ sizeof(*pvpanic_port));
}
void pvpanic_init(ISABus *bus)