summaryrefslogtreecommitdiff
path: root/roms/seabios/src/apm.c
diff options
context:
space:
mode:
Diffstat (limited to 'roms/seabios/src/apm.c')
-rw-r--r--roms/seabios/src/apm.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/roms/seabios/src/apm.c b/roms/seabios/src/apm.c
index 8daf9583b..fd71a01ef 100644
--- a/roms/seabios/src/apm.c
+++ b/roms/seabios/src/apm.c
@@ -6,16 +6,19 @@
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
+#include "biosvar.h" // GET_GLOBAL
#include "bregs.h" // struct bregs
-#include "ioport.h" // outb
-#include "util.h" // dprintf
#include "config.h" // CONFIG_*
-#include "biosvar.h" // GET_GLOBAL
+#include "fw/paravirt.h" // runningOnQEMU
+#include "output.h" // dprintf
+#include "stacks.h" // yield_toirq
+#include "util.h" // apm_shutdown
+#include "x86.h" // outb
static void
out_str(const char *str_cs)
{
- if (CONFIG_COREBOOT) {
+ if (!runningOnQEMU()) {
dprintf(1, "APM request '%s'\n", str_cs);
return;
}
@@ -107,7 +110,11 @@ handle_155306(struct bregs *regs)
void
apm_shutdown(void)
{
+ u16 pm1a_cnt = GET_GLOBAL(acpi_pm1a_cnt);
+
irq_disable();
+ if (pm1a_cnt)
+ outw(0x2000, pm1a_cnt);
out_str("Shutdown");
for (;;)
hlt();