[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [5130] x86: Fix powerdown for non-ACPI case
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [5130] x86: Fix powerdown for non-ACPI case |
Date: |
Tue, 02 Sep 2008 00:09:27 +0000 |
Revision: 5130
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5130
Author: aurel32
Date: 2008-09-02 00:09:25 +0000 (Tue, 02 Sep 2008)
Log Message:
-----------
x86: Fix powerdown for non-ACPI case
Trivial fix for a corner case: system_shutdown on isapc machines causes
qemu to segfaults due to accessing the uninitialized pm_state. Issue a
system shutdown instead.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
Modified Paths:
--------------
trunk/hw/acpi.c
Modified: trunk/hw/acpi.c
===================================================================
--- trunk/hw/acpi.c 2008-09-02 00:09:16 UTC (rev 5129)
+++ trunk/hw/acpi.c 2008-09-02 00:09:25 UTC (rev 5130)
@@ -72,7 +72,7 @@
#define SMBHSTDAT1 0x06
#define SMBBLKDAT 0x07
-PIIX4PMState *pm_state;
+static PIIX4PMState *pm_state;
static uint32_t get_pmtmr(PIIX4PMState *s)
{
@@ -526,7 +526,9 @@
#if defined(TARGET_I386)
void qemu_system_powerdown(void)
{
- if(pm_state->pmen & PWRBTN_EN) {
+ if (!pm_state) {
+ qemu_system_shutdown_request();
+ } else if (pm_state->pmen & PWRBTN_EN) {
pm_state->pmsts |= PWRBTN_EN;
pm_update_sci(pm_state);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [5130] x86: Fix powerdown for non-ACPI case,
Aurelien Jarno <=