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_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to