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>
This commit is contained in:
Aurelien Jarno 2010-01-30 20:41:33 +01:00
parent 5105c5564c
commit 37cc0b44b4
1 changed files with 5 additions and 4 deletions

View File

@ -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;