summaryrefslogtreecommitdiffstats
path: root/sys/boot/pc98
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2012-09-23 08:50:54 +0000
committernyan <nyan@FreeBSD.org>2012-09-23 08:50:54 +0000
commit8578bd9c62a020eda1c87c91dedaad78c4338b6a (patch)
tree89be64d6e2fdc75120a10720f8096892ff9e409e /sys/boot/pc98
parent78ea1a076e71f23c4294660e237a4f8ecc5089ad (diff)
downloadFreeBSD-src-8578bd9c62a020eda1c87c91dedaad78c4338b6a.zip
FreeBSD-src-8578bd9c62a020eda1c87c91dedaad78c4338b6a.tar.gz
MFi386: revision 240637
loader/i386: replace ugly inb/outb re-implementations with cpufunc.h
Diffstat (limited to 'sys/boot/pc98')
-rw-r--r--sys/boot/pc98/loader/main.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sys/boot/pc98/loader/main.c b/sys/boot/pc98/loader/main.c
index a89e33d..75690c7 100644
--- a/sys/boot/pc98/loader/main.c
+++ b/sys/boot/pc98/loader/main.c
@@ -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);
}
OpenPOWER on IntegriCloud