diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2010-01-30 20:41:33 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-02-08 12:21:03 +0100 |
commit | 37cc0b44b48fcb9f8d75105202d45e70ad1774ca (patch) | |
tree | 17f8bf3a8a3b262caba7c88e32d7bd35f3c78b25 | |
parent | 5105c5564cc062f848c6602e911b1a0b75befef7 (diff) | |
download | qemu-37cc0b44b48fcb9f8d75105202d45e70ad1774ca.zip qemu-37cc0b44b48fcb9f8d75105202d45e70ad1774ca.tar.gz qemu-37cc0b44b48fcb9f8d75105202d45e70ad1774ca.tar.bz2 |
SH4/R2D: fix poweroff
The write the the PA_POWOFF register is currently ignored. Fix that by
calling qemu_system_shutdown_request() when a poweroff is requested.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | hw/r2d.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -66,7 +66,6 @@ typedef struct { uint16_t keyctlclr; uint16_t pad0; uint16_t pad1; - uint16_t powoff; uint16_t verreg; uint16_t inport; uint16_t outport; @@ -128,7 +127,7 @@ static uint32_t r2d_fpga_read(void *opaque, target_phys_addr_t addr) case PA_OUTPORT: return s->outport; case PA_POWOFF: - return s->powoff; + return 0x00; case PA_VERREG: return 0x10; } @@ -150,8 +149,10 @@ r2d_fpga_write(void *opaque, target_phys_addr_t addr, uint32_t value) s->outport = value; break; case PA_POWOFF: - s->powoff = value; - break; + if (value & 1) { + qemu_system_shutdown_request(); + } + break; case PA_VERREG: /* Discard writes */ break; |