Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Sep 2012 08:50:55 +0000 (UTC)
From:      Takahashi Yoshihiro <nyan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240854 - head/sys/boot/pc98/loader
Message-ID:  <201209230850.q8N8otpU057979@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nyan
Date: Sun Sep 23 08:50:54 2012
New Revision: 240854
URL: http://svn.freebsd.org/changeset/base/240854

Log:
  MFi386: revision 240637
  
    loader/i386: replace ugly inb/outb re-implementations with cpufunc.h

Modified:
  head/sys/boot/pc98/loader/main.c

Modified: head/sys/boot/pc98/loader/main.c
==============================================================================
--- head/sys/boot/pc98/loader/main.c	Sun Sep 23 08:49:41 2012	(r240853)
+++ head/sys/boot/pc98/loader/main.c	Sun Sep 23 08:50:54 2012	(r240854)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <stddef.h>
 #include <string.h>
 #include <machine/bootinfo.h>
+#include <machine/cpufunc.h>
 #include <sys/param.h>
 #include <sys/reboot.h>
 
@@ -307,32 +308,17 @@ command_heap(int argc, char *argv[])
     return(CMD_OK);
 }
 
-/* ISA bus access functions for PnP, derived from <machine/cpufunc.h> */
+/* ISA bus access functions for PnP. */
 static int
 isa_inb(int port)
 {
-    u_char	data;
-    
-    if (__builtin_constant_p(port) && 
-	(((port) & 0xffff) < 0x100) && 
-	((port) < 0x10000)) {
-	__asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port)));
-    } else {
-	__asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
-    }
-    return(data);
+
+    return (inb(port));
 }
 
 static void
 isa_outb(int port, int value)
 {
-    u_char	al = value;
-    
-    if (__builtin_constant_p(port) && 
-	(((port) & 0xffff) < 0x100) && 
-	((port) < 0x10000)) {
-	__asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port)));
-    } else {
-        __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
-    }
+
+    outb(port, value);
 }



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