summaryrefslogtreecommitdiffstats
path: root/hw/acpi.c
diff options
context:
space:
mode:
authorGleb Natapov2012-06-04 13:31:55 +0200
committerAnthony Liguori2012-06-19 20:36:56 +0200
commit459ae5ea5ad682c2b3220beb244d4102c1a4e332 (patch)
treed6959529e733678024a1be608bf65948610e8fff /hw/acpi.c
parentmake: automatically include dependencies in recursive subdir rules (v2) (diff)
downloadqemu-459ae5ea5ad682c2b3220beb244d4102c1a4e332.tar.gz
qemu-459ae5ea5ad682c2b3220beb244d4102c1a4e332.tar.xz
qemu-459ae5ea5ad682c2b3220beb244d4102c1a4e332.zip
Add PIIX4 properties to control PM system states.
This patch adds two things. First it allows QEMU to distinguish between regular powerdown and S4 powerdown. Later separate QMP notification will be added for S4 powerdown. Second it allows S3/S4 states to be disabled from QEMU command line. Some guests known to be broken with regards to power management, but allow to use it anyway. Using new properties management will be able to disable S3/S4 for such guests. Supported system state are passed to a firmware using new fw_cfg file. The file contains 6 byte array. Each byte represents one system state. If byte at offset X has its MSB set it means that system state X is supported and to enter it guest should use the value from lowest 3 bits. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/acpi.c')
-rw-r--r--hw/acpi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/acpi.c b/hw/acpi.c
index 5d521e5133..effc7ec23e 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -370,7 +370,7 @@ void acpi_pm1_cnt_init(ACPIREGS *ar)
qemu_register_wakeup_notifier(&ar->wakeup);
}
-void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
+void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val, char s4)
{
ar->pm1.cnt.cnt = val & ~(ACPI_BITMASK_SLEEP_ENABLE);
@@ -385,6 +385,9 @@ void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
qemu_system_suspend_request();
break;
default:
+ if (sus_typ == s4) { /* S4 request */
+ qemu_system_shutdown_request();
+ }
break;
}
}