aboutsummaryrefslogtreecommitdiff
path: root/hw/slavio_misc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-10-30 17:24:19 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-10-30 17:24:19 +0000
commit4e3b1ea1b87237827905292fdb59917ccd252f5c (patch)
treec27616cc75543b62f0651d58c0585ff009632f9f /hw/slavio_misc.c
parent4f6200f03b32d1cb166c2b85c97e857109dd8f9d (diff)
downloadqemu-4e3b1ea1b87237827905292fdb59917ccd252f5c.zip
qemu-4e3b1ea1b87237827905292fdb59917ccd252f5c.tar.gz
qemu-4e3b1ea1b87237827905292fdb59917ccd252f5c.tar.bz2
sparc merge (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1578 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/slavio_misc.c')
-rw-r--r--hw/slavio_misc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c
index 597a0cb..1b681be 100644
--- a/hw/slavio_misc.c
+++ b/hw/slavio_misc.c
@@ -44,7 +44,7 @@ typedef struct MiscState {
int irq;
uint8_t config;
uint8_t aux1, aux2;
- uint8_t diag, mctrl;
+ uint8_t diag, mctrl, sysctrl;
} MiscState;
#define MISC_MAXADDR 1
@@ -64,7 +64,7 @@ static void slavio_misc_reset(void *opaque)
{
MiscState *s = opaque;
- // Diagnostic register not cleared in reset
+ // Diagnostic and system control registers not cleared in reset
s->config = s->aux1 = s->aux2 = s->mctrl = 0;
}
@@ -116,8 +116,10 @@ static void slavio_misc_mem_writeb(void *opaque, target_phys_addr_t addr, uint32
break;
case 0x1f00000:
MISC_DPRINTF("Write system control %2.2x\n", val & 0xff);
- if (val & 1)
+ if (val & 1) {
+ s->sysctrl = 0x2;
qemu_system_reset_request();
+ }
break;
case 0xa000000:
MISC_DPRINTF("Write power management %2.2x\n", val & 0xff);
@@ -158,6 +160,7 @@ static uint32_t slavio_misc_mem_readb(void *opaque, target_phys_addr_t addr)
break;
case 0x1f00000:
MISC_DPRINTF("Read system control %2.2x\n", ret);
+ ret = s->sysctrl;
break;
case 0xa000000:
MISC_DPRINTF("Read power management %2.2x\n", ret);
@@ -188,6 +191,7 @@ static void slavio_misc_save(QEMUFile *f, void *opaque)
qemu_put_8s(f, &s->aux2);
qemu_put_8s(f, &s->diag);
qemu_put_8s(f, &s->mctrl);
+ qemu_put_8s(f, &s->sysctrl);
}
static int slavio_misc_load(QEMUFile *f, void *opaque, int version_id)
@@ -203,6 +207,7 @@ static int slavio_misc_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_8s(f, &s->aux2);
qemu_get_8s(f, &s->diag);
qemu_get_8s(f, &s->mctrl);
+ qemu_get_8s(f, &s->sysctrl);
return 0;
}