debuggers.hg

view tools/ioemu/patches/acpi-poweroff-support @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 Index: ioemu/hw/piix4acpi.c
2 ===================================================================
3 --- ioemu.orig/hw/piix4acpi.c 2007-05-03 19:46:01.000000000 +0100
4 +++ ioemu/hw/piix4acpi.c 2007-05-03 19:46:09.000000000 +0100
5 @@ -45,6 +45,10 @@
6 #define GBL_RLS (1 << 2)
7 #define SLP_EN (1 << 13)
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;
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); */
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 +}
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); */
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 +}
45 static uint32_t acpiPm1Control_readw(void *opaque, uint32_t addr)
46 {