diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-09-15 21:48:16 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-09-15 21:48:16 -0400 |
commit | 244caf86f11f5f65d166d91704f64cb673167abc (patch) | |
tree | eb0f32c8469d15625ad34ebc3c4fec6068a767e9 /src/apm.c | |
parent | 5bd01de26257849f36d361018c3ec17aa29b0218 (diff) | |
download | qemu-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.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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); |