summaryrefslogtreecommitdiffstats
path: root/sys/pc98
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2009-04-11 14:25:47 +0000
committernyan <nyan@FreeBSD.org>2009-04-11 14:25:47 +0000
commit9b05913c11944ede886f15a7d29725de2774fbcb (patch)
tree29d872c00bed00943885493467a8975cd516dfbc /sys/pc98
parentb4488507fc85e47de81a51e859897fc8182dd19a (diff)
downloadFreeBSD-src-9b05913c11944ede886f15a7d29725de2774fbcb.zip
FreeBSD-src-9b05913c11944ede886f15a7d29725de2774fbcb.tar.gz
MFi386: revision 190919
Simplify in/out functions. Remove a hack to generate more efficient code for port numbers below 0x100, which has been obsolete for at least ten years, because GCC has an asm constraint to specify that.
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/pc98/machdep.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 4fb29a4..a42b903 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -2791,45 +2791,24 @@ user_dbreg_trap(void)
#ifdef KDB
/*
- * Provide inb() and outb() as functions. They are normally only
- * available as macros calling inlined functions, thus cannot be
- * called from the debugger.
- *
- * The actual code is stolen from <machine/cpufunc.h>, and de-inlined.
+ * Provide inb() and outb() as functions. They are normally only available as
+ * inline functions, thus cannot be called from the debugger.
*/
-#undef inb
-#undef outb
-
/* silence compiler warnings */
-u_char inb(u_int);
-void outb(u_int, u_char);
+u_char inb_(u_short);
+void outb_(u_short, u_char);
u_char
-inb(u_int port)
+inb_(u_short port)
{
- u_char data;
- /*
- * We use %%dx and not %1 here because i/o is done at %dx and not at
- * %edx, while gcc generates inferior code (movw instead of movl)
- * if we tell it to load (u_short) port.
- */
- __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
- return (data);
+ return inb(port);
}
void
-outb(u_int port, u_char data)
+outb_(u_short port, u_char data)
{
- u_char al;
- /*
- * Use an unnecessary assignment to help gcc's register allocator.
- * This make a large difference for gcc-1.40 and a tiny difference
- * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for
- * best results. gcc-2.6.0 can't handle this.
- */
- al = data;
- __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
+ outb(port, data);
}
#endif /* KDB */
OpenPOWER on IntegriCloud