source: trunk/packages/xen-3.1/xen-3.1/tools/ioemu/patches/acpi-poweroff-support @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.3 KB
Line 
1Index: ioemu/hw/piix4acpi.c
2===================================================================
3--- ioemu.orig/hw/piix4acpi.c   2007-05-02 15:59:27.000000000 +0100
4+++ ioemu/hw/piix4acpi.c        2007-05-02 16:02:29.000000000 +0100
5@@ -45,6 +45,10 @@
6 #define GBL_RLS           (1 << 2)
7 #define SLP_EN            (1 << 13)
8 
9+/* Bits of PM1a register define here  */
10+#define SLP_TYP_MASK    0x1C00
11+#define SLP_VAL         0x1C00
12+
13 typedef struct AcpiDeviceState AcpiDeviceState;
14 AcpiDeviceState *acpi_device_table;
15 
16@@ -81,7 +85,13 @@
17     s->pm1_control = (s->pm1_control & 0xff) | (val << 8);
18 /*    printf("acpiPm1ControlP1_writeb \n addr %x val:%x\n", addr, val); */
19 
20-}
21+    // Check for power off request
22+    val <<= 8;
23+    if (((val & SLP_EN) != 0) &&
24+        ((val & SLP_TYP_MASK) == SLP_VAL)) {
25+        qemu_system_shutdown_request();
26+    }
27+}
28 
29 static uint32_t acpiPm1ControlP1_readb(void *opaque, uint32_t addr)
30 {
31@@ -105,7 +115,14 @@
32     s->pm1_control = val;
33 /*    printf("acpiPm1Control_writew \n addr %x val:%x\n", addr, val); */
34 
35-}
36+    // Check for power off request
37+
38+    if (((val & SLP_EN) != 0) &&
39+        ((val & SLP_TYP_MASK) == SLP_VAL)) {
40+        qemu_system_shutdown_request();
41+    }
42+
43+}
44 
45 static uint32_t acpiPm1Control_readw(void *opaque, uint32_t addr)
46 {
Note: See TracBrowser for help on using the repository browser.