Date: Thu, 11 Nov 2010 19:20:33 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r215139 - head/sys/i386/bios Message-ID: <201011111920.oABJKXCQ081755@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Thu Nov 11 19:20:33 2010 New Revision: 215139 URL: http://svn.freebsd.org/changeset/base/215139 Log: Add compat shim for apm(4) to translate APM BIOS function numbers from i386 to PC98-specific ones. Any binaries using apm ioctl(4) commands but built for i386 should also work on PC98 now. Reviewed by: imp, nyan Modified: head/sys/i386/bios/apm.c Modified: head/sys/i386/bios/apm.c ============================================================================== --- head/sys/i386/bios/apm.c Thu Nov 11 19:18:52 2010 (r215138) +++ head/sys/i386/bios/apm.c Thu Nov 11 19:20:33 2010 (r215139) @@ -1389,6 +1389,23 @@ apmioctl(struct cdev *dev, u_long cmd, c return (EPERM); /* XXX compatibility with the old interface */ args = (struct apm_bios_arg *)addr; +#ifdef PC98 + if (((args->eax >> 8) & 0xff) == 0x53) { + sc->bios.r.eax = args->eax & ~0xffff; + sc->bios.r.eax |= APM_BIOS << 8; + switch (args->eax & 0xff) { + case 0x0a: + sc->bios.r.eax |= APM_GETPWSTATUS; + break; + case 0x0e: + sc->bios.r.eax |= APM_DRVVERSION; + break; + default: + sc->bios.r.eax |= args->eax & 0xff; + break; + } + } else +#endif sc->bios.r.eax = args->eax; sc->bios.r.ebx = args->ebx; sc->bios.r.ecx = args->ecx;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011111920.oABJKXCQ081755>