summary refs log tree commit diff stats
path: root/hw/misc/slavio_misc.c
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2015-04-02 16:09:30 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-04-27 18:24:18 +0200
commit0e1cd6576c55269b6e5251dc739a7fc819f9b4a6 (patch)
treec4e7c6b871601f75647744b6b059354626f1e0e9 /hw/misc/slavio_misc.c
parent339240b5cd42bd13d4f6629f2aedf8b4b07459fb (diff)
downloadfocaccia-qemu-0e1cd6576c55269b6e5251dc739a7fc819f9b4a6.tar.gz
focaccia-qemu-0e1cd6576c55269b6e5251dc739a7fc819f9b4a6.zip
sun4m: fix slavio sysctrl and led register sizes
These were being incorrectly declared as MISC_SIZE (1 byte) rather than
4 bytes and 2 bytes respectively. As a result accesses clamped to the
real register size would unexpectedly fail.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1427987370-15897-1-git-send-email-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/misc/slavio_misc.c')
-rw-r--r--hw/misc/slavio_misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c
index 50985958a4..ec50f10757 100644
--- a/hw/misc/slavio_misc.c
+++ b/hw/misc/slavio_misc.c
@@ -68,6 +68,7 @@ typedef struct APCState {
 } APCState;
 
 #define MISC_SIZE 1
+#define LED_SIZE 2
 #define SYSCTRL_SIZE 4
 
 #define AUX1_TC        0x02
@@ -452,13 +453,13 @@ static int slavio_misc_init1(SysBusDevice *sbd)
     /* 16 bit registers */
     /* ss600mp diag LEDs */
     memory_region_init_io(&s->led_iomem, OBJECT(s), &slavio_led_mem_ops, s,
-                          "leds", MISC_SIZE);
+                          "leds", LED_SIZE);
     sysbus_init_mmio(sbd, &s->led_iomem);
 
     /* 32 bit registers */
     /* System control */
     memory_region_init_io(&s->sysctrl_iomem, OBJECT(s), &slavio_sysctrl_mem_ops, s,
-                          "system-control", MISC_SIZE);
+                          "system-control", SYSCTRL_SIZE);
     sysbus_init_mmio(sbd, &s->sysctrl_iomem);
 
     /* AUX 1 (Misc System Functions) */