// Copyright (C) 2005 Struan Bartlett
// Copyright (C) 2004 Fabrice Bellard
//
-// This file may be distributed under the terms of the GNU GPLv3 license.
+// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "farptr.h" // GET_VAR
-#include "biosvar.h" // struct bregs
+#include "bregs.h" // struct bregs
#include "ioport.h" // outb
#include "util.h" // irq_enable
+#include "config.h" // CONFIG_*
+#include "biosvar.h" // GET_GLOBAL
static void
out_str(const char *str_cs)
u8 *s = (u8*)str_cs;
for (;;) {
- u8 c = GET_VAR(CS, *s);
+ u8 c = GET_GLOBAL(*s);
if (!c)
break;
outb(c, PORT_BIOS_APM);
set_success(regs);
}
+// APM cpu busy
+static void
+handle_155306(struct bregs *regs)
+{
+ set_success(regs);
+}
+
// APM Set Power State
static void
handle_155307(struct bregs *regs)
set_success(regs);
}
+#define RET_ENOEVENT 0x80
+
// Get PM Event
static void
handle_15530b(struct bregs *regs)
{
- set_fail(regs);
- regs->ah = 0x80; // no event pending
+ set_code_fail_silent(regs, RET_ENOEVENT);
}
// APM Driver Version
void VISIBLE16
handle_1553(struct bregs *regs)
{
+ if (! CONFIG_APMBIOS) {
+ set_code_fail(regs, RET_EUNSUPPORTED);
+ return;
+ }
+
//debug_stub(regs);
switch (regs->al) {
case 0x00: handle_155300(regs); break;
case 0x03: handle_155303(regs); break;
case 0x04: handle_155304(regs); break;
case 0x05: handle_155305(regs); break;
+ case 0x06: handle_155306(regs); break;
case 0x07: handle_155307(regs); break;
case 0x08: handle_155308(regs); break;
case 0x0a: handle_15530a(regs); break;