From f5fa837e313d018a945eaedd28352e7f24e5b1a6 Mon Sep 17 00:00:00 2001 From: Pablo de Oliveira Date: Mon, 17 Mar 2014 19:01:59 +0100 Subject: [PATCH] Add ACPI shutdown sequence On QEMU emulator version 1.7.0, the previous shutdown sequence (writing `shutdown` to 0x8900), is not working properly. This patch adds support for the ACPI shutdown code which works on qemu 1.7.0 and preserves the old sequence for compatibility. --- src/devices/shutdown.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/shutdown.c b/src/devices/shutdown.c index 7ff9a95..61c76f7 100644 --- a/src/devices/shutdown.c +++ b/src/devices/shutdown.c @@ -99,6 +99,9 @@ shutdown_power_off (void) printf ("Powering off...\n"); serial_flush (); + /* ACPI power-off */ + outw (0xB004, 0x2000); + /* This is a special power-off sequence supported by Bochs and QEMU, but not by physical hardware. */ for (p = s; *p != '\0'; p++) -- 2.30.2