Skip to contentSkip to conversation

SH4/R2D: fix poweroff

PATCH New Aurelien Jarno 1 participant 1 message Feb 6, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 hw/r2d.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
hw/r2d.c +5 -4
index e4c02f0..8769a12 100644
@@ -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;
Signature · 1 line
1.6.6.1