diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-04-07 17:31:43 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-04-07 17:35:47 -0400 |
commit | f5037fd2e9cf842b5ebc4dab120aa1c31ad52226 (patch) | |
tree | 684a46b2880660bd99ee9ef7357c0e3f108613d9 /src | |
parent | 8996ad2cd9cdca1977dc75f262dca7f6e549be15 (diff) | |
download | seabios-hppa-f5037fd2e9cf842b5ebc4dab120aa1c31ad52226.zip seabios-hppa-f5037fd2e9cf842b5ebc4dab120aa1c31ad52226.tar.gz seabios-hppa-f5037fd2e9cf842b5ebc4dab120aa1c31ad52226.tar.bz2 |
apm: Remove old Bochs mechanism for shutdown/suspend/standby.
Remove the old mechanism that used port 0x8900 to send apm signals.
Recent versions of QEMU no longer support this port. Bochs and QEMU
only ever supported shutdown anyway, and shutdown is already available
via an ACPI mechanism.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/apm.c | 34 | ||||
-rw-r--r-- | src/fw/paravirt.h | 1 |
2 files changed, 6 insertions, 29 deletions
@@ -9,30 +9,11 @@ #include "biosvar.h" // GET_GLOBAL #include "bregs.h" // struct bregs #include "config.h" // CONFIG_* -#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 (!runningOnQEMU()) { - dprintf(1, "APM request '%s'\n", str_cs); - return; - } - - u8 *s = (u8*)str_cs; - for (;;) { - u8 c = GET_GLOBAL(*s); - if (!c) - break; - outb(c, PORT_BIOS_APM); - s++; - } -} - // APM installation check static void handle_155300(struct bregs *regs) @@ -54,14 +35,11 @@ handle_155301(struct bregs *regs) set_success(regs); } -// Assembler entry points defined in romlayout.S -extern void entry_apm16(void); -extern void entry_apm32(void); - // APM 16 bit protected mode interface connect static void handle_155302(struct bregs *regs) { + extern void entry_apm16(void); regs->bx = (u32)entry_apm16; regs->ax = SEG_BIOS; // 16 bit code segment base regs->si = 0xfff0; // 16 bit code segment size @@ -74,6 +52,7 @@ handle_155302(struct bregs *regs) static void handle_155303(struct bregs *regs) { + extern void entry_apm32(void); regs->ax = SEG_BIOS; // 32 bit code segment base regs->ebx = (u32)entry_apm32; regs->cx = SEG_BIOS; // 16 bit code segment base @@ -111,11 +90,10 @@ void apm_shutdown(void) { u16 pm1a_cnt = GET_GLOBAL(acpi_pm1a_cnt); - - irq_disable(); if (pm1a_cnt) outw(0x2000, pm1a_cnt); - out_str("Shutdown"); + + irq_disable(); for (;;) hlt(); } @@ -130,10 +108,10 @@ handle_155307(struct bregs *regs) } switch (regs->cx) { case 1: - out_str("Standby"); + dprintf(1, "APM standby request\n"); break; case 2: - out_str("Suspend"); + dprintf(1, "APM suspend request\n"); break; case 3: apm_shutdown(); diff --git a/src/fw/paravirt.h b/src/fw/paravirt.h index 69d7248..04fb4b9 100644 --- a/src/fw/paravirt.h +++ b/src/fw/paravirt.h @@ -31,7 +31,6 @@ static inline int runningOnKVM(void) { #define PORT_QEMU_CFG_DATA 0x0511 #define PORT_ACPI_PM_BASE 0xb000 #define PORT_SMB_BASE 0xb100 -#define PORT_BIOS_APM 0x8900 void qemu_preinit(void); void qemu_platform_setup(void); |