summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@citrix.com>2013-01-09 18:10:22 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-11 09:49:44 +0100
commitc02e1eac887b1b0aee7361b1fcf889e7d47fed9d (patch)
treeecb5c6bfc80436e1bb993d6c7827a0073beb4169 /hw
parenteb7ff6fb0bddb33991fa44586ac8e2e02019dc97 (diff)
downloadqemu-c02e1eac887b1b0aee7361b1fcf889e7d47fed9d.tar.gz
hw/pc.c: Fix converting of ioport_register* to MemoryRegion
The commit 258711 introduced MemoryRegion to replace ioport_region* for ioport 80h and F0h. A MemoryRegion needs to have both read and write callback otherwise a segfault will occur when an access is made. The previous behaviour of this both ioport is to return 0xffffffffffffffff. So keep this behaviour. Reported-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Julien Grall <julien.grall@citrix.com> Tested-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index df0c48e41b..90b1bf76d6 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -103,6 +103,11 @@ static void ioport80_write(void *opaque, hwaddr addr, uint64_t data,
{
}
+static uint64_t ioport80_read(void *opaque, hwaddr addr, unsigned size)
+{
+ return 0xffffffffffffffff;
+}
+
/* MSDOS compatibility mode FPU exception support */
static qemu_irq ferr_irq;
@@ -123,6 +128,11 @@ static void ioportF0_write(void *opaque, hwaddr addr, uint64_t data,
qemu_irq_lower(ferr_irq);
}
+static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)
+{
+ return 0xffffffffffffffff;
+}
+
/* TSC handling */
uint64_t cpu_get_tsc(CPUX86State *env)
{
@@ -960,6 +970,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
static const MemoryRegionOps ioport80_io_ops = {
.write = ioport80_write,
+ .read = ioport80_read,
.endianness = DEVICE_NATIVE_ENDIAN,
.impl = {
.min_access_size = 1,
@@ -969,6 +980,7 @@ static const MemoryRegionOps ioport80_io_ops = {
static const MemoryRegionOps ioportF0_io_ops = {
.write = ioportF0_write,
+ .read = ioportF0_read,
.endianness = DEVICE_NATIVE_ENDIAN,
.impl = {
.min_access_size = 1,