aboutsummaryrefslogtreecommitdiff
path: root/src/apm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/apm.c')
-rw-r--r--src/apm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/apm.c b/src/apm.c
index b2eac6d..de6bd99 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -12,6 +12,7 @@
#include "config.h" // CONFIG_*
#include "biosvar.h" // GET_GLOBAL
#include "paravirt.h" // runningOnQEMU
+#include "acpi.h" // acpi_pm_ctl
static void
out_str(const char *str_cs)
@@ -108,7 +109,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();