From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 21:03:50 2010 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 BAE84106566B; Wed, 25 Aug 2010 21:03:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2818FC08; Wed, 25 Aug 2010 21:03:50 +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 o7PL3oKd022446; Wed, 25 Aug 2010 21:03:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PL3obR022443; Wed, 25 Aug 2010 21:03:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252103.o7PL3obR022443@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 21:03:50 +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: r211824 - head/sys/compat/x86bios 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: Wed, 25 Aug 2010 21:03:50 -0000 Author: jkim Date: Wed Aug 25 21:03:50 2010 New Revision: 211824 URL: http://svn.freebsd.org/changeset/base/211824 Log: Add x86bios_set_intr() to set interrupt vectors for real mode and simplify x86bios_get_intr() a little. Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Wed Aug 25 20:52:40 2010 (r211823) +++ head/sys/compat/x86bios/x86bios.c Wed Aug 25 21:03:50 2010 (r211824) @@ -204,6 +204,13 @@ x86bios_get_intr(int intno) } void +x86bios_set_intr(int intno, uint32_t saddr) +{ + + writel(BIOS_PADDRTOVADDR(intno * 4), saddr); +} + +void x86bios_intr(struct x86regs *regs, int intno) { struct vm86frame vmf; @@ -619,11 +626,15 @@ x86bios_call(struct x86regs *regs, uint1 uint32_t x86bios_get_intr(int intno) { - uint32_t *iv; - iv = (uint32_t *)((vm_offset_t)x86bios_ivt + intno * 4); + return (le32toh(*((uint32_t *)x86bios_ivt + intno))); +} + +void +x86bios_set_intr(int intno, uint32_t saddr) +{ - return (le32toh(*iv)); + *((uint32_t *)x86bios_ivt + intno) = htole32(saddr); } void Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Wed Aug 25 20:52:40 2010 (r211823) +++ head/sys/compat/x86bios/x86bios.h Wed Aug 25 21:03:50 2010 (r211824) @@ -151,6 +151,7 @@ void x86bios_init_regs(struct x86regs * void x86bios_intr(struct x86regs *regs, int intno); int x86bios_match_device(uint32_t offset, device_t dev); void *x86bios_offset(uint32_t offset); +void x86bios_set_intr(int intno, uint32_t saddr); __END_DECLS #endif /* !_X86BIOS_H_ */