Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2010 21:03:50 +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: r211824 - head/sys/compat/x86bios
Message-ID:  <201008252103.o7PL3obR022443@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008252103.o7PL3obR022443>