summaryrefslogtreecommitdiff
path: root/src/apm.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-09-15 21:48:16 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-09-15 21:48:16 -0400
commit244caf86f11f5f65d166d91704f64cb673167abc (patch)
treeeb0f32c8469d15625ad34ebc3c4fec6068a767e9 /src/apm.c
parent5bd01de26257849f36d361018c3ec17aa29b0218 (diff)
downloadqemu-seabios-244caf86f11f5f65d166d91704f64cb673167abc.tar.gz
Try to hard-reboot on rerun of post even on emulators.
Extend the hard-reboot logic to qemu and kvm. On qemu, a reboot will not reset the memory settings for 0xc0000-0xfffff, so copy that memory area manually before rebooting. Unfortunately, kvm does not keep a pristine copy of the BIOS at 0xffff0000, so detect that case and shutdown the machine.
Diffstat (limited to 'src/apm.c')
-rw-r--r--src/apm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/apm.c b/src/apm.c
index 1b151e9..2029ae2 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -105,6 +105,15 @@ handle_155306(struct bregs *regs)
set_success(regs);
}
+void
+apm_shutdown(void)
+{
+ irq_disable();
+ out_str("Shutdown");
+ for (;;)
+ hlt();
+}
+
// APM Set Power State
static void
handle_155307(struct bregs *regs)
@@ -121,10 +130,7 @@ handle_155307(struct bregs *regs)
out_str("Suspend");
break;
case 3:
- irq_disable();
- out_str("Shutdown");
- for (;;)
- hlt();
+ apm_shutdown();
break;
}
set_success(regs);