diff options
author | msmith <msmith@FreeBSD.org> | 1999-07-30 19:35:03 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-07-30 19:35:03 +0000 |
commit | 819d43daf6a609524a662ef360708414e55e6785 (patch) | |
tree | 1a42cd8e0d0f6027c62fa579185cbe2a72f95c4f /sys/i386/bios | |
parent | 9d756f809fe1df3bb187bdc03c2341f5325133b4 (diff) | |
download | FreeBSD-src-819d43daf6a609524a662ef360708414e55e6785.zip FreeBSD-src-819d43daf6a609524a662ef360708414e55e6785.tar.gz |
Reenable the APMIO_BIOS ioctl and translate arguments into the new format
(which is more like the old than I thought).
Requested-by: imp
Diffstat (limited to 'sys/i386/bios')
-rw-r--r-- | sys/i386/bios/apm.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 464739a..cf75c0f 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -15,7 +15,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.95 1999/07/29 18:15:33 iwasaki Exp $ + * $Id: apm.c,v 1.96 1999/07/30 08:24:19 msmith Exp $ */ #include "opt_devfs.h" @@ -1070,6 +1070,7 @@ static int apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) { struct apm_softc *sc = &apm_softc; + struct apm_bios_arg *args; int error = 0; int newstate; @@ -1130,6 +1131,24 @@ apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) if (apm_display(newstate)) error = ENXIO; break; + case APMIO_BIOS: + /* XXX compatibility with the old interface */ + args = (struct apm_bios_arg *)addr; + sc->bios.r.eax = args->eax; + sc->bios.r.ebx = args->ebx; + sc->bios.r.ecx = args->ecx; + sc->bios.r.edx = args->edx; + sc->bios.r.esi = args->esi; + sc->bios.r.edi = args->edi; + if (apm_bioscall()) + sc->bios.r.eax &= 0xff; + args->eax = sc->bios.r.eax; + args->ebx = sc->bios.r.ebx; + args->ecx = sc->bios.r.ecx; + args->edx = sc->bios.r.edx; + args->esi = sc->bios.r.esi; + args->edi = sc->bios.r.edi; + break; default: error = EINVAL; break; |