From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 08:24:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 415E7106566B; Mon, 21 Sep 2009 08:24:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA668FC1D; Mon, 21 Sep 2009 08:24:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L8OMqq080885; Mon, 21 Sep 2009 08:24:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L8OMHs080882; Mon, 21 Sep 2009 08:24:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909210824.n8L8OMHs080882@svn.freebsd.org> From: Xin LI Date: Mon, 21 Sep 2009 08:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197384 - in head/sys: conf dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 08:24:23 -0000 Author: delphij Date: Mon Sep 21 08:24:22 2009 New Revision: 197384 URL: http://svn.freebsd.org/changeset/base/197384 Log: Allow atkbd to obtain keyboard repeat rate from BIOS on amd64. Submitted by: swell.k at gmail.com Modified: head/sys/conf/files head/sys/dev/atkbdc/atkbd.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 21 08:17:57 2009 (r197383) +++ head/sys/conf/files Mon Sep 21 08:24:22 2009 (r197384) @@ -2828,8 +2828,8 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci -dev/x86bios/x86bios.c optional x86bios | dpms | vesa -dev/x86bios/x86bios_alloc.c optional x86bios | dpms | vesa -contrib/x86emu/x86emu.c optional x86bios | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | dpms | vesa +dev/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +dev/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Sep 21 08:17:57 2009 (r197383) +++ head/sys/dev/atkbdc/atkbd.c Mon Sep 21 08:24:22 2009 (r197384) @@ -44,10 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ #include #include @@ -1089,34 +1089,33 @@ atkbd_shutdown_final(void *v) static int get_typematic(keyboard_t *kbd) { -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) /* * Only some systems allow us to retrieve the keyboard repeat * rate previously set via the BIOS... */ - struct vm86frame vmf; - u_int32_t p; + x86regs_t regs; + vm_offset_t p; - bzero(&vmf, sizeof(vmf)); - vmf.vmf_ax = 0xc000; - vm86_intcall(0x15, &vmf); - if ((vmf.vmf_eflags & PSL_C) || vmf.vmf_ah) + regs.R_AX = 0xc000; + x86biosCall(®s, 0x15); + if ((regs.R_EFLG & PSL_C) || regs.R_AH) return ENODEV; - p = BIOS_PADDRTOVADDR(((u_int32_t)vmf.vmf_es << 4) + vmf.vmf_bx); + p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX); if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */ return ENODEV; - vmf.vmf_ax = 0x0900; - vm86_intcall(0x16, &vmf); - if ((vmf.vmf_al & 0x08) == 0) /* int 16, function 0x0306 supported? */ + regs.R_AX = 0x0900; + x86biosCall(®s, 0x16); + if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */ return ENODEV; - vmf.vmf_ax = 0x0306; - vm86_intcall(0x16, &vmf); - kbd->kb_delay1 = typematic_delay(vmf.vmf_bh << 5); - kbd->kb_delay2 = typematic_rate(vmf.vmf_bl); + regs.R_AX = 0x0306; + x86biosCall(®s, 0x16); + kbd->kb_delay1 = typematic_delay(regs.R_BH << 5); + kbd->kb_delay2 = typematic_rate(regs.R_BL); return 0; #else return ENODEV; -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ } static int