From d2362a1701f54b395f4ab4005844c5c75f38e3a1 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Thu, 26 Nov 2015 20:58:08 +0100
Subject: [PATCH 1/3] Remove sys/cpu/i386

---
 lib/libstand/Makefile             |   28 +-
 sys/cpu/i386/include/asm.h        |   97 ---
 sys/cpu/i386/include/asmacros.h   |  159 -----
 sys/cpu/i386/include/atomic.h     |  667 -----------------
 sys/cpu/i386/include/bus_at386.h  |  896 -----------------------
 sys/cpu/i386/include/bus_dma.h    |  106 ---
 sys/cpu/i386/include/coredump.h   |   14 -
 sys/cpu/i386/include/cpu.h        |  131 ----
 sys/cpu/i386/include/cpufunc.h    |  812 ---------------------
 sys/cpu/i386/include/cputypes.h   |   87 ---
 sys/cpu/i386/include/db_machdep.h |   98 ---
 sys/cpu/i386/include/elf.h        |  180 -----
 sys/cpu/i386/include/endian.h     |  168 -----
 sys/cpu/i386/include/exec.h       |   43 --
 sys/cpu/i386/include/frame.h      |  148 ----
 sys/cpu/i386/include/ieeefp.h     |  258 -------
 sys/cpu/i386/include/int_const.h  |   55 --
 sys/cpu/i386/include/int_limits.h |  157 ----
 sys/cpu/i386/include/inttypes.h   |  221 ------
 sys/cpu/i386/include/limits.h     |  118 ---
 sys/cpu/i386/include/lwbuf.h      |   83 ---
 sys/cpu/i386/include/npx.h        |  166 -----
 sys/cpu/i386/include/param.h      |  234 ------
 sys/cpu/i386/include/perfmon.h    |  258 -------
 sys/cpu/i386/include/pmap.h       |  101 ---
 sys/cpu/i386/include/profile.h    |  178 -----
 sys/cpu/i386/include/psl.h        |   89 ---
 sys/cpu/i386/include/reg.h        |  145 ----
 sys/cpu/i386/include/reloc.h      |   54 --
 sys/cpu/i386/include/segments.h   |  277 --------
 sys/cpu/i386/include/setjmp.h     |   52 --
 sys/cpu/i386/include/sigframe.h   |   70 --
 sys/cpu/i386/include/signal.h     |  115 ---
 sys/cpu/i386/include/specialreg.h |  537 --------------
 sys/cpu/i386/include/stdarg.h     |   85 ---
 sys/cpu/i386/include/stdint.h     |  134 ----
 sys/cpu/i386/include/sysarch.h    |   86 ---
 sys/cpu/i386/include/tls.h        |  150 ----
 sys/cpu/i386/include/trap.h       |  100 ---
 sys/cpu/i386/include/tss.h        |   85 ---
 sys/cpu/i386/include/types.h      |  124 ----
 sys/cpu/i386/include/ucontext.h   |   81 ---
 sys/cpu/i386/include/varargs.h    |   66 --
 sys/cpu/i386/include/vframe.h     |   50 --
 sys/cpu/i386/include/vm86.h       |  172 -----
 sys/cpu/i386/misc/atomic.c        |   48 --
 sys/cpu/i386/misc/bzeront.s       |   59 --
 sys/cpu/i386/misc/db_disasm.c     | 1423 -------------------------------------
 sys/cpu/i386/misc/elf_machdep.c   |  194 -----
 sys/cpu/i386/misc/i386-gdbstub.c  |  612 ----------------
 sys/cpu/i386/misc/in_cksum2.s     |   87 ---
 sys/cpu/i386/misc/ktr.c           |   86 ---
 sys/cpu/i386/misc/lwbuf.c         |  176 -----
 sys/cpu/i386/misc/monitor.s       |   68 --
 54 files changed, 3 insertions(+), 10685 deletions(-)
 delete mode 100644 sys/cpu/i386/include/asm.h
 delete mode 100644 sys/cpu/i386/include/asmacros.h
 delete mode 100644 sys/cpu/i386/include/atomic.h
 delete mode 100644 sys/cpu/i386/include/bus_at386.h
 delete mode 100644 sys/cpu/i386/include/bus_dma.h
 delete mode 100644 sys/cpu/i386/include/coredump.h
 delete mode 100644 sys/cpu/i386/include/cpu.h
 delete mode 100644 sys/cpu/i386/include/cpufunc.h
 delete mode 100644 sys/cpu/i386/include/cputypes.h
 delete mode 100644 sys/cpu/i386/include/db_machdep.h
 delete mode 100644 sys/cpu/i386/include/elf.h
 delete mode 100644 sys/cpu/i386/include/endian.h
 delete mode 100644 sys/cpu/i386/include/exec.h
 delete mode 100644 sys/cpu/i386/include/frame.h
 delete mode 100644 sys/cpu/i386/include/ieeefp.h
 delete mode 100644 sys/cpu/i386/include/int_const.h
 delete mode 100644 sys/cpu/i386/include/int_limits.h
 delete mode 100644 sys/cpu/i386/include/inttypes.h
 delete mode 100644 sys/cpu/i386/include/limits.h
 delete mode 100644 sys/cpu/i386/include/lwbuf.h
 delete mode 100644 sys/cpu/i386/include/npx.h
 delete mode 100644 sys/cpu/i386/include/param.h
 delete mode 100644 sys/cpu/i386/include/perfmon.h
 delete mode 100644 sys/cpu/i386/include/pmap.h
 delete mode 100644 sys/cpu/i386/include/profile.h
 delete mode 100644 sys/cpu/i386/include/psl.h
 delete mode 100644 sys/cpu/i386/include/reg.h
 delete mode 100644 sys/cpu/i386/include/reloc.h
 delete mode 100644 sys/cpu/i386/include/segments.h
 delete mode 100644 sys/cpu/i386/include/setjmp.h
 delete mode 100644 sys/cpu/i386/include/sigframe.h
 delete mode 100644 sys/cpu/i386/include/signal.h
 delete mode 100644 sys/cpu/i386/include/specialreg.h
 delete mode 100644 sys/cpu/i386/include/stdarg.h
 delete mode 100644 sys/cpu/i386/include/stdint.h
 delete mode 100644 sys/cpu/i386/include/sysarch.h
 delete mode 100644 sys/cpu/i386/include/tls.h
 delete mode 100644 sys/cpu/i386/include/trap.h
 delete mode 100644 sys/cpu/i386/include/tss.h
 delete mode 100644 sys/cpu/i386/include/types.h
 delete mode 100644 sys/cpu/i386/include/ucontext.h
 delete mode 100644 sys/cpu/i386/include/varargs.h
 delete mode 100644 sys/cpu/i386/include/vframe.h
 delete mode 100644 sys/cpu/i386/include/vm86.h
 delete mode 100644 sys/cpu/i386/misc/atomic.c
 delete mode 100644 sys/cpu/i386/misc/bzeront.s
 delete mode 100644 sys/cpu/i386/misc/db_disasm.c
 delete mode 100644 sys/cpu/i386/misc/elf_machdep.c
 delete mode 100644 sys/cpu/i386/misc/i386-gdbstub.c
 delete mode 100644 sys/cpu/i386/misc/in_cksum2.s
 delete mode 100644 sys/cpu/i386/misc/ktr.c
 delete mode 100644 sys/cpu/i386/misc/lwbuf.c
 delete mode 100644 sys/cpu/i386/misc/monitor.s

diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index bee036c..bfde95a 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -18,7 +18,7 @@ WARNS?=		2
 # Mostly OK, some of the libc imports are a bit noisy
 CFLAGS+=	-ffreestanding
 
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "x86_64"
 .if ${CCVER:Mgcc*}
 CFLAGS+=	-mpreferred-stack-boundary=2
 .endif
@@ -40,7 +40,7 @@ SRCS+=	strcasecmp.c
 
 # string functions from libc
 .PATH:	${.CURDIR}/../libc/string
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "x86_64"
 SRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
@@ -50,7 +50,7 @@ SRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
 SRCS+=  icrc32.c
 
 # _setjmp/_longjmp
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "x86_64"
 .PATH:	${.CURDIR}/i386
 .else
 .endif
@@ -94,25 +94,3 @@ SRCS+=	hammer1.c
 SRCS+=	hammer2.c
 
 .include <bsd.lib.mk>
-
-.if ${MACHINE_ARCH} == "x86_64"
-CFLAGS+= -I${.OBJDIR}
-
-.PATH: ${.OBJDIR}/machine
-
-in_cksum.c: endian.h stdint.h
-stand.h:    stdarg.h
-_setjmp.S:  asm.h
-
-endian.h stdint.h asm.h stdarg.h:
-	mkdir -p machine
-	${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/${.TARGET:T} \
-		machine/${.TARGET:T}
-
-cpu:
-	mkdir -p ${.TARGET}
-
-beforedepend: cpu
-
-CLEANDIRS+=	machine cpu
-.endif
diff --git a/sys/cpu/i386/include/asm.h b/sys/cpu/i386/include/asm.h
deleted file mode 100644
index e35799d..0000000
--- a/sys/cpu/i386/include/asm.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)DEFS.h	5.1 (Berkeley) 4/23/90
- * $FreeBSD: src/sys/i386/include/asm.h,v 1.7 2000/01/25 09:01:55 bde Exp $
- * $DragonFly: src/sys/cpu/i386/include/asm.h,v 1.4 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_ASM_H_
-#define	_CPU_ASM_H_
-
-#include <sys/cdefs.h>
-
-#ifdef PIC
-#define	PIC_PROLOGUE	\
-	pushl	%ebx;	\
-	call	1f;	\
-1:			\
-	popl	%ebx;	\
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b],%ebx
-#define	PIC_EPILOGUE	\
-	popl	%ebx
-#define	PIC_PLT(x)	x@PLT
-#define	PIC_GOT(x)	x@GOT(%ebx)
-#define	PIC_GOTOFF(x)	x@GOTOFF(%ebx)
-#else
-#define	PIC_PROLOGUE
-#define	PIC_EPILOGUE
-#define	PIC_PLT(x)	x
-#define	PIC_GOT(x)	x
-#define	PIC_GOTOFF(x)	x
-#endif
-
-/*
- * CNAME and HIDENAME manage the relationship between symbol names in C
- * and the equivalent assembly language names.  CNAME is given a name as
- * it would be used in a C program.  It expands to the equivalent assembly
- * language name.  HIDENAME is given an assembly-language name, and expands
- * to a possibly-modified form that will be invisible to C programs.
- */
-#define CNAME(csym)		csym
-#define HIDENAME(asmsym)	.asmsym
-
-/* XXX should use .p2align 4,0x90 for -m486. */
-#define _START_ENTRY	.text; .p2align 2,0x90
-
-#define _ENTRY(x)	_START_ENTRY; \
-			.globl CNAME(x); .type CNAME(x),@function; CNAME(x):
-#define	END(x)		.size x, . - x
-
-#ifdef PROF
-#define	ALTENTRY(x)	_ENTRY(x); \
-			pushl %ebp; movl %esp,%ebp; \
-			call PIC_PLT(HIDENAME(mcount)); \
-			popl %ebp; \
-			jmp 9f
-#define	ENTRY(x)	_ENTRY(x); \
-			pushl %ebp; movl %esp,%ebp; \
-			call PIC_PLT(HIDENAME(mcount)); \
-			popl %ebp; \
-			9:
-#else
-#define	ALTENTRY(x)	_ENTRY(x)
-#define	ENTRY(x)	_ENTRY(x)
-#endif
-
-#define RCSID(x)	.text; .asciz x
-
-#endif /* !_CPU_ASM_H_ */
diff --git a/sys/cpu/i386/include/asmacros.h b/sys/cpu/i386/include/asmacros.h
deleted file mode 100644
index 287f019..0000000
--- a/sys/cpu/i386/include/asmacros.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*-
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/asmacros.h,v 1.18 1999/08/28 00:44:06 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/asmacros.h,v 1.11 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_ASMACROS_H_
-#define _CPU_ASMACROS_H_
-
-#ifndef _SYS_CDEFS_H_
-#include <sys/cdefs.h>
-#endif
-
-#ifdef _KERNEL
-
-/*
- * Access to a per-cpu data element
- */
-#define PCPU(x) %fs:gd_ ## x
-#define PCPU_E4(x, idx) %fs:gd_ ## x(,idx,4)
-#define MYCPU	%fs:0
-
-#endif
-
-#ifdef LOCORE
-/*
- * Interrupt vector labels
- */
-#define IDTVEC(name)    ALIGN_TEXT; .globl __CONCAT(X,name); \
-                        .type __CONCAT(X,name),@function; __CONCAT(X,name):
-
-#endif
-
-/*
- * CNAME and HIDENAME manage the relationship between symbol names in C
- * and the equivalent assembly language names.  CNAME is given a name as
- * it would be used in a C program.  It expands to the equivalent assembly
- * language name.  HIDENAME is given an assembly-language name, and expands
- * to a possibly-modified form that will be invisible to C programs.
- */
-#define CNAME(csym)		csym
-#define HIDENAME(asmsym)	.asmsym
-
-#define ALIGN_PAGE	.p2align PAGE_SHIFT	/* page alignment */
-#define ALIGN_DATA	.p2align 2	/* 4 byte alignment, zero filled */
-#ifdef GPROF
-#define ALIGN_TEXT	.p2align 4,0x90	/* 16-byte alignment, nop filled */
-#else
-#define ALIGN_TEXT	.p2align 2,0x90	/* 4-byte alignment, nop filled */
-#endif
-#define SUPERALIGN_TEXT	.p2align 4,0x90	/* 16-byte alignment, nop filled */
-
-#define GEN_ENTRY(name)		ALIGN_TEXT; .globl CNAME(name); \
-				.type CNAME(name),@function; CNAME(name):
-#define NON_GPROF_ENTRY(name)	GEN_ENTRY(name)
-#define NON_GPROF_RET		.byte 0xc3	/* opcode for `ret' */
-
-#define	END(name)		.size name, . - name
-
-#ifdef GPROF
-/*
- * __mcount is like [.]mcount except that doesn't require its caller to set
- * up a frame pointer.  It must be called before pushing anything onto the
- * stack.  gcc should eventually generate code to call __mcount in most
- * cases.  This would make -pg in combination with -fomit-frame-pointer
- * useful.  gcc has a configuration variable PROFILE_BEFORE_PROLOGUE to
- * allow profiling before setting up the frame pointer, but this is
- * inadequate for good handling of special cases, e.g., -fpic works best
- * with profiling after the prologue.
- *
- * [.]mexitcount is a new function to support non-statistical profiling if an
- * accurate clock is available.  For C sources, calls to it are generated
- * by the FreeBSD extension `-mprofiler-epilogue' to gcc.  It is best to
- * call [.]mexitcount at the end of a function like the MEXITCOUNT macro does,
- * but gcc currently generates calls to it at the start of the epilogue to
- * avoid problems with -fpic.
- *
- * [.]mcount and __mcount will not clobber the call-used registers or %ef.
- * [.]mexitcount will not clobber the call-used registers or %ef.
- *
- * Cross-jumping makes non-statistical profiling timing more complicated.
- * It is handled in many cases by calling [.]mexitcount before jumping.  It
- * is handled for conditional jumps using CROSSJUMP() and CROSSJUMP_LABEL().
- * It is handled for some fault-handling jumps by not sharing the exit
- * routine.
- *
- * ALTENTRY() must be before a corresponding ENTRY() so that it can jump to
- * the main entry point.  Note that alt entries are counted twice.  They
- * have to be counted as ordinary entries for gprof to get the call times
- * right for the ordinary entries.
- *
- * High local labels are used in macros to avoid clashes with local labels
- * in functions.
- *
- * Ordinary `ret' is used instead of a macro `RET' because there are a lot
- * of `ret's.  0xc3 is the opcode for `ret' (`#define ret ... ret' can't
- * be used because this file is sometimes preprocessed in traditional mode).
- * `ret' clobbers eflags but this doesn't matter.
- */
-#define ALTENTRY(name)		GEN_ENTRY(name) ; MCOUNT ; MEXITCOUNT ; jmp 9f
-#define	CROSSJUMP(jtrue, label, jfalse) \
-	jfalse 8f; MEXITCOUNT; jmp __CONCAT(to,label); 8:
-#define CROSSJUMPTARGET(label) \
-	ALIGN_TEXT; __CONCAT(to,label): ; MCOUNT; jmp label
-#define ENTRY(name)		GEN_ENTRY(name) ; 9: ; MCOUNT
-#define FAKE_MCOUNT(caller)	pushl caller ; call __mcount ; addl $4,%esp
-#define MCOUNT			call __mcount
-#define MCOUNT_LABEL(name)	GEN_ENTRY(name) ; nop ; ALIGN_TEXT
-#define MEXITCOUNT		call HIDENAME(mexitcount)
-#define ret			MEXITCOUNT ; NON_GPROF_RET
-
-#else /* !GPROF */
-/*
- * ALTENTRY() has to align because it is before a corresponding ENTRY().
- * ENTRY() has to align to because there may be no ALTENTRY() before it.
- * If there is a previous ALTENTRY() then the alignment code for ENTRY()
- * is empty.
- */
-#define ALTENTRY(name)		GEN_ENTRY(name)
-#define	CROSSJUMP(jtrue, label, jfalse)	jtrue label
-#define	CROSSJUMPTARGET(label)
-#define ENTRY(name)		GEN_ENTRY(name)
-#define FAKE_MCOUNT(caller)
-#define MCOUNT
-#define MCOUNT_LABEL(name)
-#define MEXITCOUNT
-#endif /* GPROF */
-
-#endif /* !_CPU_ASMACROS_H_ */
diff --git a/sys/cpu/i386/include/atomic.h b/sys/cpu/i386/include/atomic.h
deleted file mode 100644
index 1c9e3a6..0000000
--- a/sys/cpu/i386/include/atomic.h
+++ /dev/null
@@ -1,667 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/atomic.h,v 1.9.2.1 2000/07/07 00:38:47 obrien Exp $
- */
-#ifndef _CPU_ATOMIC_H_
-#define _CPU_ATOMIC_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-
-/*
- * Various simple arithmetic on memory which is atomic in the presence
- * of interrupts and multiple processors.
- *
- * atomic_set_char(P, V)	(*(u_char*)(P) |= (V))
- * atomic_clear_char(P, V)	(*(u_char*)(P) &= ~(V))
- * atomic_add_char(P, V)	(*(u_char*)(P) += (V))
- * atomic_subtract_char(P, V)	(*(u_char*)(P) -= (V))
- *
- * atomic_set_short(P, V)	(*(u_short*)(P) |= (V))
- * atomic_clear_short(P, V)	(*(u_short*)(P) &= ~(V))
- * atomic_add_short(P, V)	(*(u_short*)(P) += (V))
- * atomic_subtract_short(P, V)	(*(u_short*)(P) -= (V))
- *
- * atomic_set_int(P, V)		(*(u_int*)(P) |= (V))
- * atomic_clear_int(P, V)	(*(u_int*)(P) &= ~(V))
- * atomic_add_int(P, V)		(*(u_int*)(P) += (V))
- * atomic_subtract_int(P, V)	(*(u_int*)(P) -= (V))
- *
- * atomic_set_long(P, V)	(*(u_long*)(P) |= (V))
- * atomic_clear_long(P, V)	(*(u_long*)(P) &= ~(V))
- * atomic_add_long(P, V)	(*(u_long*)(P) += (V))
- * atomic_subtract_long(P, V)	(*(u_long*)(P) -= (V))
- */
-
-/*
- * The above functions are expanded inline in the statically-linked
- * kernel and lock prefixes are generated.
- *
- * Kernel modules call real functions which are built into the kernel.
- */
-#if defined(KLD_MODULE)
-#define ATOMIC_ASM(NAME, TYPE, OP, V)			\
-	extern void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
-	extern void atomic_##NAME##_##TYPE##_nonlocked(volatile u_##TYPE *p, u_##TYPE v);
-
-int	atomic_testandset_int(volatile u_int *p, u_int v);
-
-#else /* !KLD_MODULE */
-#define MPLOCKED	"lock ; "
-
-/*
- * The assembly is volatilized to demark potential before-and-after side
- * effects if an interrupt or SMP collision were to occur.  The primary
- * atomic instructions are MP safe, the nonlocked instructions are 
- * local-interrupt-safe (so we don't depend on C 'X |= Y' generating an
- * atomic instruction).
- *
- * +m - memory is read and written (=m - memory is only written)
- * iq - integer constant or %ax/%bx/%cx/%dx (ir = int constant or any reg)
- *	(Note: byte instructions only work on %ax,%bx,%cx, or %dx).  iq
- *	is good enough for our needs so don't get fancy.
- */
-
-/* egcs 1.1.2+ version */
-#define ATOMIC_ASM(NAME, TYPE, OP, V)			\
-static __inline void					\
-atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
-{							\
-	__asm __volatile(MPLOCKED OP			\
-			 : "+m" (*p)			\
-			 : "iq" (V)); 			\
-}							\
-static __inline void					\
-atomic_##NAME##_##TYPE##_nonlocked(volatile u_##TYPE *p, u_##TYPE v)\
-{							\
-	__asm __volatile(OP				\
-			 : "+m" (*p)			\
-			 : "iq" (V)); 			\
-}
-
-#endif /* KLD_MODULE */
-
-/* egcs 1.1.2+ version */
-ATOMIC_ASM(set,	     char,  "orb %b1,%0",   v)
-ATOMIC_ASM(clear,    char,  "andb %b1,%0", ~v)
-ATOMIC_ASM(add,	     char,  "addb %b1,%0",  v)
-ATOMIC_ASM(subtract, char,  "subb %b1,%0",  v)
-
-ATOMIC_ASM(set,	     short, "orw %w1,%0",   v)
-ATOMIC_ASM(clear,    short, "andw %w1,%0", ~v)
-ATOMIC_ASM(add,	     short, "addw %w1,%0",  v)
-ATOMIC_ASM(subtract, short, "subw %w1,%0",  v)
-
-ATOMIC_ASM(set,	     int,   "orl %1,%0",   v)
-ATOMIC_ASM(clear,    int,   "andl %1,%0", ~v)
-ATOMIC_ASM(add,	     int,   "addl %1,%0",  v)
-ATOMIC_ASM(subtract, int,   "subl %1,%0",  v)
-
-ATOMIC_ASM(set,	     long,  "orl %1,%0",   v)
-ATOMIC_ASM(clear,    long,  "andl %1,%0", ~v)
-ATOMIC_ASM(add,	     long,  "addl %1,%0",  v)
-ATOMIC_ASM(subtract, long,  "subl %1,%0",  v)
-
-#if defined(KLD_MODULE)
-
-u_int	atomic_readandclear_int(volatile u_int *addr);
-
-#else /* !KLD_MODULE */
-
-static __inline u_int
-atomic_readandclear_int(volatile u_int *addr)
-{
-	u_int res;
-
-	res = 0;
-	__asm __volatile(
-	"	xchgl	%1,%0 ;		"
-	"# atomic_readandclear_int"
-	: "+r" (res),			/* 0 */
-	  "=m" (*addr)			/* 1 */
-	: "m" (*addr));
-
-	return (res);
-}
-
-#endif /* KLD_MODULE */
-
-
-/*
- * atomic_poll_acquire_int(P)	Returns non-zero on success, 0 if the lock
- *				has already been acquired.
- * atomic_poll_release_int(P)
- *
- * These support the NDIS driver and are also used for IPIQ interlocks
- * between cpus.  Both the acquisition and release must be 
- * cache-synchronizing instructions.
- */
-
-#if defined(KLD_MODULE)
-
-extern int atomic_swap_int(volatile int *addr, int value);
-extern long atomic_swap_long(volatile long *addr, long value);
-extern void *atomic_swap_ptr(volatile void **addr, void *value);
-extern int atomic_poll_acquire_int(volatile u_int *p);
-extern void atomic_poll_release_int(volatile u_int *p);
-
-#else
-
-static __inline int
-atomic_swap_int(volatile int *addr, int value)
-{
-	__asm __volatile("xchgl %0, %1" :
-	    "=r" (value), "=m" (*addr) : "0" (value) : "memory");
-	return (value);
-}
-
-static __inline long
-atomic_swap_long(volatile long *addr, long value)
-{
-	return (atomic_swap_int((volatile int *)addr, (int)value));
-}
-
-static __inline void *
-atomic_swap_ptr(volatile void **addr, void *value)
-{
-	__asm __volatile("xchgl %0, %1" :
-	    "=r" (value), "=m" (*addr) : "0" (value) : "memory");
-	return (value);
-}
-
-static __inline int
-atomic_poll_acquire_int(volatile u_int *p)
-{
-	u_int data;
-
-	__asm __volatile(MPLOCKED "btsl $0,%0; setnc %%al; andl $255,%%eax" : "+m" (*p), "=a" (data));
-	return(data);
-}
-
-static __inline void
-atomic_poll_release_int(volatile u_int *p)
-{
-	__asm __volatile(MPLOCKED "btrl $0,%0" : "+m" (*p));
-}
-
-#endif
-
-/*
- * These functions operate on a 32 bit interrupt interlock which is defined
- * as follows:
- *
- *	bit 0-29	interrupt handler wait counter
- *	bit 30		interrupt handler disabled bit
- *	bit 31		interrupt handler currently running bit (1 = run)
- *
- * atomic_intr_cond_test(P)	Determine if the interlock is in an
- *				acquired state.  Returns 0 if it not
- *				acquired, non-zero if it is. (not MPLOCKed)
- *
- * atomic_intr_cond_try(P) 	Attempt to set bit 31 to acquire the
- *				interlock.  If we are unable to set bit 31
- *				we return 1, otherwise we return 0.
- *
- * atomic_intr_cond_enter(P, func, arg)
- *				Attempt to set bit 31 to acquire the
- *				interlock.  If we are unable to set bit 31,
- *				the wait is incremented counter and func(arg)
- *				is called in a loop until we are able to set
- *				bit 31.  Once we set bit 31, wait counter
- *				is decremented.
- *
- * atomic_intr_cond_exit(P, func, arg)
- *				Clear bit 31.  If the wait counter is still
- *				non-zero call func(arg) once.
- *
- * atomic_intr_handler_disable(P)
- *				Set bit 30, indicating that the interrupt
- *				handler has been disabled.  Must be called
- *				after the hardware is disabled.
- *
- *				Returns bit 31 indicating whether a serialized
- *				accessor is active (typically the interrupt
- *				handler is running).  0 == not active,
- *				non-zero == active.
- *
- * atomic_intr_handler_enable(P)
- *				Clear bit 30, indicating that the interrupt
- *				handler has been enabled.  Must be called
- *				before the hardware is actually enabled.
- *
- * atomic_intr_handler_is_enabled(P)
- *				Returns bit 30, 0 indicates that the handler
- *				is enabled, non-zero indicates that it is
- *				disabled.  The request counter portion of
- *				the field is ignored. (not MPLOCKed)
- *
- * atomic_intr_cond_inc(P)	Increment wait counter by 1.
- * atomic_intr_cond_dec(P)	Decrement wait counter by 1.
- */
-
-#if defined(KLD_MODULE)
-
-void atomic_intr_init(__atomic_intr_t *p);
-int atomic_intr_handler_disable(__atomic_intr_t *p);
-void atomic_intr_handler_enable(__atomic_intr_t *p);
-int atomic_intr_handler_is_enabled(__atomic_intr_t *p);
-int atomic_intr_cond_test(__atomic_intr_t *p);
-int atomic_intr_cond_try(__atomic_intr_t *p);
-void atomic_intr_cond_enter(__atomic_intr_t *p, void (*func)(void *), void *arg);
-void atomic_intr_cond_exit(__atomic_intr_t *p, void (*func)(void *), void *arg);
-void atomic_intr_cond_inc(__atomic_intr_t *p);
-void atomic_intr_cond_dec(__atomic_intr_t *p);
-uint64_t atomic_load_acq_64_i586(volatile uint64_t *p);
-
-#else
-
-static __inline void
-atomic_intr_init(__atomic_intr_t *p)
-{
-	*p = 0;
-}
-
-static __inline int
-atomic_intr_handler_disable(__atomic_intr_t *p)
-{
-	int data;
-
-	__asm __volatile(MPLOCKED "orl $0x40000000,%1; movl %1,%%eax; " \
-				  "andl $0x80000000,%%eax" \
-				  : "=a"(data) , "+m"(*p));
-	return(data);
-}
-
-static __inline void
-atomic_intr_handler_enable(__atomic_intr_t *p)
-{
-	__asm __volatile(MPLOCKED "andl $0xBFFFFFFF,%0" : "+m" (*p));
-}
-
-static __inline int
-atomic_intr_handler_is_enabled(__atomic_intr_t *p)
-{
-	int data;
-
-	__asm __volatile("movl %1,%%eax; andl $0x40000000,%%eax" \
-			 : "=a"(data) : "m"(*p));
-	return(data);
-}
-
-static __inline void
-atomic_intr_cond_inc(__atomic_intr_t *p)
-{
-	__asm __volatile(MPLOCKED "incl %0" : "+m" (*p));
-}
-
-static __inline void
-atomic_intr_cond_dec(__atomic_intr_t *p)
-{
-	__asm __volatile(MPLOCKED "decl %0" : "+m" (*p));
-}
-
-static __inline void
-atomic_intr_cond_enter(__atomic_intr_t *p, void (*func)(void *), void *arg)
-{
-	__asm __volatile(MPLOCKED "btsl $31,%0; jnc 3f; " \
-			 MPLOCKED "incl %0; " \
-			 "1: ;" \
-			 MPLOCKED "btsl $31,%0; jnc 2f; " \
-			 "pushl %2; call *%1; addl $4,%%esp; " \
-			 "jmp 1b; " \
-			 "2: ;" \
-			 MPLOCKED "decl %0; " \
-			 "3: ;" \
-			 : "+m" (*p) \
-			 : "r"(func), "m"(arg) \
-			 : "ax", "cx", "dx");
-}
-
-/*
- * Attempt to enter the interrupt condition variable.  Returns zero on
- * success, 1 on failure.
- */
-static __inline int
-atomic_intr_cond_try(__atomic_intr_t *p)
-{
-	int ret;
-
-	__asm __volatile("subl %%eax,%%eax; "			\
-			 MPLOCKED "btsl $31,%0; jnc 2f; "	\
-			 "movl $1,%%eax;"			\
-			 "2: ;"
-			 : "+m" (*p), "=&a"(ret)
-                         : : "cx", "dx");
-	return (ret);
-}
-
-
-static __inline int
-atomic_intr_cond_test(__atomic_intr_t *p)
-{
-	return((int)(*p & 0x80000000));
-}
-
-static __inline void
-atomic_intr_cond_exit(__atomic_intr_t *p, void (*func)(void *), void *arg)
-{
-	__asm __volatile(MPLOCKED "btrl $31,%0; " \
-			 "testl $0x3FFFFFFF,%0; jz 1f; " \
-			 "pushl %2; call *%1; addl $4,%%esp; " \
-			 "1: ;" \
-			 : "+m" (*p) \
-			 : "r"(func), "m"(arg) \
-			 : "ax", "cx", "dx");
-}
-
-static __inline uint64_t
-atomic_load_acq_64_i586(volatile uint64_t *p)
-{
-	uint64_t res;
-
-	__asm __volatile(
-	"	movl %%ebx,%%eax ;	"
-	"	movl %%ecx,%%edx ;	"
-	"	" MPLOCKED "		"
-	"	cmpxchg8b %2"
-	: "=&A" (res),			/* 0 */
-	  "=m" (*p)			/* 1 */
-	: "m" (*p)			/* 2 */
-	: "memory", "cc");
-
-	return (res);
-}
-
-#endif /* _KERNEL */
-
-/*
- * Atomic compare and set
- *
- * if (*_dst == _old) *_dst = _new (all 32 bit words)
- *
- * Returns 0 on failure, non-zero on success
- */
-#if defined(KLD_MODULE)
-
-extern int atomic_cmpset_int(volatile u_int *_dst, u_int _old, u_int _new);
-extern long atomic_cmpset_long(volatile u_long *_dst, u_long _exp, u_long _src);
-extern u_int atomic_fetchadd_int(volatile u_int *_p, u_int _v);
-extern u_long atomic_fetchadd_long(volatile u_long *_p, u_long _v);
-
-#else
-
-static __inline int
-atomic_cmpset_int(volatile u_int *_dst, u_int _old, u_int _new)
-{
-	u_int res = _old;
-
-	__asm __volatile(MPLOCKED "cmpxchgl %2,%1; " \
-			 : "+a" (res), "=m" (*_dst) \
-			 : "r" (_new), "m" (*_dst) \
-			 : "memory");
-	return (res == _old);
-}
-
-static __inline long
-atomic_cmpset_long(volatile u_long *_dst, u_long _exp, u_long _src)
-{
-	 return (atomic_cmpset_int((volatile u_int *)_dst, (u_int)_exp,
-				   (u_int)_src));
-}
-
-/*
- * Atomically add the value of v to the integer pointed to by p and return
- * the previous value of *p.
- */
-static __inline u_int
-atomic_fetchadd_int(volatile u_int *_p, u_int _v)
-{
-	__asm __volatile(MPLOCKED "xaddl %0,%1; " \
-			 : "+r" (_v), "=m" (*_p)	\
-			 : "m" (*_p)		\
-			 : "memory");
-	return (_v);
-}
-
-static __inline int
-atomic_testandset_int(volatile u_int *p, u_int v)
-{
-	u_char res;
-
-	__asm __volatile(
-	"	" MPLOCKED "		"
-	"	btsl	%2,%1 ;		"
-	"	setc	%0 ;		"
-	"# atomic_testandset_int"
-	: "=q" (res),			/* 0 */
-	  "+m" (*p)			/* 1 */
-	: "Ir" (v & 0x1f)		/* 2 */
-	: "cc");
-	return (res);
-}
-
-static __inline u_long
-atomic_fetchadd_long(volatile u_long *_p, u_long _v)
-{
-	__asm __volatile(MPLOCKED "xaddl %0,%1; " \
-			 : "+r" (_v), "=m" (*_p)	\
-			 : "m" (*_p)		\
-			 : "memory");
-	return (_v);
-}
-
-#endif	/* KLD_MODULE */
-
-#if defined(KLD_MODULE)
-
-#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP)			\
-extern u_##TYPE	atomic_load_acq_##TYPE(volatile u_##TYPE *p);	\
-extern void	atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v);
-
-#else /* !KLD_MODULE */
-
-#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP)		\
-static __inline u_##TYPE				\
-atomic_load_acq_##TYPE(volatile u_##TYPE *p)		\
-{							\
-	u_##TYPE res;					\
-							\
-	__asm __volatile(MPLOCKED LOP			\
-	: "=a" (res),			/* 0 */		\
-	  "=m" (*p)			/* 1 */		\
-	: "m" (*p)			/* 2 */		\
-	: "memory");					\
-							\
-	return (res);					\
-}							\
-							\
-/*							\
- * The XCHG instruction asserts LOCK automagically.	\
- */							\
-static __inline void					\
-atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
-{							\
-	__asm __volatile(SOP				\
-	: "=m" (*p),			/* 0 */		\
-	  "+r" (v)			/* 1 */		\
-	: "m" (*p));			/* 2 */		\
-}							\
-struct __hack
-
-#endif /* !KLD_MODULE */
-
-ATOMIC_STORE_LOAD(char, "cmpxchgb %b0,%1", "xchgb %b1,%0");
-ATOMIC_STORE_LOAD(short,"cmpxchgw %w0,%1", "xchgw %w1,%0");
-ATOMIC_STORE_LOAD(int,  "cmpxchgl %0,%1",  "xchgl %1,%0");
-ATOMIC_STORE_LOAD(long, "cmpxchgl %0,%1",  "xchgl %1,%0");
-
-#undef ATOMIC_ASM
-#undef ATOMIC_STORE_LOAD
-
-/* Acquire and release variants are identical to the normal ones. */
-#define	atomic_set_acq_char		atomic_set_char
-#define	atomic_set_rel_char		atomic_set_char
-#define	atomic_clear_acq_char		atomic_clear_char
-#define	atomic_clear_rel_char		atomic_clear_char
-#define	atomic_add_acq_char		atomic_add_char
-#define	atomic_add_rel_char		atomic_add_char
-#define	atomic_subtract_acq_char	atomic_subtract_char
-#define	atomic_subtract_rel_char	atomic_subtract_char
-
-#define	atomic_set_acq_short		atomic_set_short
-#define	atomic_set_rel_short		atomic_set_short
-#define	atomic_clear_acq_short		atomic_clear_short
-#define	atomic_clear_rel_short		atomic_clear_short
-#define	atomic_add_acq_short		atomic_add_short
-#define	atomic_add_rel_short		atomic_add_short
-#define	atomic_subtract_acq_short	atomic_subtract_short
-#define	atomic_subtract_rel_short	atomic_subtract_short
-
-#define	atomic_set_acq_int		atomic_set_int
-#define	atomic_set_rel_int		atomic_set_int
-#define	atomic_clear_acq_int		atomic_clear_int
-#define	atomic_clear_rel_int		atomic_clear_int
-#define	atomic_add_acq_int		atomic_add_int
-#define	atomic_add_rel_int		atomic_add_int
-#define	atomic_subtract_acq_int		atomic_subtract_int
-#define	atomic_subtract_rel_int		atomic_subtract_int
-#define	atomic_cmpset_acq_int		atomic_cmpset_int
-#define	atomic_cmpset_rel_int		atomic_cmpset_int
-
-#define	atomic_set_acq_long		atomic_set_long
-#define	atomic_set_rel_long		atomic_set_long
-#define	atomic_clear_acq_long		atomic_clear_long
-#define	atomic_clear_rel_long		atomic_clear_long
-#define	atomic_add_acq_long		atomic_add_long
-#define	atomic_add_rel_long		atomic_add_long
-#define	atomic_subtract_acq_long	atomic_subtract_long
-#define	atomic_subtract_rel_long	atomic_subtract_long
-#define	atomic_cmpset_acq_long		atomic_cmpset_long
-#define	atomic_cmpset_rel_long		atomic_cmpset_long
-
-/* cpumask_t is 32-bits on i386 */
-#define atomic_set_cpumask		atomic_set_int
-#define atomic_clear_cpumask		atomic_clear_int
-#define atomic_cmpset_cpumask		atomic_cmpset_int
-
-/* Operations on 8-bit bytes. */
-#define	atomic_set_8		atomic_set_char
-#define	atomic_set_acq_8	atomic_set_acq_char
-#define	atomic_set_rel_8	atomic_set_rel_char
-#define	atomic_clear_8		atomic_clear_char
-#define	atomic_clear_acq_8	atomic_clear_acq_char
-#define	atomic_clear_rel_8	atomic_clear_rel_char
-#define	atomic_add_8		atomic_add_char
-#define	atomic_add_acq_8	atomic_add_acq_char
-#define	atomic_add_rel_8	atomic_add_rel_char
-#define	atomic_subtract_8	atomic_subtract_char
-#define	atomic_subtract_acq_8	atomic_subtract_acq_char
-#define	atomic_subtract_rel_8	atomic_subtract_rel_char
-#define	atomic_load_acq_8	atomic_load_acq_char
-#define	atomic_store_rel_8	atomic_store_rel_char
-
-/* Operations on 16-bit words. */
-#define	atomic_set_16		atomic_set_short
-#define	atomic_set_acq_16	atomic_set_acq_short
-#define	atomic_set_rel_16	atomic_set_rel_short
-#define	atomic_clear_16		atomic_clear_short
-#define	atomic_clear_acq_16	atomic_clear_acq_short
-#define	atomic_clear_rel_16	atomic_clear_rel_short
-#define	atomic_add_16		atomic_add_short
-#define	atomic_add_acq_16	atomic_add_acq_short
-#define	atomic_add_rel_16	atomic_add_rel_short
-#define	atomic_subtract_16	atomic_subtract_short
-#define	atomic_subtract_acq_16	atomic_subtract_acq_short
-#define	atomic_subtract_rel_16	atomic_subtract_rel_short
-#define	atomic_load_acq_16	atomic_load_acq_short
-#define	atomic_store_rel_16	atomic_store_rel_short
-
-/* Operations on 32-bit double words. */
-#define	atomic_set_32		atomic_set_int
-#define	atomic_set_acq_32	atomic_set_acq_int
-#define	atomic_set_rel_32	atomic_set_rel_int
-#define	atomic_clear_32		atomic_clear_int
-#define	atomic_clear_acq_32	atomic_clear_acq_int
-#define	atomic_clear_rel_32	atomic_clear_rel_int
-#define	atomic_add_32		atomic_add_int
-#define	atomic_add_acq_32	atomic_add_acq_int
-#define	atomic_add_rel_32	atomic_add_rel_int
-#define	atomic_subtract_32	atomic_subtract_int
-#define	atomic_subtract_acq_32	atomic_subtract_acq_int
-#define	atomic_subtract_rel_32	atomic_subtract_rel_int
-#define	atomic_load_acq_32	atomic_load_acq_int
-#define	atomic_store_rel_32	atomic_store_rel_int
-#define	atomic_cmpset_32	atomic_cmpset_int
-#define	atomic_cmpset_acq_32	atomic_cmpset_acq_int
-#define	atomic_cmpset_rel_32	atomic_cmpset_rel_int
-#define	atomic_readandclear_32	atomic_readandclear_int
-#define	atomic_fetchadd_32	atomic_fetchadd_int
-
-/* Operations on 64-bit quad words. */
-#define	atomic_load_acq_64	atomic_load_acq_64_i586
-
-/* Operations on pointers. */
-#define	atomic_set_ptr(p, v) \
-	atomic_set_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_set_acq_ptr(p, v) \
-	atomic_set_acq_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_set_rel_ptr(p, v) \
-	atomic_set_rel_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_clear_ptr(p, v) \
-	atomic_clear_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_clear_acq_ptr(p, v) \
-	atomic_clear_acq_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_clear_rel_ptr(p, v) \
-	atomic_clear_rel_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_add_ptr(p, v) \
-	atomic_add_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_add_acq_ptr(p, v) \
-	atomic_add_acq_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_add_rel_ptr(p, v) \
-	atomic_add_rel_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_subtract_ptr(p, v) \
-	atomic_subtract_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_subtract_acq_ptr(p, v) \
-	atomic_subtract_acq_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_subtract_rel_ptr(p, v) \
-	atomic_subtract_rel_int((volatile u_int *)(p), (u_int)(v))
-#define	atomic_load_acq_ptr(p) \
-	atomic_load_acq_int((volatile u_int *)(p))
-#define	atomic_store_rel_ptr(p, v) \
-	atomic_store_rel_int((volatile u_int *)(p), (v))
-#define	atomic_cmpset_ptr(dst, old, new) \
-	atomic_cmpset_int((volatile u_int *)(dst), (u_int)(old), (u_int)(new))
-#define	atomic_cmpset_acq_ptr(dst, old, new) \
-	atomic_cmpset_acq_int((volatile u_int *)(dst), (u_int)(old), \
-	    (u_int)(new))
-#define	atomic_cmpset_rel_ptr(dst, old, new) \
-	atomic_cmpset_rel_int((volatile u_int *)(dst), (u_int)(old), \
-	    (u_int)(new))
-#define	atomic_readandclear_ptr(p) \
-	atomic_readandclear_int((volatile u_int *)(p))
-
-#endif /* ! _CPU_ATOMIC_H_ */
diff --git a/sys/cpu/i386/include/bus_at386.h b/sys/cpu/i386/include/bus_at386.h
deleted file mode 100644
index a43c4ae..0000000
--- a/sys/cpu/i386/include/bus_at386.h
+++ /dev/null
@@ -1,896 +0,0 @@
-/*	$NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $	*/
-
-/*-
- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the NetBSD
- *	Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
- * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Christopher G. Demetriou
- *	for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/bus_at386.h,v 1.8.2.3 2002/03/03 05:42:50 nyan Exp $
- * $DragonFly: src/sys/cpu/i386/include/bus_at386.h,v 1.10 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_BUS_AT386_H_
-#define _CPU_BUS_AT386_H_
-
-#include <machine/cpufunc.h>
-
-/*
- * Values for the i386 bus space tag, not to be used directly by MI code.
- */
-#define	I386_BUS_SPACE_IO	0	/* space is i/o space */
-#define I386_BUS_SPACE_MEM	1	/* space is mem space */
-
-/*
- * Bus address and size types
- */
-typedef u_int32_t bus_addr_t;
-typedef u_int32_t bus_size_t;
-
-#define BUS_SPACE_MAXSIZE_24BIT	0xFFFFFF
-#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF
-#define BUS_SPACE_MAXSIZE	(64 * 1024) /* Maximum supported size */
-#define BUS_SPACE_MAXADDR_24BIT	0xFFFFFF
-#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF
-#define BUS_SPACE_MAXADDR	BUS_SPACE_MAXADDR_32BIT
-
-#define BUS_SPACE_UNRESTRICTED	(~0)
-
-/*
- * Access methods for bus resources and address space.
- */
-typedef	int bus_space_tag_t;
-typedef	u_int bus_space_handle_t;
-
-/*
- * Map a region of device bus space into CPU virtual address space.
- */
-
-#define	BUS_SPACE_MAP_CACHEABLE		0x01
-#define	BUS_SPACE_MAP_LINEAR		0x02
-
-int	bus_space_map(bus_space_tag_t t, bus_addr_t addr, bus_size_t size,
-		      int flags, bus_space_handle_t *bshp);
-
-/*
- * Unmap a region of device bus space.
- */
-
-static __inline void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh,
-				     bus_size_t size);
-
-static __inline void
-bus_space_unmap(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, bus_size_t size __unused )
-{
-}
-
-/*
- * Get a new handle for a subregion of an already-mapped area of bus space.
- */
-
-static __inline int bus_space_subregion(bus_space_tag_t t,
-					bus_space_handle_t bsh,
-					bus_size_t offset, bus_size_t size,
-					bus_space_handle_t *nbshp);
-
-static __inline int
-bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t bsh,
-		    bus_size_t offset, bus_size_t size __unused,
-		    bus_space_handle_t *nbshp)
-{
-
-	*nbshp = bsh + offset;
-	return (0);
-}
-
-static __inline void *
-bus_space_kva(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		return ((void *)0);
-	return ((void *)(handle + offset));
-}
-
-/*
- * Allocate a region of memory that is accessible to devices in bus space.
- */
-
-int	bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart,
-			bus_addr_t rend, bus_size_t size, bus_size_t align,
-			bus_size_t boundary, int flags, bus_addr_t *addrp,
-			bus_space_handle_t *bshp);
-
-/*
- * Free a region of bus space accessible memory.
- */
-
-static __inline void bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh,
-				    bus_size_t size);
-
-static __inline void
-bus_space_free(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, bus_size_t size __unused)
-{
-}
-
-/*
- * Read a 1, 2, 4, or 8 byte quantity from bus space
- * described by tag/handle/offset.
- */
-static __inline u_int8_t bus_space_read_1(bus_space_tag_t tag,
-					  bus_space_handle_t handle,
-					  bus_size_t offset);
-
-static __inline u_int16_t bus_space_read_2(bus_space_tag_t tag,
-					   bus_space_handle_t handle,
-					   bus_size_t offset);
-
-static __inline u_int32_t bus_space_read_4(bus_space_tag_t tag,
-					   bus_space_handle_t handle,
-					   bus_size_t offset);
-
-static __inline u_int8_t
-bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t handle,
-		 bus_size_t offset)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		return (inb(handle + offset));
-	return (*(volatile u_int8_t *)(handle + offset));
-}
-
-static __inline u_int16_t
-bus_space_read_2(bus_space_tag_t tag, bus_space_handle_t handle,
-		 bus_size_t offset)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		return (inw(handle + offset));
-	return (*(volatile u_int16_t *)(handle + offset));
-}
-
-static __inline u_int32_t
-bus_space_read_4(bus_space_tag_t tag, bus_space_handle_t handle,
-		 bus_size_t offset)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		return (inl(handle + offset));
-	return (*(volatile u_int32_t *)(handle + offset));
-}
-
-/*
- * Read `count' 1, 2, 4, or 8 byte quantities from bus space
- * described by tag/handle/offset and copy into buffer provided.
- */
-static __inline void bus_space_read_multi_1(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int8_t *addr,
-					    size_t count);
-
-static __inline void bus_space_read_multi_2(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int16_t *addr,
-					    size_t count);
-
-static __inline void bus_space_read_multi_4(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int32_t *addr,
-					    size_t count);
-
-static __inline void
-bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int8_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		insb(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	movb (%2),%%al				\n\
-			stosb					\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory");
-	}
-}
-
-static __inline void
-bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int16_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		insw(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	movw (%2),%%ax				\n\
-			stosw					\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory");
-	}
-}
-
-static __inline void
-bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int32_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		insl(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	movl (%2),%%eax				\n\
-			stosl					\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory");
-	}
-}
-
-/*
- * Read `count' 1, 2, 4, or 8 byte quantities from bus space
- * described by tag/handle and starting at `offset' and copy into
- * buffer provided.
- */
-static __inline void bus_space_read_region_1(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset, u_int8_t *addr,
-					     size_t count);
-
-static __inline void bus_space_read_region_2(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset, u_int16_t *addr,
-					     size_t count);
-
-static __inline void bus_space_read_region_4(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset, u_int32_t *addr,
-					     size_t count);
-
-
-static __inline void
-bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, u_int8_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	inb %w2,%%al				\n\
-			stosb					\n\
-			incl %2					\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count), "=d" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsb"					:
-		    "=D" (addr), "=c" (count), "=S" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, u_int16_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	inw %w2,%%ax				\n\
-			stosw					\n\
-			addl $2,%2				\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count), "=d" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsw"					:
-		    "=D" (addr), "=c" (count), "=S" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, u_int32_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	inl %w2,%%eax				\n\
-			stosl					\n\
-			addl $4,%2				\n\
-			loop 1b"				:
-		    "=D" (addr), "=c" (count), "=d" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsl"					:
-		    "=D" (addr), "=c" (count), "=S" (_port_)	:
-		    "0" (addr), "1" (count), "2" (_port_)	:
-		    "memory", "cc");
-	}
-}
-
-/*
- * Write the 1, 2, 4, or 8 byte value `value' to bus space
- * described by tag/handle/offset.
- */
-
-static __inline void bus_space_write_1(bus_space_tag_t tag,
-				       bus_space_handle_t bsh,
-				       bus_size_t offset, u_int8_t value);
-
-static __inline void bus_space_write_2(bus_space_tag_t tag,
-				       bus_space_handle_t bsh,
-				       bus_size_t offset, u_int16_t value);
-
-static __inline void bus_space_write_4(bus_space_tag_t tag,
-				       bus_space_handle_t bsh,
-				       bus_size_t offset, u_int32_t value);
-
-static __inline void
-bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int8_t value)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		outb(bsh + offset, value);
-	else
-		*(volatile u_int8_t *)(bsh + offset) = value;
-}
-
-static __inline void
-bus_space_write_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int16_t value)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		outw(bsh + offset, value);
-	else
-		*(volatile u_int16_t *)(bsh + offset) = value;
-}
-
-static __inline void
-bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int32_t value)
-{
-	if (tag == I386_BUS_SPACE_IO)
-		outl(bsh + offset, value);
-	else
-		*(volatile u_int32_t *)(bsh + offset) = value;
-}
-
-/*
- * Write `count' 1, 2, 4, or 8 byte quantities from the buffer
- * provided to bus space described by tag/handle/offset.
- */
-
-static __inline void bus_space_write_multi_1(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset,
-					     const u_int8_t *addr,
-					     size_t count);
-static __inline void bus_space_write_multi_2(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset,
-					     const u_int16_t *addr,
-					     size_t count);
-
-static __inline void bus_space_write_multi_4(bus_space_tag_t tag,
-					     bus_space_handle_t bsh,
-					     bus_size_t offset,
-					     const u_int32_t *addr,
-					     size_t count);
-
-static __inline void
-bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, const u_int8_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		outsb(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsb					\n\
-			movb %%al,(%2)				\n\
-			loop 1b"				:
-		    "=S" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, const u_int16_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		outsw(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsw					\n\
-			movw %%ax,(%2)				\n\
-			loop 1b"				:
-		    "=S" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-			bus_size_t offset, const u_int32_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		outsl(bsh + offset, addr, count);
-	} else {
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsl					\n\
-			movl %%eax,(%2)				\n\
-			loop 1b"				:
-		    "=S" (addr), "=c" (count)			:
-		    "r" (bsh + offset), "0" (addr), "1" (count)	:
-		    "%eax", "memory", "cc");
-	}
-}
-
-/*
- * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided
- * to bus space described by tag/handle starting at `offset'.
- */
-
-static __inline void bus_space_write_region_1(bus_space_tag_t tag,
-					      bus_space_handle_t bsh,
-					      bus_size_t offset,
-					      const u_int8_t *addr,
-					      size_t count);
-static __inline void bus_space_write_region_2(bus_space_tag_t tag,
-					      bus_space_handle_t bsh,
-					      bus_size_t offset,
-					      const u_int16_t *addr,
-					      size_t count);
-static __inline void bus_space_write_region_4(bus_space_tag_t tag,
-					      bus_space_handle_t bsh,
-					      bus_size_t offset,
-					      const u_int32_t *addr,
-					      size_t count);
-
-static __inline void
-bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-			 bus_size_t offset, const u_int8_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsb					\n\
-			outb %%al,%w0				\n\
-			incl %0					\n\
-			loop 1b"				:
-		    "=d" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsb"					:
-		    "=D" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-			 bus_size_t offset, const u_int16_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsw					\n\
-			outw %%ax,%w0				\n\
-			addl $2,%0				\n\
-			loop 1b"				:
-		    "=d" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsw"					:
-		    "=D" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "memory", "cc");
-	}
-}
-
-static __inline void
-bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-			 bus_size_t offset, const u_int32_t *addr, size_t count)
-{
-	if (tag == I386_BUS_SPACE_IO) {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-		1:	lodsl					\n\
-			outl %%eax,%w0				\n\
-			addl $4,%0				\n\
-			loop 1b"				:
-		    "=d" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "%eax", "memory", "cc");
-	} else {
-		int _port_ = bsh + offset;			\
-		__asm __volatile("				\n\
-			cld					\n\
-			repne					\n\
-			movsl"					:
-		    "=D" (_port_), "=S" (addr), "=c" (count)	:
-		    "0" (_port_), "1" (addr), "2" (count)	:
-		    "memory", "cc");
-	}
-}
-
-/*
- * Write the 1, 2, 4, or 8 byte value `val' to bus space described
- * by tag/handle/offset `count' times.
- */
-
-static __inline void bus_space_set_multi_1(bus_space_tag_t tag,
-					   bus_space_handle_t bsh,
-					   bus_size_t offset,
-					   u_int8_t value, size_t count);
-static __inline void bus_space_set_multi_2(bus_space_tag_t tag,
-					   bus_space_handle_t bsh,
-					   bus_size_t offset,
-					   u_int16_t value, size_t count);
-static __inline void bus_space_set_multi_4(bus_space_tag_t tag,
-					   bus_space_handle_t bsh,
-					   bus_size_t offset,
-					   u_int32_t value, size_t count);
-
-static __inline void
-bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-		      bus_size_t offset, u_int8_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		while (count--)
-			outb(addr, value);
-	} else {
-		while (count--)
-			*(volatile u_int8_t *)(addr) = value;
-	}
-}
-
-static __inline void
-bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-		     bus_size_t offset, u_int16_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		while (count--)
-			outw(addr, value);
-	} else {
-		while (count--)
-			*(volatile u_int16_t *)(addr) = value;
-	}
-}
-
-static __inline void
-bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-		      bus_size_t offset, u_int32_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		while (count--)
-			outl(addr, value);
-	} else {
-		while (count--)
-			*(volatile u_int32_t *)(addr) = value;
-	}
-}
-
-/*
- * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described
- * by tag/handle starting at `offset'.
- */
-
-static __inline void bus_space_set_region_1(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int8_t value,
-					    size_t count);
-static __inline void bus_space_set_region_2(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int16_t value,
-					    size_t count);
-static __inline void bus_space_set_region_4(bus_space_tag_t tag,
-					    bus_space_handle_t bsh,
-					    bus_size_t offset, u_int32_t value,
-					    size_t count);
-
-static __inline void
-bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int8_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		for (; count != 0; count--, addr++)
-			outb(addr, value);
-	} else {
-		for (; count != 0; count--, addr++)
-			*(volatile u_int8_t *)(addr) = value;
-	}
-}
-
-static __inline void
-bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int16_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		for (; count != 0; count--, addr += 2)
-			outw(addr, value);
-	} else {
-		for (; count != 0; count--, addr += 2)
-			*(volatile u_int16_t *)(addr) = value;
-	}
-}
-
-static __inline void
-bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
-		       bus_size_t offset, u_int32_t value, size_t count)
-{
-	bus_space_handle_t addr = bsh + offset;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		for (; count != 0; count--, addr += 4)
-			outl(addr, value);
-	} else {
-		for (; count != 0; count--, addr += 4)
-			*(volatile u_int32_t *)(addr) = value;
-	}
-}
-
-/*
- * Copy `count' 1, 2, 4, or 8 byte values from bus space starting
- * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2.
- */
-
-static __inline void bus_space_copy_region_1(bus_space_tag_t tag,
-					     bus_space_handle_t bsh1,
-					     bus_size_t off1,
-					     bus_space_handle_t bsh2,
-					     bus_size_t off2, size_t count);
-
-static __inline void bus_space_copy_region_2(bus_space_tag_t tag,
-					     bus_space_handle_t bsh1,
-					     bus_size_t off1,
-					     bus_space_handle_t bsh2,
-					     bus_size_t off2, size_t count);
-
-static __inline void bus_space_copy_region_4(bus_space_tag_t tag,
-					     bus_space_handle_t bsh1,
-					     bus_size_t off1,
-					     bus_space_handle_t bsh2,
-					     bus_size_t off2, size_t count);
-
-static __inline void
-bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1,
-			bus_size_t off1, bus_space_handle_t bsh2,
-			bus_size_t off2, size_t count)
-{
-	bus_space_handle_t addr1 = bsh1 + off1;
-	bus_space_handle_t addr2 = bsh2 + off2;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1++, addr2++)
-				outb(addr2, inb(addr1));
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += (count - 1), addr2 += (count - 1);
-			    count != 0; count--, addr1--, addr2--)
-				outb(addr2, inb(addr1));
-		}
-	} else {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1++, addr2++)
-				*(volatile u_int8_t *)(addr2) =
-				    *(volatile u_int8_t *)(addr1);
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += (count - 1), addr2 += (count - 1);
-			    count != 0; count--, addr1--, addr2--)
-				*(volatile u_int8_t *)(addr2) =
-				    *(volatile u_int8_t *)(addr1);
-		}
-	}
-}
-
-static __inline void
-bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1,
-			bus_size_t off1, bus_space_handle_t bsh2,
-			bus_size_t off2, size_t count)
-{
-	bus_space_handle_t addr1 = bsh1 + off1;
-	bus_space_handle_t addr2 = bsh2 + off2;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1 += 2, addr2 += 2)
-				outw(addr2, inw(addr1));
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += 2 * (count - 1), addr2 += 2 * (count - 1);
-			    count != 0; count--, addr1 -= 2, addr2 -= 2)
-				outw(addr2, inw(addr1));
-		}
-	} else {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1 += 2, addr2 += 2)
-				*(volatile u_int16_t *)(addr2) =
-				    *(volatile u_int16_t *)(addr1);
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += 2 * (count - 1), addr2 += 2 * (count - 1);
-			    count != 0; count--, addr1 -= 2, addr2 -= 2)
-				*(volatile u_int16_t *)(addr2) =
-				    *(volatile u_int16_t *)(addr1);
-		}
-	}
-}
-
-static __inline void
-bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1,
-			bus_size_t off1, bus_space_handle_t bsh2,
-			bus_size_t off2, size_t count)
-{
-	bus_space_handle_t addr1 = bsh1 + off1;
-	bus_space_handle_t addr2 = bsh2 + off2;
-
-	if (tag == I386_BUS_SPACE_IO) {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1 += 4, addr2 += 4)
-				outl(addr2, inl(addr1));
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1);
-			    count != 0; count--, addr1 -= 4, addr2 -= 4)
-				outl(addr2, inl(addr1));
-		}
-	} else {
-		if (addr1 >= addr2) {
-			/* src after dest: copy forward */
-			for (; count != 0; count--, addr1 += 4, addr2 += 4)
-				*(volatile u_int32_t *)(addr2) =
-				    *(volatile u_int32_t *)(addr1);
-		} else {
-			/* dest after src: copy backwards */
-			for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1);
-			    count != 0; count--, addr1 -= 4, addr2 -= 4)
-				*(volatile u_int32_t *)(addr2) =
-				    *(volatile u_int32_t *)(addr1);
-		}
-	}
-}
-
-/*
- * Bus read/write barrier methods.
- *
- *	void bus_space_barrier(bus_space_tag_t tag, bus_space_handle_t bsh,
- *			       bus_size_t offset, bus_size_t len, int flags);
- *
- * Note that BUS_SPACE_BARRIER_WRITE doesn't do anything other than
- * prevent reordering by the compiler; all Intel x86 processors currently
- * retire operations outside the CPU in program order.
- */
-#define	BUS_SPACE_BARRIER_READ	0x01		/* force read barrier */
-#define	BUS_SPACE_BARRIER_WRITE	0x02		/* force write barrier */
-
-static __inline void
-bus_space_barrier(bus_space_tag_t tag __unused, bus_space_handle_t bsh __unused,
-		bus_size_t offset __unused, bus_size_t len __unused, int flags)
-{
-	if (flags & BUS_SPACE_BARRIER_READ)
-		__asm __volatile("lock; addl $0,0(%%esp)" : : : "memory");
-	else
-		__asm __volatile("" : : : "memory");
-}
-
-#endif /* _CPU_BUS_AT386_H_ */
diff --git a/sys/cpu/i386/include/bus_dma.h b/sys/cpu/i386/include/bus_dma.h
deleted file mode 100644
index c30e0cb..0000000
--- a/sys/cpu/i386/include/bus_dma.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * Copyright (c) KATO Takenori, 1999.
- *
- * All rights reserved.  Unpublished rights reserved under the copyright
- * laws of Japan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer as
- *    the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/bus.h,v 1.7.2.2 2002/03/03 05:42:50 nyan Exp $
- * $DragonFly: src/sys/cpu/i386/include/bus_dma.h,v 1.8 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_BUS_DMA_H_
-#define _CPU_BUS_DMA_H_
-
-#ifndef _CPU_BUS_AT386_H_
-#include <cpu/bus_at386.h>
-#endif
-
-/*
- * Stream accesses are the same as normal accesses on i386; there are no
- * supported bus systems with an endianess different from the host one.
- */
-#define	bus_space_read_stream_1(t, h, o)	bus_space_read_1((t), (h), (o))
-#define	bus_space_read_stream_2(t, h, o)	bus_space_read_2((t), (h), (o))
-#define	bus_space_read_stream_4(t, h, o)	bus_space_read_4((t), (h), (o))
-
-#define	bus_space_read_multi_stream_1(t, h, o, a, c) \
-	bus_space_read_multi_1((t), (h), (o), (a), (c))
-#define	bus_space_read_multi_stream_2(t, h, o, a, c) \
-	bus_space_read_multi_2((t), (h), (o), (a), (c))
-#define	bus_space_read_multi_stream_4(t, h, o, a, c) \
-	bus_space_read_multi_4((t), (h), (o), (a), (c))
-
-#define	bus_space_write_stream_1(t, h, o, v) \
-	bus_space_write_1((t), (h), (o), (v))
-#define	bus_space_write_stream_2(t, h, o, v) \
-	bus_space_write_2((t), (h), (o), (v))
-#define	bus_space_write_stream_4(t, h, o, v) \
-	bus_space_write_4((t), (h), (o), (v))
-
-#define	bus_space_write_multi_stream_1(t, h, o, a, c) \
-	bus_space_write_multi_1((t), (h), (o), (a), (c))
-#define	bus_space_write_multi_stream_2(t, h, o, a, c) \
-	bus_space_write_multi_2((t), (h), (o), (a), (c))
-#define	bus_space_write_multi_stream_4(t, h, o, a, c) \
-	bus_space_write_multi_4((t), (h), (o), (a), (c))
-
-#define	bus_space_set_multi_stream_1(t, h, o, v, c) \
-	bus_space_set_multi_1((t), (h), (o), (v), (c))
-#define	bus_space_set_multi_stream_2(t, h, o, v, c) \
-	bus_space_set_multi_2((t), (h), (o), (v), (c))
-#define	bus_space_set_multi_stream_4(t, h, o, v, c) \
-	bus_space_set_multi_4((t), (h), (o), (v), (c))
-
-#define	bus_space_read_region_stream_1(t, h, o, a, c) \
-	bus_space_read_region_1((t), (h), (o), (a), (c))
-#define	bus_space_read_region_stream_2(t, h, o, a, c) \
-	bus_space_read_region_2((t), (h), (o), (a), (c))
-#define	bus_space_read_region_stream_4(t, h, o, a, c) \
-	bus_space_read_region_4((t), (h), (o), (a), (c))
-
-#define	bus_space_write_region_stream_1(t, h, o, a, c) \
-	bus_space_write_region_1((t), (h), (o), (a), (c))
-#define	bus_space_write_region_stream_2(t, h, o, a, c) \
-	bus_space_write_region_2((t), (h), (o), (a), (c))
-#define	bus_space_write_region_stream_4(t, h, o, a, c) \
-	bus_space_write_region_4((t), (h), (o), (a), (c))
-
-#define	bus_space_set_region_stream_1(t, h, o, v, c) \
-	bus_space_set_region_1((t), (h), (o), (v), (c))
-#define	bus_space_set_region_stream_2(t, h, o, v, c) \
-	bus_space_set_region_2((t), (h), (o), (v), (c))
-#define	bus_space_set_region_stream_4(t, h, o, v, c) \
-	bus_space_set_region_4((t), (h), (o), (v), (c))
-
-#define	bus_space_copy_region_stream_1(t, h1, o1, h2, o2, c) \
-	bus_space_copy_region_1((t), (h1), (o1), (h2), (o2), (c))
-#define	bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \
-	bus_space_copy_region_2((t), (h1), (o1), (h2), (o2), (c))
-#define	bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
-	bus_space_copy_region_4((t), (h1), (o1), (h2), (o2), (c))
-
-#endif /* _CPU_BUS_DMA_H_ */
diff --git a/sys/cpu/i386/include/coredump.h b/sys/cpu/i386/include/coredump.h
deleted file mode 100644
index 8ed3fd9..0000000
--- a/sys/cpu/i386/include/coredump.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * $DragonFly: src/sys/cpu/i386/include/coredump.h,v 1.2 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_COREDUMP_H_
-#define _CPU_COREDUMP_H_
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the i386: ???
- */
-struct md_coredump {
-};
-
-#endif
diff --git a/sys/cpu/i386/include/cpu.h b/sys/cpu/i386/include/cpu.h
deleted file mode 100644
index 471bb23..0000000
--- a/sys/cpu/i386/include/cpu.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)cpu.h	5.4 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/include/cpu.h,v 1.43.2.2 2001/06/15 09:37:57 scottl Exp $
- */
-
-#ifndef _CPU_CPU_H_
-#define	_CPU_CPU_H_
-
-/*
- * Definitions unique to i386 cpu support.
- */
-#ifndef _CPU_PSL_H_
-#include <machine/psl.h>
-#endif
-#ifndef _CPU_FRAME_H_
-#include <machine/frame.h>
-#endif
-#ifndef _CPU_SEGMENTS_H_
-#include <machine/segments.h>
-#endif
-
-/*
- * definitions of cpu-dependent requirements
- * referenced in generic code
- */
-
-#define	cpu_exec(p)	/* nothing */
-#define cpu_swapin(p)	/* nothing */
-#define cpu_setstack(lp, ap)		((lp)->lwp_md.md_regs[SP] = (ap))
-
-#define CLKF_INTR(intr_nest)	((intr_nest) > 1)
-#define CLKF_INTR_TD(td)	((td)->td_flags & TDF_INTTHREAD)
-#define	CLKF_PC(framep)		((framep)->if_eip)
-
-/*
- * Preempt the current process if in interrupt from user mode,
- * or after the current trap/syscall if in system mode.
- *
- * We now have to use a locked bus cycle due to LWKT_RESCHED/WAKEUP
- * signalling by other cpus.
- */
-#define	need_lwkt_resched()	\
-    atomic_set_int(&mycpu->gd_reqflags, RQF_AST_LWKT_RESCHED)
-#define	need_user_resched()	\
-    atomic_set_int(&mycpu->gd_reqflags, RQF_AST_USER_RESCHED)
-#define	need_proftick()		\
-    atomic_set_int(&mycpu->gd_reqflags, RQF_AST_OWEUPC)
-#define	need_ipiq()		\
-    atomic_set_int(&mycpu->gd_reqflags, RQF_IPIQ)
-#define	signotify()		\
-    atomic_set_int(&mycpu->gd_reqflags, RQF_AST_SIGNAL)
-#define	clear_user_resched()	\
-    atomic_clear_int(&mycpu->gd_reqflags, RQF_AST_USER_RESCHED)
-#define	clear_lwkt_resched()	\
-    atomic_clear_int(&mycpu->gd_reqflags, RQF_AST_LWKT_RESCHED)
-#define	clear_quickret()	\
-    atomic_clear_int(&mycpu->gd_reqflags, RQF_QUICKRET)
-#define	user_resched_wanted()	\
-    (mycpu->gd_reqflags & RQF_AST_USER_RESCHED)
-#define	lwkt_resched_wanted()	\
-    (mycpu->gd_reqflags & RQF_AST_LWKT_RESCHED)
-#define	any_resched_wanted()	\
-    (mycpu->gd_reqflags & (RQF_AST_LWKT_RESCHED|RQF_AST_USER_RESCHED))
-
-/*
- * CTL_MACHDEP definitions.
- */
-#define CPU_CONSDEV		1	/* cdev_t: console terminal device */
-#define	CPU_ADJKERNTZ		2	/* int:	timezone offset	(seconds) */
-#define	CPU_DISRTCSET		3	/* int: disable resettodr() call */
-#define CPU_BOOTINFO		4	/* struct: bootinfo */
-#define	CPU_WALLCLOCK		5	/* int:	indicates wall CMOS clock */
-#define	CPU_MAXID		6	/* number of valid machdep ids */
-
-#define CTL_MACHDEP_NAMES { \
-	{ 0, 0 }, \
-	{ "console_device", CTLTYPE_STRUCT }, \
-	{ "adjkerntz", CTLTYPE_INT }, \
-	{ "disable_rtc_set", CTLTYPE_INT }, \
-	{ "bootinfo", CTLTYPE_STRUCT }, \
-	{ "wall_cmos_clock", CTLTYPE_INT }, \
-}
-
-#ifdef _KERNEL
-
-struct lwp;
-
-extern char	btext[];
-extern char	etext[];
-
-void	fork_trampoline (void);
-void	generic_lwp_return (struct lwp *, struct trapframe *);
-void	fork_return (struct lwp *, struct trapframe *);
-
-#endif
-
-#endif /* !_CPU_CPU_H_ */
diff --git a/sys/cpu/i386/include/cpufunc.h b/sys/cpu/i386/include/cpufunc.h
deleted file mode 100644
index 2b00437..0000000
--- a/sys/cpu/i386/include/cpufunc.h
+++ /dev/null
@@ -1,812 +0,0 @@
-/*-
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/cpufunc.h,v 1.96.2.3 2002/04/28 22:50:54 dwmalone Exp $
- */
-
-/*
- * Functions to provide access to special i386 instructions.
- */
-
-#ifndef _CPU_CPUFUNC_H_
-#define	_CPU_CPUFUNC_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-#ifndef _SYS_CDEFS_H_
-#include <sys/cdefs.h>
-#endif
-#include <sys/thread.h>
-#include <machine/smp.h>
-
-__BEGIN_DECLS
-#define readb(va)	(*(volatile u_int8_t *) (va))
-#define readw(va)	(*(volatile u_int16_t *) (va))
-#define readl(va)	(*(volatile u_int32_t *) (va))
-
-#define writeb(va, d)	(*(volatile u_int8_t *) (va) = (d))
-#define writew(va, d)	(*(volatile u_int16_t *) (va) = (d))
-#define writel(va, d)	(*(volatile u_int32_t *) (va) = (d))
-
-#ifdef	__GNUC__
-
-#include <machine/lock.h>		/* XXX */
-
-#ifdef SWTCH_OPTIM_STATS
-extern	int	tlb_flush_count;	/* XXX */
-#endif
-
-static __inline void
-breakpoint(void)
-{
-	__asm __volatile("int $3");
-}
-
-static __inline void
-cpu_pause(void)
-{
-	__asm __volatile("pause":::"memory");
-}
-
-/*
- * Find the first 1 in mask, starting with bit 0 and return the
- * bit number.  If mask is 0 the result is undefined.
- */
-static __inline u_int
-bsfl(u_int mask)
-{
-	u_int	result;
-
-	__asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask));
-	return (result);
-}
-
-static __inline u_int
-bsflong(u_long mask)
-{
-	u_long	result;
-
-	__asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask));
-	return (result);
-}
-
-/*
- * Find the last 1 in mask, starting with bit 31 and return the
- * bit number.  If mask is 0 the result is undefined.
- */
-static __inline u_int
-bsrl(u_int mask)
-{
-	u_int	result;
-
-	__asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask));
-	return (result);
-}
-
-/*
- * Test and set the specified bit (1 << bit) in the integer.  The
- * previous value of the bit is returned (0 or 1).
- */
-static __inline int
-btsl(u_int *mask, int bit)
-{
-	int result;
-
-	__asm __volatile("btsl %2,%1; movl $0,%0; adcl $0,%0" :
-		    "=r"(result), "=m"(*mask) : "r" (bit));
-	return(result);
-}
-
-/*
- * Test and clear the specified bit (1 << bit) in the integer.  The
- * previous value of the bit is returned (0 or 1).
- */
-static __inline int
-btrl(u_int *mask, int bit)
-{
-	int result;
-
-	__asm __volatile("btrl %2,%1; movl $0,%0; adcl $0,%0" :
-		    "=r"(result), "=m"(*mask) : "r" (bit));
-	return(result);
-}
-
-static __inline void
-clflush(u_long addr)
-{
-	__asm __volatile("clflush %0" : : "m" (*(char *) addr));
-}
-
-static __inline void
-do_cpuid(u_int ax, u_int *p)
-{
-	__asm __volatile("cpuid"
-			 : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
-			 :  "0" (ax));
-}
-
-static __inline void
-cpuid_count(u_int ax, u_int cx, u_int *p)
-{
-	__asm __volatile("cpuid"
-			: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
-			:  "0" (ax), "c" (cx));
-}
-
-#ifndef _CPU_DISABLE_INTR_DEFINED
-
-static __inline void
-cpu_disable_intr(void)
-{
-	__asm __volatile("cli" : : : "memory");
-}
-
-#endif
-
-#ifndef _CPU_ENABLE_INTR_DEFINED
-
-static __inline void
-cpu_enable_intr(void)
-{
-	__asm __volatile("sti");
-}
-
-#endif
-
-/*
- * Cpu and compiler memory ordering fence.  mfence ensures strong read and
- * write ordering.
- *
- * A serializing or fence instruction is required here.  A locked bus
- * cycle on data for which we already own cache mastership is the most
- * portable.
- */
-static __inline void
-cpu_mfence(void)
-{
-#ifdef CPU_HAS_SSE2
-	__asm __volatile("mfence" : : : "memory");
-#else
-	__asm __volatile("lock; addl $0,(%%esp)" : : : "memory");
-#endif
-}
-
-/*
- * cpu_lfence() ensures strong read ordering for reads issued prior
- * to the instruction verses reads issued afterwords.
- *
- * A serializing or fence instruction is required here.  A locked bus
- * cycle on data for which we already own cache mastership is the most
- * portable.
- */
-static __inline void
-cpu_lfence(void)
-{
-#ifdef CPU_HAS_SSE2
-	__asm __volatile("lfence" : : : "memory");
-#else
-	__asm __volatile("lock; addl $0,(%%esp)" : : : "memory");
-#endif
-}
-
-/*
- * cpu_sfence() ensures strong write ordering for writes issued prior
- * to the instruction verses writes issued afterwords.  Writes are
- * ordered on intel cpus so we do not actually have to do anything.
- */
-static __inline void
-cpu_sfence(void)
-{
-	/*
-	 * NOTE:
-	 * Don't use 'sfence' here, as it will create a lot of
-	 * unnecessary stalls.
-	 */
-	__asm __volatile("" : : : "memory");
-}
-
-/*
- * cpu_ccfence() prevents the compiler from reordering instructions, in
- * particular stores, relative to the current cpu.  Use cpu_sfence() if
- * you need to guarentee ordering by both the compiler and by the cpu.
- *
- * This also prevents the compiler from caching memory loads into local
- * variables across the routine.
- */
-static __inline void
-cpu_ccfence(void)
-{
-	__asm __volatile("" : : : "memory");
-}
-
-/*
- * This is a horrible, horrible hack that might have to be put at the
- * end of certain procedures (on a case by case basis), just before it
- * returns to avoid what we believe to be an unreported AMD cpu bug.
- * Found to occur on both a Phenom II X4 820 (two of them), as well
- * as a 48-core built around an Opteron 6168 (Id = 0x100f91  Stepping = 1).
- * The problem does not appear to occur w/Intel cpus.
- *
- * The bug is likely related to either a write combining issue or the
- * Return Address Stack (RAS) hardware cache.
- *
- * In particular, we had to do this for GCC's fill_sons_in_loop() routine
- * which due to its deep recursion and stack flow appears to be able to
- * tickle the amd cpu bug (w/ gcc-4.4.7).  Adding a single 'nop' to the
- * end of the routine just before it returns works around the bug.
- *
- * The bug appears to be extremely sensitive to %rip and %rsp values, to
- * the point where even just inserting an instruction in an unrelated
- * procedure (shifting the entire code base being run) effects the outcome.
- * DragonFly is probably able to more readily reproduce the bug due to
- * the stackgap randomization code.  We would expect OpenBSD (where we got
- * the stackgap randomization code from) to also be able to reproduce the
- * issue.  To date we have only reproduced the issue in DragonFly.
- */
-#define __AMDCPUBUG_DFLY01_AVAILABLE__
-
-static __inline void
-cpu_amdcpubug_dfly01(void)
-{
-	__asm __volatile("nop" : : : "memory");
-}
-
-#ifdef _KERNEL
-
-#define	HAVE_INLINE_FFS
-
-static __inline int
-ffs(int mask)
-{
-	/*
-	 * Note that gcc-2's builtin ffs would be used if we didn't declare
-	 * this inline or turn off the builtin.  The builtin is faster but
-	 * broken in gcc-2.4.5 and slower but working in gcc-2.5 and later
-	 * versions.
-	 */
-	 return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
-}
-
-#define	HAVE_INLINE_FLS
-
-static __inline int
-fls(int mask)
-{
-	return (mask == 0 ? mask : (int) bsrl((u_int)mask) + 1);
-}
-
-#endif /* _KERNEL */
-
-/*
- * The following complications are to get around gcc not having a
- * constraint letter for the range 0..255.  We still put "d" in the
- * constraint because "i" isn't a valid constraint when the port
- * isn't constant.  This only matters for -O0 because otherwise
- * the non-working version gets optimized away.
- * 
- * Use an expression-statement instead of a conditional expression
- * because gcc-2.6.0 would promote the operands of the conditional
- * and produce poor code for "if ((inb(var) & const1) == const2)".
- *
- * The unnecessary test `(port) < 0x10000' is to generate a warning if
- * the `port' has type u_short or smaller.  Such types are pessimal.
- * This actually only works for signed types.  The range check is
- * careful to avoid generating warnings.
- */
-#define	inb(port) __extension__ ({					\
-	u_char	_data;							\
-	if (__builtin_constant_p(port) && ((port) & 0xffff) < 0x100	\
-	    && (port) < 0x10000)					\
-		_data = inbc(port);					\
-	else								\
-		_data = inbv(port);					\
-	_data; })
-
-#define	outb(port, data) (						\
-	__builtin_constant_p(port) && ((port) & 0xffff) < 0x100		\
-	&& (port) < 0x10000						\
-	? outbc(port, data) : outbv(port, data))
-
-static __inline u_char
-inbc(u_int port)
-{
-	u_char	data;
-
-	__asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port)));
-	return (data);
-}
-
-static __inline void
-outbc(u_int port, u_char data)
-{
-	__asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port)));
-}
-
-static __inline u_char
-inbv(u_int 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);
-}
-
-static __inline u_int
-inl(u_int port)
-{
-	u_int	data;
-
-	__asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port));
-	return (data);
-}
-
-static __inline void
-insb(u_int port, void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; insb"
-			 : "=D" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port)
-			 : "memory");
-}
-
-static __inline void
-insw(u_int port, void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; insw"
-			 : "=D" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port)
-			 : "memory");
-}
-
-static __inline void
-insl(u_int port, void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; insl"
-			 : "=D" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port)
-			 : "memory");
-}
-
-static __inline void
-invd(void)
-{
-	__asm __volatile("invd");
-}
-
-#if defined(_KERNEL)
-
-void smp_invltlb(void);
-void smp_invltlb_intr(void);
-
-#ifndef _CPU_INVLPG_DEFINED
-
-/*
- * Invalidate a patricular VA on this cpu only
- */
-static __inline void
-cpu_invlpg(void *addr)
-{
-	__asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
-}
-
-#endif
-
-#ifndef _CPU_INVLTLB_DEFINED
-
-/*
- * Invalidate the TLB on this cpu only
- */
-static __inline void
-cpu_invltlb(void)
-{
-	u_int	temp;
-	/*
-	 * This should be implemented as load_cr3(rcr3()) when load_cr3()
-	 * is inlined.
-	 */
-	__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
-			 : : "memory");
-#if defined(SWTCH_OPTIM_STATS)
-	++tlb_flush_count;
-#endif
-}
-
-#endif
-
-static __inline void
-cpu_nop(void)
-{
-	__asm __volatile("rep; nop");
-}
-
-#endif	/* _KERNEL */
-
-static __inline u_short
-inw(u_int port)
-{
-	u_short	data;
-
-	__asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port));
-	return (data);
-}
-
-static __inline u_int
-loadandclear(volatile u_int *addr)
-{
-	u_int	result;
-
-	__asm __volatile("xorl %0,%0; xchgl %1,%0"
-			 : "=&r" (result) : "m" (*addr));
-	return (result);
-}
-
-static __inline void
-outbv(u_int 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));
-}
-
-static __inline void
-outl(u_int port, u_int data)
-{
-	/*
-	 * outl() and outw() aren't used much so we haven't looked at
-	 * possible micro-optimizations such as the unnecessary
-	 * assignment for them.
-	 */
-	__asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port));
-}
-
-static __inline void
-outsb(u_int port, const void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; outsb"
-			 : "=S" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port));
-}
-
-static __inline void
-outsw(u_int port, const void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; outsw"
-			 : "=S" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port));
-}
-
-static __inline void
-outsl(u_int port, const void *addr, size_t cnt)
-{
-	__asm __volatile("cld; rep; outsl"
-			 : "=S" (addr), "=c" (cnt)
-			 :  "0" (addr),  "1" (cnt), "d" (port));
-}
-
-static __inline void
-outw(u_int port, u_short data)
-{
-	__asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port));
-}
-
-static __inline u_int
-rcr2(void)
-{
-	u_int	data;
-
-	__asm __volatile("movl %%cr2,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline u_int
-read_eflags(void)
-{
-	u_int	ef;
-
-	__asm __volatile("pushfl; popl %0" : "=r" (ef));
-	return (ef);
-}
-
-static __inline u_int64_t
-rdmsr(u_int msr)
-{
-	u_int64_t rv;
-
-	__asm __volatile("rdmsr" : "=A" (rv) : "c" (msr));
-	return (rv);
-}
-
-static __inline u_int64_t
-rdpmc(u_int pmc)
-{
-	u_int64_t rv;
-
-	__asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc));
-	return (rv);
-}
-
-#define _RDTSC_SUPPORTED_
-
-static __inline u_int64_t
-rdtsc(void)
-{
-	u_int64_t rv;
-
-	__asm __volatile("rdtsc" : "=A" (rv));
-	return (rv);
-}
-
-#ifdef _KERNEL
-#include <machine/cputypes.h>
-#include <machine/md_var.h>
-
-static __inline u_int64_t
-rdtsc_ordered(void)
-{
-	if (cpu_vendor_id == CPU_VENDOR_INTEL)
-		cpu_lfence();
-	else
-		cpu_mfence();
-	return rdtsc();
-}
-#endif
-
-static __inline void
-wbinvd(void)
-{
-	__asm __volatile("wbinvd");
-}
-
-#if defined(_KERNEL)
-void cpu_wbinvd_on_all_cpus_callback(void *arg);
-
-static __inline void
-cpu_wbinvd_on_all_cpus(void)
-{
-	lwkt_cpusync_simple(smp_active_mask, cpu_wbinvd_on_all_cpus_callback, NULL);
-}
-#endif
-
-static __inline void
-write_eflags(u_int ef)
-{
-	__asm __volatile("pushl %0; popfl" : : "r" (ef));
-}
-
-static __inline void
-wrmsr(u_int msr, u_int64_t newval)
-{
-	__asm __volatile("wrmsr" : : "A" (newval), "c" (msr));
-}
-
-static __inline u_short
-rfs(void)
-{
-	u_short sel;
-	__asm __volatile("movw %%fs,%0" : "=rm" (sel));
-	return (sel);
-}
-
-static __inline u_short
-rgs(void)
-{
-	u_short sel;
-	__asm __volatile("movw %%gs,%0" : "=rm" (sel));
-	return (sel);
-}
-
-static __inline void
-load_fs(u_short sel)
-{
-	__asm __volatile("movw %0,%%fs" : : "rm" (sel));
-}
-
-static __inline void
-load_gs(u_short sel)
-{
-	__asm __volatile("movw %0,%%gs" : : "rm" (sel));
-}
-
-static __inline u_int
-rdr0(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr0,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr0(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr0" : : "r" (sel));
-}
-
-static __inline u_int
-rdr1(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr1,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr1(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr1" : : "r" (sel));
-}
-
-static __inline u_int
-rdr2(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr2,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr2(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr2" : : "r" (sel));
-}
-
-static __inline u_int
-rdr3(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr3,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr3(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr3" : : "r" (sel));
-}
-
-static __inline u_int
-rdr4(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr4,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr4(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr4" : : "r" (sel));
-}
-
-static __inline u_int
-rdr5(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr5,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr5(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr5" : : "r" (sel));
-}
-
-static __inline u_int
-rdr6(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr6,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr6(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr6" : : "r" (sel));
-}
-
-static __inline u_int
-rdr7(void)
-{
-	u_int	data;
-	__asm __volatile("movl %%dr7,%0" : "=r" (data));
-	return (data);
-}
-
-static __inline void
-load_dr7(u_int sel)
-{
-	__asm __volatile("movl %0,%%dr7" : : "r" (sel));
-}
-
-#else /* !__GNUC__ */
-
-int	breakpoint	(void);
-void	cpu_pause	(void);
-u_int	bsfl		(u_int mask);
-u_int	bsrl		(u_int mask);
-void	cpu_disable_intr (void);
-void	do_cpuid	(u_int ax, u_int *p);
-void	cpu_enable_intr	(void);
-u_char	inb		(u_int port);
-u_int	inl		(u_int port);
-void	insb		(u_int port, void *addr, size_t cnt);
-void	insl		(u_int port, void *addr, size_t cnt);
-void	insw		(u_int port, void *addr, size_t cnt);
-void	invd		(void);
-u_short	inw		(u_int port);
-u_int	loadandclear	(u_int *addr);
-void	outb		(u_int port, u_char data);
-void	outl		(u_int port, u_int data);
-void	outsb		(u_int port, void *addr, size_t cnt);
-void	outsl		(u_int port, void *addr, size_t cnt);
-void	outsw		(u_int port, void *addr, size_t cnt);
-void	outw		(u_int port, u_short data);
-u_int	rcr2		(void);
-u_int64_t rdmsr		(u_int msr);
-u_int64_t rdpmc		(u_int pmc);
-u_int64_t rdtsc		(void);
-u_int	read_eflags	(void);
-void	wbinvd		(void);
-void	write_eflags	(u_int ef);
-void	wrmsr		(u_int msr, u_int64_t newval);
-u_short	rfs		(void);
-u_short	rgs		(void);
-void	load_fs		(u_short sel);
-void	load_gs		(u_short sel);
-
-#endif	/* __GNUC__ */
-
-void	load_cr0	(u_int cr0);
-void	load_cr3	(u_int cr3);
-void	load_cr4	(u_int cr4);
-void	ltr		(u_short sel);
-u_int	rcr0		(void);
-u_int	rcr3		(void);
-u_int	rcr4		(void);
-int	rdmsr_safe	(u_int msr, uint64_t *val);
-int	wrmsr_safe(u_int msr, uint64_t newval);
-void    reset_dbregs    (void);
-__END_DECLS
-
-#endif /* !_CPU_CPUFUNC_H_ */
diff --git a/sys/cpu/i386/include/cputypes.h b/sys/cpu/i386/include/cputypes.h
deleted file mode 100644
index 45b6936..0000000
--- a/sys/cpu/i386/include/cputypes.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1993 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/cputypes.h,v 1.13.2.1 2000/09/30 03:32:20 ps Exp $
- * $DragonFly: src/sys/cpu/i386/include/cputypes.h,v 1.4 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_CPUTYPES_H_
-#define	_CPU_CPUTYPES_H_
-
-/*
- * Classes of processor.
- */
-#define	CPUCLASS_286	0
-#define	CPUCLASS_386	1
-#define	CPUCLASS_486	2
-#define	CPUCLASS_586	3
-#define	CPUCLASS_686	4
-
-/*
- * Kinds of processor.
- */
-#define	CPU_286		0	/* Intel 80286 */
-#define	CPU_386SX	1	/* Intel 80386SX */
-#define	CPU_386		2	/* Intel 80386DX */
-#define	CPU_486SX	3	/* Intel 80486SX */
-#define	CPU_486		4	/* Intel 80486DX */
-#define	CPU_586		5	/* Intel P.....m (I hate lawyers; it's TM) */
-#define	CPU_686		6	/* Pentium Pro */
-#define	CPU_BLUE	7	/* IBM BlueLighting CPU */
-#define	CPU_NX586	8	/* NexGen (now AMD) 586 */
-#define	CPU_PII		9	/* Intel Pentium II */
-#define	CPU_PIII	10	/* Intel Pentium III */
-#define	CPU_P4		11	/* Intel Pentium 4 */
-#define	CPU_GEODE1100	12	/* NS Geode SC1100 */
-
-/*
- * Vendors of processor.
- */
-#define	CPU_VENDOR_NSC		0x100b		/* NSC */
-#define	CPU_VENDOR_IBM		0x1014		/* IBM */
-#define	CPU_VENDOR_AMD		0x1022		/* AMD */
-#define	CPU_VENDOR_SIS		0x1039		/* SiS */
-#define	CPU_VENDOR_UMC		0x1060		/* UMC */
-#define	CPU_VENDOR_NEXGEN	0x1074		/* Nexgen */
-#define	CPU_VENDOR_IDT		0x111d		/* Centaur/IDT/VIA */
-#define	CPU_VENDOR_TRANSMETA	0x1279		/* Transmeta */
-#define	CPU_VENDOR_INTEL	0x8086		/* Intel */
-#define	CPU_VENDOR_RISE		0xdead2bad	/* Rise */
-#define	CPU_VENDOR_CENTAUR	CPU_VENDOR_IDT
-
-#ifndef LOCORE
-struct cpu_nameclass {
-	char	*cpu_name;
-	int	cpu_class;
-};
-
-extern int	cpu;
-extern int	cpu_class;
-
-extern void	additional_cpu_info(const char *);
-#endif
-
-#endif /* !_CPU_CPUTYPES_H_ */
diff --git a/sys/cpu/i386/include/db_machdep.h b/sys/cpu/i386/include/db_machdep.h
deleted file mode 100644
index c0ac1f1..0000000
--- a/sys/cpu/i386/include/db_machdep.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- *
- * $FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04 13:55:35 marcel Exp $
- * $DragonFly: src/sys/cpu/i386/include/db_machdep.h,v 1.9 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_DB_MACHDEP_H_
-#define	_CPU_DB_MACHDEP_H_
-
-#include <cpu/frame.h>
-#include <cpu/psl.h>
-#include <cpu/stdint.h>
-#include <cpu/trap.h>
-
-#define i386_saved_state trapframe
-
-typedef	__uint32_t	db_addr_t;	/* address - unsigned */
-typedef	int		db_expr_t;	/* expression - signed */
-
-typedef struct i386_saved_state db_regs_t;
-
-#ifdef _KERNEL
-extern db_regs_t	ddb_regs;	/* register state */
-#define	DDB_REGS	(&ddb_regs)
-
-extern	db_addr_t	PC_REGS(db_regs_t *regs);
-extern	db_addr_t	SP_REGS(db_regs_t *regs);
-extern	db_addr_t	BP_REGS(db_regs_t *regs);
-#endif
-
-#define	BKPT_INST	0xcc		/* breakpoint instruction */
-#define	BKPT_SIZE	(1)		/* size of breakpoint inst */
-#define	BKPT_SET(inst)	(BKPT_INST)
-
-#define	FIXUP_PC_AFTER_BREAK	ddb_regs.tf_eip -= 1;
-
-#define	db_clear_single_step(regs)	((regs)->tf_eflags &= ~PSL_T)
-#define	db_set_single_step(regs)	((regs)->tf_eflags |=  PSL_T)
-
-#define	IS_BREAKPOINT_TRAP(type, code)	((type) == T_BPTFLT)
-/*
- * Watchpoints are not supported.  The debug exception type is in %dr6
- * and not yet in the args to this macro.
- */
-#define IS_WATCHPOINT_TRAP(type, code)	0
-
-#define	I_CALL		0xe8
-#define	I_CALLI		0xff
-#define	I_RET		0xc3
-#define	I_IRET		0xcf
-
-#define	inst_trap_return(ins)	(((ins)&0xff) == I_IRET)
-#define	inst_return(ins)	(((ins)&0xff) == I_RET)
-#define	inst_call(ins)		(((ins)&0xff) == I_CALL || \
-				 (((ins)&0xff) == I_CALLI && \
-				  ((ins)&0x3800) == 0x1000))
-#define inst_load(ins)		0
-#define inst_store(ins)		0
-
-/*
- * There no interesting addresses below _kstack = 0xefbfe000.  There
- * are small absolute values for GUPROF, but we don't want to see them.
- * Treat "negative" addresses below _kstack as non-small to allow for
- * future reductions of _kstack and to avoid sign extension problems.
- *
- * There is one interesting symbol above -db_maxoff = 0xffff0000,
- * namely _APTD = 0xfffff000.  Accepting this would mess up the
- * printing of small negative offsets.  The next largest symbol is
- * _APTmap = 0xffc00000.  Accepting this is OK (unless db_maxoff is
- * set to >= 0x400000 - (max stack offset)).
- */
-#define	DB_SMALL_VALUE_MAX	0x7fffffff
-#define	DB_SMALL_VALUE_MIN	(-0x400001)
-
-#endif /* !_CPU_DB_MACHDEP_H_ */
diff --git a/sys/cpu/i386/include/elf.h b/sys/cpu/i386/include/elf.h
deleted file mode 100644
index 7a59323..0000000
--- a/sys/cpu/i386/include/elf.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*-
- * Copyright (c) 1996-1997 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/elf.h,v 1.22 2011/01/07 14:22:34 kib Exp $
- */
-
-#ifndef _CPU_ELF_H_
-#define _CPU_ELF_H_
-
-/*
- * ELF definitions for the i386 architecture.
- */
-
-#include <sys/elf32.h>	/* Definitions common to all 32 bit architectures. */
-#include <sys/elf64.h>	/* Definitions common to all 64 bit architectures. */
-
-#ifndef __ELF_WORD_SIZE
-#define __ELF_WORD_SIZE	32	/* Used by <sys/elf_generic.h> */
-#endif
-
-#include <sys/elf_generic.h>
-
-#define ELF_ARCH	EM_386
-
-#define ELF_MACHINE_OK(x) ((x) == EM_386)
-
-/*
- * Auxiliary vector entries for passing information to the interpreter.
- *
- * The i386 supplement to the SVR4 ABI specification names this "auxv_t",
- * but POSIX lays claim to all symbols ending with "_t".
- */
-
-typedef struct {	/* Auxiliary vector entry on initial stack */
-	int	a_type;			/* Entry type. */
-	union {
-		long	a_val;		/* Integer value. */
-		void	*a_ptr;		/* Address. */
-		void	(*a_fcn)(void);	/* Function pointer (not used). */
-	} a_un;
-} Elf32_Auxinfo;
-
-#if __ELF_WORD_SIZE == 64
-/* Fake for x86_64 loader support */
-typedef struct {
-        int fake;
-} Elf64_Auxinfo;
-#endif
-
-__ElfType(Auxinfo);
-
-/* Values for a_type. */
-#define	AT_NULL		0	/* Terminates the vector. */
-#define	AT_IGNORE	1	/* Ignored entry. */
-#define	AT_EXECFD	2	/* File descriptor of program to load. */
-#define	AT_PHDR		3	/* Program header of program already loaded. */
-#define	AT_PHENT	4	/* Size of each program header entry. */
-#define	AT_PHNUM	5	/* Number of program header entries. */
-#define	AT_PAGESZ	6	/* Page size in bytes. */
-#define	AT_BASE		7	/* Interpreter's base address. */
-#define	AT_FLAGS	8	/* Flags (unused for i386). */
-#define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-
-/*
- * The following non-standard values are used for passing information
- * from John Polstra's testbed program to the dynamic linker.  These
- * are expected to go away soon.
- *
- * Unfortunately, these overlap the Linux non-standard values, so they
- * must not be used in the same context.
- */
-#define	AT_BRK		10	/* Starting point for sbrk and brk. */
-#define	AT_DEBUG	11	/* Debugging level. */
-
-/*
- * The following non-standard values are used in Linux ELF binaries.
- * Types 16-17 and 19-23 are not implemented in the kernel
- */
-#define	AT_NOTELF	10	/* Program is not ELF ?? */
-#define	AT_UID		11	/* Real uid. */
-#define	AT_EUID		12	/* Effective uid. */
-#define	AT_GID		13	/* Real gid. */
-#define	AT_EGID		14	/* Effective gid. */
-#define	AT_EXECPATH	15	/* Path to the executable. */
-#define	AT_CANARY	16	/* Canary for SSP. */
-#define	AT_CANARYLEN	17	/* Length of the canary. */
-#define	AT_OSRELDATE	18	/* OSRELDATE. */
-#define	AT_NCPUS	19	/* Number of CPUs. */
-#define	AT_PAGESIZES	20	/* Pagesizes. */
-#define	AT_PAGESIZESLEN	21	/* Number of pagesizes. */
-#define	AT_STACKPROT	23	/* Initial stack protection. */
-
-#define	AT_COUNT	24	/* Count of defined aux entry types. */
-
-/*
- * Relocation types.
- */
-
-#define R_386_NONE	0	/* No relocation. */
-#define R_386_32	1	/* Add symbol value. */
-#define R_386_PC32	2	/* Add PC-relative symbol value. */
-#define R_386_GOT32	3	/* Add PC-relative GOT offset. */
-#define R_386_PLT32	4	/* Add PC-relative PLT offset. */
-#define R_386_COPY	5	/* Copy data from shared object. */
-#define R_386_GLOB_DAT	6	/* Set GOT entry to data address. */
-#define R_386_JMP_SLOT	7	/* Set GOT entry to code address. */
-#define R_386_RELATIVE	8	/* Add load address of shared object. */
-#define R_386_GOTOFF	9	/* Add GOT-relative symbol address. */
-#define R_386_GOTPC	10	/* Add PC-relative GOT table address. */
-#define R_386_TLS_TPOFF	14	/* Negative offset in static TLS block */
-#define R_386_TLS_IE	15	/* Absolute address of GOT for -ve static TLS */
-#define R_386_TLS_GOTIE	16	/* GOT entry for negative static TLS block */
-#define R_386_TLS_LE	17	/* Negative offset relative to static TLS */
-#define R_386_TLS_GD	18	/* 32 bit offset to GOT (index,off) pair */
-#define R_386_TLS_LDM	19	/* 32 bit offset to GOT (index,zero) pair */
-#define R_386_TLS_GD_32	24	/* 32 bit offset to GOT (index,off) pair */
-#define R_386_TLS_GD_PUSH 25	/* pushl instruction for Sun ABI GD sequence */
-#define R_386_TLS_GD_CALL 26	/* call instruction for Sun ABI GD sequence */
-#define R_386_TLS_GD_POP 27	/* popl instruction for Sun ABI GD sequence */
-#define R_386_TLS_LDM_32 28	/* 32 bit offset to GOT (index,zero) pair */
-#define R_386_TLS_LDM_PUSH 29	/* pushl instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDM_CALL 30	/* call instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDM_POP 31	/* popl instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDO_32 32	/* 32 bit offset from start of TLS block */
-#define R_386_TLS_IE_32	33	/* 32 bit offset to GOT static TLS offset entry */
-#define R_386_TLS_LE_32	34	/* 32 bit offset within static TLS block */
-#define R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
-#define R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
-#define R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
-#define	R_386_IRELATIVE 42	/* PLT entry resolved indirectly at runtime */
-
-
-#define R_386_COUNT	43	/* Count of defined relocation types. */
-
-/* Define "machine" characteristics */
-#define ELF_TARG_CLASS	ELFCLASS32
-#define ELF_TARG_DATA	ELFDATA2LSB
-#define ELF_TARG_MACH	EM_386
-#define ELF_TARG_VER	1
-
- /*
-  * i386 load base for PIE binaries
-  */
-#define	ET_DYN_LOAD_ADDR	0x01001000
-
-#ifdef _KERNEL
-
-/*
- * On the i386 we load the dynamic linker where a userland call
- * to mmap(0, ...) would put it.  The rationale behind this
- * calculation is that it leaves room for the heap to grow to
- * its maximum allowed size.
- */
-#define ELF_RTLD_ADDR(vmspace) \
-    (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz))
-
-#endif /* _KERNEL */
-#endif /* !_CPU_ELF_H_ */
diff --git a/sys/cpu/i386/include/endian.h b/sys/cpu/i386/include/endian.h
deleted file mode 100644
index 3137a20..0000000
--- a/sys/cpu/i386/include/endian.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2004 The DragonFly Project.  All rights reserved.
- *
- * Copyright (c) 1987, 1991 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)endian.h	7.8 (Berkeley) 4/3/91
- * $FreeBSD: src/sys/i386/include/endian.h,v 1.18 1999/12/29 04:33:01 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/endian.h,v 1.8 2007/11/07 17:42:50 dillon Exp $
- */
-
-#ifndef _CPU_ENDIAN_H_
-#define	_CPU_ENDIAN_H_
-
-#include <sys/cdefs.h>
-#include <machine/stdint.h>
-
-/*
- * Define the order of 32-bit words in 64-bit words.
- */
-#define	_QUAD_HIGHWORD 1
-#define	_QUAD_LOWWORD 0
-
-/*
- * Definitions for byte order, according to byte significance from low
- * address to high.
- */
-#define	_LITTLE_ENDIAN	1234	/* LSB first: i386, vax */
-#define	_BIG_ENDIAN	4321	/* MSB first: 68000, ibm, net */
-#define	_PDP_ENDIAN	3412	/* LSB first in word, MSW first in long */
-
-#define	_BYTE_ORDER	_LITTLE_ENDIAN
-
-/*
- * Deprecated variants that don't have enough underscores to be useful in more
- * strict namespaces.
- */
-#if __BSD_VISIBLE
-#define	LITTLE_ENDIAN	_LITTLE_ENDIAN
-#define	BIG_ENDIAN	_BIG_ENDIAN
-#define	PDP_ENDIAN	_PDP_ENDIAN
-#define	BYTE_ORDER	_BYTE_ORDER
-#endif
-
-#define	__htonl(x)	__bswap32(x)
-#define	__htons(x)	__bswap16(x)
-#define	__ntohl(x)	__bswap32(x)
-#define	__ntohs(x)	__bswap16(x)
-
-#define	__byte_swap16_const(x) \
-	((((x) & 0xff00) >> 8) | \
-	 (((x) & 0x00ff) << 8))
-
-#define	__byte_swap32_const(x) \
-	((((x) & 0xff000000) >> 24) | \
-	 (((x) & 0x00ff0000) >>  8) | \
-	 (((x) & 0x0000ff00) <<  8) | \
-	 (((x) & 0x000000ff) << 24))
-
-#define	__byte_swap64_const(x) \
-	(((x) >> 56) | (((x) >> 40) & 0xff00) | (((x) >> 24) & 0xff0000) | \
-	 (((x) >> 8) & 0xff000000) | (((x) << 8) & ((__uint64_t)0xff << 32)) | \
-	 (((x) << 24) & ((__uint64_t)0xff << 40)) | \
-	 (((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56)))
-
-#if defined(__INTEL_COMPILER)
-# if !defined(__cplusplus) || (defined(__cplusplus) && __INTEL_COMPILER >= 800)
-#  define __INTEL_COMPILER_with_DragonFly_endian 1
-# endif
-#endif
-
-#if defined(__GNUC__) || defined(__INTEL_COMPILER_with_DragonFly_endian)
-
-#define __byte_swap32_var(x) \
-	__extension__ ({ register __uint32_t __X = (x); \
-	   __asm ("bswap %0" : "+r" (__X)); \
-	   __X; })
-
-#define __byte_swap16_var(x) \
-	__extension__ ({ register __uint16_t __X = (x); \
-	   __asm ("xchgb %h0, %b0" : "+q" (__X)); \
-	   __X; })
-
-#ifdef __OPTIMIZE__
-
-#define	__byte_swap16(x) (__builtin_constant_p(x) ? \
-	__byte_swap16_const(x) : __byte_swap16_var(x))
-
-#define	__byte_swap32(x) (__builtin_constant_p(x) ? \
-	__byte_swap32_const(x) : __byte_swap32_var(x))
-
-#else	/* __OPTIMIZE__ */
-
-#define __byte_swap16(x) __byte_swap16_var(x)
-#define __byte_swap32(x) __byte_swap32_var(x)
-
-#endif	/* __OPTIMIZE__ */
-
-#endif /* __GNUC__ || __INTEL_COMPILER_with_DragonFly_endian */
-
-/*
- * If the compiler-specific part didn't provide this, fallback
- * to the generic versions.
- */
-
-#ifndef __byte_swap16
-#define	__byte_swap16(x) __byte_swap16_const(x)
-#endif
-
-#ifndef __byte_swap32
-#define	__byte_swap32(x) __byte_swap32_const(x)
-#endif
-
-#ifndef __byte_swap64
-#define	__byte_swap64(x) __byte_swap64_const(x)
-#endif
-
-__BEGIN_DECLS
-
-static __inline __uint16_t
-__bswap16(__uint16_t _x)
-{
-	return (__byte_swap16(_x));
-}
-
-static __inline __uint32_t
-__bswap32(__uint32_t _x)
-{
-	return (__byte_swap32(_x));
-}
-
-static __inline __uint64_t
-__bswap64(__uint64_t _x)
-{
-	return (__byte_swap64(_x));
-}
-
-__END_DECLS
-
-#endif /* !_CPU_ENDIAN_H_ */
diff --git a/sys/cpu/i386/include/exec.h b/sys/cpu/i386/include/exec.h
deleted file mode 100644
index 504b336..0000000
--- a/sys/cpu/i386/include/exec.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)exec.h	8.1 (Berkeley) 6/11/93
- * $FreeBSD: src/sys/i386/include/exec.h,v 1.8 1999/08/28 00:44:11 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/exec.h,v 1.2 2003/06/17 04:28:35 dillon Exp $
- */
-
-#ifndef	_EXEC_H_
-#define	_EXEC_H_
-
-#define __LDPGSZ	4096
-
-#endif /* !_EXEC_H_ */
diff --git a/sys/cpu/i386/include/frame.h b/sys/cpu/i386/include/frame.h
deleted file mode 100644
index fb3c7a4..0000000
--- a/sys/cpu/i386/include/frame.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)frame.h	5.2 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/i386/include/frame.h,v 1.20 1999/09/29 15:06:22 marcel Exp $
- * $DragonFly: src/sys/cpu/i386/include/frame.h,v 1.9 2007/01/23 08:43:02 dillon Exp $
- */
-
-#ifndef _CPU_FRAME_H_
-#define _CPU_FRAME_H_
-
-/*
- * System stack frames.
- */
-
-/*
- * Exception/Trap Stack Frame.  This frame must match or be embedded within
- * all other frame types, including signal context frames.
- */
-struct trapframe {
-	int	tf_gs;
-	int	tf_fs;
-	int	tf_es;
-	int	tf_ds;
-	int	tf_edi;
-	int	tf_esi;
-	int	tf_ebp;
-	int	tf_isp;
-	int	tf_ebx;
-	int	tf_edx;
-	int	tf_ecx;
-	int	tf_eax;
-	int	tf_xflags;
-	int	tf_trapno;
-	/* below portion defined in 386 hardware */
-	int	tf_err;
-	int	tf_eip;
-	int	tf_cs;
-	int	tf_eflags;
-	/* below only when crossing rings (e.g. user to kernel) */
-#define tf_sp tf_esp
-	int	tf_esp;
-	int	tf_ss;
-};
-
-/*
- * This frame is postfixed with additinoal information for traps from
- * virtual-8086 mode but must otherwise match the trapframe.
- */
-struct trapframe_vm86 {
-	int	tf_gs;
-	int	tf_fs;
-	int	tf_es;
-	int	tf_ds;
-	int	tf_edi;
-	int	tf_esi;
-	int	tf_ebp;
-	int	tf_isp;
-	int	tf_ebx;
-	int	tf_edx;
-	int	tf_ecx;
-	int	tf_eax;
-	int	tf_xflags;
-	int	tf_trapno;
-	/* below portion defined in 386 hardware */
-	int	tf_err;
-	int	tf_eip;
-	int	tf_cs;
-	int	tf_eflags;
-	/* below only when crossing rings (e.g. user to kernel) */
-	int	tf_esp;
-	int	tf_ss;
-	/* below only when switching out of VM86 mode */
-	int	tf_vm86_es;
-	int	tf_vm86_ds;
-	int	tf_vm86_fs;
-	int	tf_vm86_gs;
-};
-
-/*
- * Interrupt stack frame.  This frame is prefixed with additional
- * information but must otherwise match the trapframe.
- */
-struct intrframe {
-	int	if_vec;
-	int	if_ppl;
-	int	if_gs;
-	int	if_fs;
-	int	if_es;
-	int	if_ds;
-	int	if_edi;
-	int	if_esi;
-	int	if_ebp;
-	int	if_isp;		/* unused/trap frame compat - isp */
-	int	if_ebx;
-	int	if_edx;
-	int	if_ecx;
-	int	if_eax;
-	int	if_xflags;	/* trap frame compat - xflags (vkernel) */
-	int	if_trapno;	/* unused/trap frame compat - trapno */
-	int	if_err;		/* unused/trap frame compat - err */
-	/* below portion defined in 386 hardware */
-	int	if_eip;
-	int	if_cs;
-	int	if_eflags;
-	/* below only when crossing rings (e.g. user to kernel) */
-	int	if_esp;
-	int	if_ss;
-};
-
-int	kdb_trap (int, int, struct trapframe *);
-extern  int (*pmath_emulate) (struct trapframe *);
-
-#define	INTR_TO_TRAPFRAME(frame) ((struct trapframe *)&(frame)->if_gs)
-
-#endif /* _CPU_FRAME_H_ */
diff --git a/sys/cpu/i386/include/ieeefp.h b/sys/cpu/i386/include/ieeefp.h
deleted file mode 100644
index ad820bf..0000000
--- a/sys/cpu/i386/include/ieeefp.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/*-
- * Copyright (c) 2003 Peter Wemm.
- * Copyright (c) 1990 Andrew Moore, Talke Studio
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * 	from: @(#) ieeefp.h 	1.0 (Berkeley) 9/23/93
- * $FreeBSD: head/sys/i386/include/ieeefp.h 226607 2011-10-21 06:41:46Z das $
- */
-
-#ifndef _CPU_IEEEFP_H_
-#define _CPU_IEEEFP_H_
-
-/*
- * Deprecated historical FPU control interface
- *
- * IEEE floating point type, constant and function definitions.
- * XXX: FP*FLD and FP*OFF are undocumented pollution.
- */
-
-#ifndef _SYS_CDEFS_H_
-#error this file needs sys/cdefs.h as a prerequisite
-#endif
-
-/*
- * Rounding modes.
- */
-typedef enum {
-	FP_RN=0,	/* round to nearest */
-	FP_RM,		/* round down towards minus infinity */
-	FP_RP,		/* round up towards plus infinity */
-	FP_RZ		/* truncate */
-} fp_rnd_t;
-
-/*
- * Precision (i.e., rounding precision) modes.
- */
-typedef enum {
-	FP_PS=0,	/* 24 bit (single-precision) */
-	FP_PRS,		/* reserved */
-	FP_PD,		/* 53 bit (double-precision) */
-	FP_PE		/* 64 bit (extended-precision) */
-} fp_prec_t;
-
-#define fp_except_t	int
-
-/*
- * Exception bit masks.
- */
-#define FP_X_INV	0x01	/* invalid operation */
-#define FP_X_DNML	0x02	/* denormal */
-#define FP_X_DZ		0x04	/* zero divide */
-#define FP_X_OFL	0x08	/* overflow */
-#define FP_X_UFL	0x10	/* underflow */
-#define FP_X_IMP	0x20	/* (im)precision */
-#define FP_X_STK	0x40	/* stack fault */
-
-/*
- * FPU control word bit-field masks.
- */
-#define FP_MSKS_FLD	0x3f	/* exception masks field */
-#define FP_PRC_FLD	0x300	/* precision control field */
-#define	FP_RND_FLD	0xc00	/* rounding control field */
-
-/*
- * FPU status word bit-field masks.
- */
-#define FP_STKY_FLD	0x3f	/* sticky flags field */
-
-/*
- * FPU control word bit-field offsets (shift counts).
- */
-#define FP_MSKS_OFF	0	/* exception masks offset */
-#define FP_PRC_OFF	8	/* precision control offset */
-#define	FP_RND_OFF	10	/* rounding control offset */
-
-/*
- * FPU status word bit-field offsets (shift counts).
- */
-#define FP_STKY_OFF	0	/* sticky flags offset */
-
-#ifdef __GNUC__
-
-#define	__fldcw(addr)	__asm __volatile("fldcw %0" : : "m" (*(addr)))
-#define	__fldenv(addr)	__asm __volatile("fldenv %0" : : "m" (*(addr)))
-#define	__fnclex()	__asm __volatile("fnclex")
-#define	__fnstcw(addr)	__asm __volatile("fnstcw %0" : "=m" (*(addr)))
-#define	__fnstenv(addr)	__asm __volatile("fnstenv %0" : "=m" (*(addr)))
-#define	__fnstsw(addr)	__asm __volatile("fnstsw %0" : "=m" (*(addr)))
-
-/*
- * Load the control word.  Be careful not to trap if there is a currently
- * unmasked exception (ones that will become freshly unmasked are not a
- * problem).  This case must be handled by a save/restore of the
- * environment or even of the full x87 state.  Accessing the environment
- * is very inefficient, so only do it when necessary.
- */
-static __inline void
-__fnldcw(unsigned short _cw, unsigned short _newcw)
-{
-	struct {
-		unsigned _cw;
-		unsigned _other[6];
-	} _env;
-	unsigned short _sw;
-
-	if ((_cw & FP_MSKS_FLD) != FP_MSKS_FLD) {
-		__fnstsw(&_sw);
-		if (((_sw & ~_cw) & FP_STKY_FLD) != 0) {
-			__fnstenv(&_env);
-			_env._cw = _newcw;
-			__fldenv(&_env);
-			return;
-		}
-	}
-	__fldcw(&_newcw);
-}
-
-static __inline fp_rnd_t
-fpgetround(void)
-{
-	unsigned short _cw;
-
-	__fnstcw(&_cw);
-	return ((fp_rnd_t)((_cw & FP_RND_FLD) >> FP_RND_OFF));
-}
-
-static __inline fp_rnd_t
-fpsetround(fp_rnd_t _m)
-{
-	fp_rnd_t _p;
-	unsigned short _cw, _newcw;
-
-	__fnstcw(&_cw);
-	_p = (fp_rnd_t)((_cw & FP_RND_FLD) >> FP_RND_OFF);
-	_newcw = _cw & ~FP_RND_FLD;
-	_newcw |= (_m << FP_RND_OFF) & FP_RND_FLD;
-	__fnldcw(_cw, _newcw);
-	return (_p);
-}
-
-static __inline fp_prec_t
-fpgetprec(void)
-{
-	unsigned short _cw;
-
-	__fnstcw(&_cw);
-	return ((fp_prec_t)((_cw & FP_PRC_FLD) >> FP_PRC_OFF));
-}
-
-static __inline fp_prec_t
-fpsetprec(fp_prec_t _m)
-{
-	fp_prec_t _p;
-	unsigned short _cw, _newcw;
-
-	__fnstcw(&_cw);
-	_p = (fp_prec_t)((_cw & FP_PRC_FLD) >> FP_PRC_OFF);
-	_newcw = _cw & ~FP_PRC_FLD;
-	_newcw |= (_m << FP_PRC_OFF) & FP_PRC_FLD;
-	__fnldcw(_cw, _newcw);
-	return (_p);
-}
-
-/*
- * Get or set the exception mask.
- * Note that the x87 mask bits are inverted by the API -- a mask bit of 1
- * means disable for x87 and SSE, but for fp*mask() it means enable.
- */
-
-static __inline fp_except_t
-fpgetmask(void)
-{
-	unsigned short _cw;
-
-	__fnstcw(&_cw);
-	return ((~_cw & FP_MSKS_FLD) >> FP_MSKS_OFF);
-}
-
-static __inline fp_except_t
-fpsetmask(fp_except_t _m)
-{
-	fp_except_t _p;
-	unsigned short _cw, _newcw;
-
-	__fnstcw(&_cw);
-	_p = (~_cw & FP_MSKS_FLD) >> FP_MSKS_OFF;
-	_newcw = _cw & ~FP_MSKS_FLD;
-	_newcw |= (~_m << FP_MSKS_OFF) & FP_MSKS_FLD;
-	__fnldcw(_cw, _newcw);
-	return (_p);
-}
-
-static __inline fp_except_t
-fpgetsticky(void)
-{
-	unsigned _ex;
-	unsigned short _sw;
-
-	__fnstsw(&_sw);
-	_ex = (_sw & FP_STKY_FLD) >> FP_STKY_OFF;
-	return ((fp_except_t)_ex);
-}
-
-static __inline fp_except_t
-fpresetsticky(fp_except_t _m)
-{
-	struct {
-		unsigned _cw;
-		unsigned _sw;
-		unsigned _other[5];
-	} _env;
-	fp_except_t _p;
-
-	_m &= FP_STKY_FLD >> FP_STKY_OFF;
-	_p = fpgetsticky();
-	if ((_p & ~_m) == _p)
-		return (_p);
-	if ((_p & ~_m) == 0) {
-		__fnclex();
-		return (_p);
-	}
-	__fnstenv(&_env);
-	_env._sw &= ~_m;
-	__fldenv(&_env);
-	return (_p);
-}
-
-#endif /* __GNUC__ */
-
-#endif /* !_CPU_IEEEFP_H_ */
diff --git a/sys/cpu/i386/include/int_const.h b/sys/cpu/i386/include/int_const.h
deleted file mode 100644
index 2efe6ba..0000000
--- a/sys/cpu/i386/include/int_const.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
- * Copyright (c) 2001 The NetBSD Foundation, Inc.  All rights reserved.
- * Copyright (c) 1990, 1993 The Regents of the University of California. 
- *		All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _CPU_INT_CONST_H_
-#define _CPU_INT_CONST_H_
-
-#define	INT8_C(c)	(c)
-#define	INT16_C(c)	(c)
-#define	INT32_C(c)	(c)
-#define	INT64_C(c)	(c ## LL)
-
-#define	UINT8_C(c)	(c)
-#define	UINT16_C(c)	(c)
-#define	UINT32_C(c)	(c ## U)
-#define	UINT64_C(c)	(c ## ULL)
-
-#define	INTMAX_C(c)	(c ## LL)
-#define	UINTMAX_C(c)	(c ## ULL)
-
-#endif
diff --git a/sys/cpu/i386/include/int_limits.h b/sys/cpu/i386/include/int_limits.h
deleted file mode 100644
index 082c014..0000000
--- a/sys/cpu/i386/include/int_limits.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*-
- * Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
- * Copyright (c) 2001 The NetBSD Foundation, Inc.  All rights reserved.
- * Copyright (c) 1990, 1993 The Regents of the University of California. 
- *		All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _CPU_INT_LIMITS_H_
-#define _CPU_INT_LIMITS_H_
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.1 Limits of exact-width integer types
- */
-/* Minimum values of exact-width signed integer types. */
-#define	INT8_MIN	(-0x7f-1)
-#define	INT16_MIN	(-0x7fff-1)
-#define	INT32_MIN	(-0x7fffffff-1)
-#define	INT64_MIN	(-0x7fffffffffffffffLL-1)
-
-/* Maximum values of exact-width signed integer types. */
-#define	INT8_MAX	0x7f
-#define	INT16_MAX	0x7fff
-#define	INT32_MAX	0x7fffffff
-#define	INT64_MAX	0x7fffffffffffffffLL
-
-/* Maximum values of exact-width unsigned integer types. */
-#define	UINT8_MAX	0xff
-#define	UINT16_MAX	0xffff
-#define	UINT32_MAX	0xffffffffU
-#define	UINT64_MAX	0xffffffffffffffffULL
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.4  Limits of integer types capable of holding object pointers
- */
-#define	INTPTR_MIN	INT32_MIN
-#define	INTPTR_MAX	INT32_MAX
-#define	UINTPTR_MAX	UINT32_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.5  Limits of greatest-width integer types
- */
-#define	INTMAX_MIN	INT64_MIN
-#define	INTMAX_MAX	INT64_MAX
-#define	UINTMAX_MAX	UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.3  Limits of other integer types
- */
-/* Limits of ptrdiff_t. */
-#define	PTRDIFF_MIN	INT32_MIN	
-#define	PTRDIFF_MAX	INT32_MAX
-
-/* Limits of sig_atomic_t. */
-#define	SIG_ATOMIC_MIN	INT32_MIN
-#define	SIG_ATOMIC_MAX	INT32_MAX
-
-/* Limit of size_t. */
-#define	SIZE_MAX	UINT32_MAX
-
-/* XXX possibly should be removed from here */
-/* Also possibly defined in <wchar.h> */
-/* Limits of wchar_t. */
-#ifndef WCHAR_MIN
-#define	WCHAR_MIN	INT32_MIN
-#endif
-#ifndef WCHAR_MAX
-#define	WCHAR_MAX	INT32_MAX
-#endif
-
-/* Limits of wint_t. */
-#ifndef WINT_MIN
-#define	WINT_MIN	INT32_MIN
-#endif
-#ifndef WINT_MAX
-#define	WINT_MAX	INT32_MAX
-#endif
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.2  Limits of minimum-width integer types
- */
-/* Minimum values of minimum-width signed integer types. */
-#define	INT_LEAST8_MIN		INT8_MIN
-#define	INT_LEAST16_MIN		INT16_MIN
-#define	INT_LEAST32_MIN		INT32_MIN
-#define	INT_LEAST64_MIN		INT64_MIN
-
-/* Maximum values of minimum-width signed integer types. */
-#define	INT_LEAST8_MAX		INT8_MAX
-#define	INT_LEAST16_MAX		INT16_MAX
-#define	INT_LEAST32_MAX		INT32_MAX
-#define	INT_LEAST64_MAX		INT64_MAX
-
-/* Maximum values of minimum-width unsigned integer types. */
-#define	UINT_LEAST8_MAX		UINT8_MAX
-#define	UINT_LEAST16_MAX	UINT16_MAX
-#define	UINT_LEAST32_MAX	UINT32_MAX
-#define	UINT_LEAST64_MAX	UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.3  Limits of fastest minimum-width integer types
- */
-/* Minimum values of fastest minimum-width signed integer types. */
-#define	INT_FAST8_MIN		INT32_MIN
-#define	INT_FAST16_MIN		INT32_MIN
-#define	INT_FAST32_MIN		INT32_MIN
-#define	INT_FAST64_MIN		INT64_MIN
-
-/* Maximum values of fastest minimum-width signed integer types. */
-#define	INT_FAST8_MAX		INT32_MAX
-#define	INT_FAST16_MAX		INT32_MAX
-#define	INT_FAST32_MAX		INT32_MAX
-#define	INT_FAST64_MAX		INT64_MAX
-
-/* Maximum values of fastest minimum-width unsigned integer types. */
-#define	UINT_FAST8_MAX		UINT32_MAX
-#define	UINT_FAST16_MAX		UINT32_MAX
-#define	UINT_FAST32_MAX		UINT32_MAX
-#define	UINT_FAST64_MAX		UINT64_MAX
-
-#endif
diff --git a/sys/cpu/i386/include/inttypes.h b/sys/cpu/i386/include/inttypes.h
deleted file mode 100644
index bc259e8..0000000
--- a/sys/cpu/i386/include/inttypes.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- *	From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
- * $FreeBSD: src/sys/i386/include/_inttypes.h,v 1.2 2002/06/30 05:48:02 mike Exp $
- * $DragonFly: src/sys/cpu/i386/include/inttypes.h,v 1.2 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_INTTYPES_H_
-#define _CPU_INTTYPES_H_
-
-/*
- * Macros for format specifiers.
- */
-
-/* fprintf(3) macros for signed integers. */
-
-#define	PRId8		"d"	/* int8_t */
-#define	PRId16		"d"	/* int16_t */
-#define	PRId32		"d"	/* int32_t */
-#define	PRId64		"lld"	/* int64_t */
-#define	PRIdLEAST8	"d"	/* int_least8_t */
-#define	PRIdLEAST16	"d"	/* int_least16_t */
-#define	PRIdLEAST32	"d"	/* int_least32_t */
-#define	PRIdLEAST64	"lld"	/* int_least64_t */
-#define	PRIdFAST8	"d"	/* int_fast8_t */
-#define	PRIdFAST16	"d"	/* int_fast16_t */
-#define	PRIdFAST32	"d"	/* int_fast32_t */
-#define	PRIdFAST64	"lld"	/* int_fast64_t */
-#define	PRIdMAX		"jd"	/* intmax_t */
-#define	PRIdPTR		"d"	/* intptr_t */
-
-#define	PRIi8		"i"	/* int8_t */
-#define	PRIi16		"i"	/* int16_t */
-#define	PRIi32		"i"	/* int32_t */
-#define	PRIi64		"lli"	/* int64_t */
-#define	PRIiLEAST8	"i"	/* int_least8_t  */
-#define	PRIiLEAST16	"i"	/* int_least16_t */
-#define	PRIiLEAST32	"i"	/* int_least32_t */
-#define	PRIiLEAST64	"lli"	/* int_least64_t */
-#define	PRIiFAST8	"i"	/* int_fast8_t */
-#define	PRIiFAST16	"i"	/* int_fast16_t */
-#define	PRIiFAST32	"i"	/* int_fast32_t */
-#define	PRIiFAST64	"lli"	/* int_fast64_t */
-#define	PRIiMAX		"ji"	/* intmax_t */
-#define	PRIiPTR		"i"	/* intptr_t */
-
-/* fprintf(3) macros for unsigned integers. */
-
-#define	PRIo8		"o"	/* uint8_t */
-#define	PRIo16		"o"	/* uint16_t */
-#define	PRIo32		"o"	/* uint32_t */
-#define	PRIo64		"llo"	/* uint64_t */
-#define	PRIoLEAST8	"o"	/* uint_least8_t */
-#define	PRIoLEAST16	"o"	/* uint_least16_t */
-#define	PRIoLEAST32	"o"	/* uint_least32_t */
-#define	PRIoLEAST64	"llo"	/* uint_least64_t */
-#define	PRIoFAST8	"o"	/* uint_fast8_t */
-#define	PRIoFAST16	"o"	/* uint_fast16_t */
-#define	PRIoFAST32	"o"	/* uint_fast32_t */
-#define	PRIoFAST64	"llo"	/* uint_fast64_t */
-#define	PRIoMAX		"jo"	/* uintmax_t */
-#define	PRIoPTR		"o"	/* uintptr_t */
-
-#define	PRIu8		"u"	/* uint8_t */
-#define	PRIu16		"u"	/* uint16_t */
-#define	PRIu32		"u"	/* uint32_t */
-#define	PRIu64		"llu"	/* uint64_t */
-#define	PRIuLEAST8	"u"	/* uint_least8_t */
-#define	PRIuLEAST16	"u"	/* uint_least16_t */
-#define	PRIuLEAST32	"u"	/* uint_least32_t */
-#define	PRIuLEAST64	"llu"	/* uint_least64_t */
-#define	PRIuFAST8	"u"	/* uint_fast8_t */
-#define	PRIuFAST16	"u"	/* uint_fast16_t */
-#define	PRIuFAST32	"u"	/* uint_fast32_t */
-#define	PRIuFAST64	"llu"	/* uint_fast64_t */
-#define	PRIuMAX		"ju"	/* uintmax_t */
-#define	PRIuPTR		"u"	/* uintptr_t */
-
-#define	PRIx8		"x"	/* uint8_t */
-#define	PRIx16		"x"	/* uint16_t */
-#define	PRIx32		"x"	/* uint32_t */
-#define	PRIx64		"llx"	/* uint64_t */
-#define	PRIxLEAST8	"x"	/* uint_least8_t */
-#define	PRIxLEAST16	"x"	/* uint_least16_t */
-#define	PRIxLEAST32	"x"	/* uint_least32_t */
-#define	PRIxLEAST64	"llx"	/* uint_least64_t */
-#define	PRIxFAST8	"x"	/* uint_fast8_t */
-#define	PRIxFAST16	"x"	/* uint_fast16_t */
-#define	PRIxFAST32	"x"	/* uint_fast32_t */
-#define	PRIxFAST64	"llx"	/* uint_fast64_t */
-#define	PRIxMAX		"jx"	/* uintmax_t */
-#define	PRIxPTR		"x"	/* uintptr_t */
-
-#define	PRIX8		"X"	/* uint8_t */
-#define	PRIX16		"X"	/* uint16_t */
-#define	PRIX32		"X"	/* uint32_t */
-#define	PRIX64		"llX"	/* uint64_t */
-#define	PRIXLEAST8	"X"	/* uint_least8_t */
-#define	PRIXLEAST16	"X"	/* uint_least16_t */
-#define	PRIXLEAST32	"X"	/* uint_least32_t */
-#define	PRIXLEAST64	"llX"	/* uint_least64_t */
-#define	PRIXFAST8	"X"	/* uint_fast8_t */
-#define	PRIXFAST16	"X"	/* uint_fast16_t */
-#define	PRIXFAST32	"X"	/* uint_fast32_t */
-#define	PRIXFAST64	"llX"	/* uint_fast64_t */
-#define	PRIXMAX		"jX"	/* uintmax_t */
-#define	PRIXPTR		"X"	/* uintptr_t */
-
-/* fscanf(3) macros for signed integers. */
-
-#define	SCNd8		"hhd"	/* int8_t */
-#define	SCNd16		"hd"	/* int16_t */
-#define	SCNd32		"d"	/* int32_t */
-#define	SCNd64		"lld"	/* int64_t */
-#define	SCNdLEAST8	"hhd"	/* int_least8_t */
-#define	SCNdLEAST16	"hd"	/* int_least16_t */
-#define	SCNdLEAST32	"d"	/* int_least32_t */
-#define	SCNdLEAST64	"lld"	/* int_least64_t */
-#define	SCNdFAST8	"d"	/* int_fast8_t */
-#define	SCNdFAST16	"d"	/* int_fast16_t */
-#define	SCNdFAST32	"d"	/* int_fast32_t */
-#define	SCNdFAST64	"lld"	/* int_fast64_t */
-#define	SCNdMAX		"jd"	/* intmax_t */
-#define	SCNdPTR		"d"	/* intptr_t */
-
-#define	SCNi8		"hhi"	/* int8_t */
-#define	SCNi16		"hi"	/* int16_t */
-#define	SCNi32		"i"	/* int32_t */
-#define	SCNi64		"lli"	/* int64_t */
-#define	SCNiLEAST8	"hhi"	/* int_least8_t */
-#define	SCNiLEAST16	"hi"	/* int_least16_t */
-#define	SCNiLEAST32	"i"	/* int_least32_t */
-#define	SCNiLEAST64	"lli"	/* int_least64_t */
-#define	SCNiFAST8	"i"	/* int_fast8_t */
-#define	SCNiFAST16	"i"	/* int_fast16_t */
-#define	SCNiFAST32	"i"	/* int_fast32_t */
-#define	SCNiFAST64	"lli"	/* int_fast64_t */
-#define	SCNiMAX		"ji"	/* intmax_t */
-#define	SCNiPTR		"i"	/* intptr_t */
-
-/* fscanf(3) macros for unsigned integers. */
-
-#define	SCNo8		"hho"	/* uint8_t */
-#define	SCNo16		"ho"	/* uint16_t */
-#define	SCNo32		"o"	/* uint32_t */
-#define	SCNo64		"llo"	/* uint64_t */
-#define	SCNoLEAST8	"hho"	/* uint_least8_t */
-#define	SCNoLEAST16	"ho"	/* uint_least16_t */
-#define	SCNoLEAST32	"o"	/* uint_least32_t */
-#define	SCNoLEAST64	"llo"	/* uint_least64_t */
-#define	SCNoFAST8	"o"	/* uint_fast8_t */
-#define	SCNoFAST16	"o"	/* uint_fast16_t */
-#define	SCNoFAST32	"o"	/* uint_fast32_t */
-#define	SCNoFAST64	"llo"	/* uint_fast64_t */
-#define	SCNoMAX		"jo"	/* uintmax_t */
-#define	SCNoPTR		"o"	/* uintptr_t */
-
-#define	SCNu8		"hhu"	/* uint8_t */
-#define	SCNu16		"hu"	/* uint16_t */
-#define	SCNu32		"u"	/* uint32_t */
-#define	SCNu64		"llu"	/* uint64_t */
-#define	SCNuLEAST8	"hhu"	/* uint_least8_t */
-#define	SCNuLEAST16	"hu"	/* uint_least16_t */
-#define	SCNuLEAST32	"u"	/* uint_least32_t */
-#define	SCNuLEAST64	"llu"	/* uint_least64_t */
-#define	SCNuFAST8	"u"	/* uint_fast8_t */
-#define	SCNuFAST16	"u"	/* uint_fast16_t */
-#define	SCNuFAST32	"u"	/* uint_fast32_t */
-#define	SCNuFAST64	"llu"	/* uint_fast64_t */
-#define	SCNuMAX		"ju"	/* uintmax_t */
-#define	SCNuPTR		"u"	/* uintptr_t */
-
-#define	SCNx8		"hhx"	/* uint8_t */
-#define	SCNx16		"hx"	/* uint16_t */
-#define	SCNx32		"x"	/* uint32_t */
-#define	SCNx64		"llx"	/* uint64_t */
-#define	SCNxLEAST8	"hhx"	/* uint_least8_t */
-#define	SCNxLEAST16	"hx"	/* uint_least16_t */
-#define	SCNxLEAST32	"x"	/* uint_least32_t */
-#define	SCNxLEAST64	"llx"	/* uint_least64_t */
-#define	SCNxFAST8	"x"	/* uint_fast8_t */
-#define	SCNxFAST16	"x"	/* uint_fast16_t */
-#define	SCNxFAST32	"x"	/* uint_fast32_t */
-#define	SCNxFAST64	"llx"	/* uint_fast64_t */
-#define	SCNxMAX		"jx"	/* uintmax_t */
-#define	SCNxPTR		"x"	/* uintptr_t */
-
-#endif /* !_CPU_INTTYPES_H_ */
diff --git a/sys/cpu/i386/include/limits.h b/sys/cpu/i386/include/limits.h
deleted file mode 100644
index 3dec595..0000000
--- a/sys/cpu/i386/include/limits.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 1988, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)limits.h	8.3 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/i386/include/limits.h,v 1.14.2.2 2000/11/05 09:21:42 obrien Exp $
- * $DragonFly: src/sys/cpu/i386/include/limits.h,v 1.5 2008/01/02 23:06:44 swildner Exp $
- */
-
-#ifndef _CPU_LIMITS_H_
-#define	_CPU_LIMITS_H_
-
-#define	CHAR_BIT	8		/* number of bits in a char */
-#define	MB_LEN_MAX	6		/* Allow 31 bit UTF2 */
-
-/*
- * According to ANSI (section 2.2.4.2), the values below must be usable by
- * #if preprocessing directives.  Additionally, the expression must have the
- * same type as would an expression that is an object of the corresponding
- * type converted according to the integral promotions.  The subtraction for
- * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
- * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
- * These numbers are for the default configuration of gcc.  They work for
- * some other compilers as well, but this should not be depended on.
- */
-#define	SCHAR_MAX	0x7f		/* max value for a signed char */
-#define	SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
-
-#define	UCHAR_MAX	0xff		/* max value for an unsigned char */
-
-#ifdef __CHAR_UNSIGNED__
-#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
-#define	CHAR_MIN	0		/* min value for a char */
-#else
-#define	CHAR_MAX	SCHAR_MAX	/* max value for a char */
-#define	CHAR_MIN	SCHAR_MIN	/* min value for a char */
-#endif
-
-#define	USHRT_MAX	0xffff		/* max value for an unsigned short */
-#define	SHRT_MAX	0x7fff		/* max value for a short */
-#define	SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
-
-#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
-#define	INT_MAX		0x7fffffff	/* max value for an int */
-#define	INT_MIN		(-0x7fffffff - 1)	/* min value for an int */
-
-/* Bad hack for gcc configured to give 64-bit longs. */
-#ifdef _LARGE_LONG
-#define	ULONG_MAX	0xffffffffffffffffUL
-#define	LONG_MAX	0x7fffffffffffffffL
-#define	LONG_MIN	(-0x7fffffffffffffffL - 1)
-#else
-#define	ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
-#define	LONG_MAX	0x7fffffffL	/* max value for a long */
-#define	LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
-#endif
-
-			/* max value for an unsigned long long */
-#define	ULLONG_MAX	0xffffffffffffffffULL
-#define	LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
-#define	LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
-
-#if !defined(_ANSI_SOURCE)
-#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
-
-#if !defined(_POSIX_SOURCE)
-#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
-
-#define	OFF_MAX		LLONG_MAX	/* max value for an off_t */
-#define	OFF_MIN		LLONG_MIN	/* min value for an off_t */
-
-#define	GID_MAX		UINT_MAX	/* max value for a gid_t */
-#define	UID_MAX		UINT_MAX	/* max value for a uid_t */
-
-/* Quads and long longs are the same size.  Ensure they stay in sync. */
-#define	UQUAD_MAX	ULLONG_MAX	/* max value for a uquad_t */
-#define	QUAD_MAX	LLONG_MAX	/* max value for a quad_t */
-#define	QUAD_MIN	LLONG_MIN	/* min value for a quad_t */
-
-#ifdef _LARGE_LONG
-#define	LONG_BIT	64
-#else
-#define	LONG_BIT	32
-#endif
-#define	WORD_BIT	32
-
-#endif /* !_POSIX_SOURCE */
-#endif /* !_ANSI_SOURCE */
-
-#endif /* !_CPU_LIMITS_H_ */
diff --git a/sys/cpu/i386/include/lwbuf.h b/sys/cpu/i386/include/lwbuf.h
deleted file mode 100644
index 3947498..0000000
--- a/sys/cpu/i386/include/lwbuf.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2010 by The DragonFly Project and Samuel J. Greear.
- * All rights reserved.
- *
- * This code is derived from software contributed to The DragonFly Project
- * by Samuel J. Greear <sjg@thesjg.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CPU_LWBUF_H_
-#define _CPU_LWBUF_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-#ifndef _SYS_QUEUE_H_
-#include <sys/queue.h>
-#endif
-#ifndef _SYS_GLOBALDATA_H_
-#include <sys/globaldata.h>
-#endif
-#ifndef _VM_PMAP_H_
-#include <vm/pmap.h>
-#endif
-#ifndef _VM_VM_PAGE_H_
-#include <vm/vm_page.h>
-#endif
-#include <machine/atomic.h>
-
-#if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES)
-#error "This file should not be included by userland programs."
-#endif
-
-struct mdglobaldata;
-
-struct lwbuf {
-    vm_page_t		m;		/* currently mapped page */
-    vm_offset_t		kva;		/* va of mapping */
-    cpumask_t		cpumask;	/* cpu mapping synchronization */
-};
-
-static __inline vm_page_t
-lwbuf_page(struct lwbuf *lwb)
-{
-    return (lwb->m);
-}
-
-#if defined(_KERNEL)
-
-struct lwbuf	*lwbuf_alloc(vm_page_t, struct lwbuf *);
-void		 lwbuf_free(struct lwbuf *);
-vm_offset_t	 lwbuf_kva(struct lwbuf *lwb);
-void		 lwbuf_set_global(struct lwbuf *);
-
-#endif
-
-#endif /* !_CPU_LWBUF_H_ */
diff --git a/sys/cpu/i386/include/npx.h b/sys/cpu/i386/include/npx.h
deleted file mode 100644
index 78d7a04..0000000
--- a/sys/cpu/i386/include/npx.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)npx.h	5.3 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/i386/include/npx.h,v 1.18.2.1 2001/08/15 01:23:52 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/npx.h,v 1.12 2007/01/09 23:34:01 dillon Exp $
- */
-
-/*
- * 287/387 NPX Coprocessor Data Structures and Constants
- * W. Jolitz 1/90
- */
-
-#ifndef _CPU_NPX_H_
-#define	_CPU_NPX_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-
-/* Environment information of floating point unit */
-struct	env87 {
-	long	en_cw;		/* control word (16bits) */
-	long	en_sw;		/* status word (16bits) */
-	long	en_tw;		/* tag word (16bits) */
-	long	en_fip;		/* floating point instruction pointer */
-	u_short	en_fcs;		/* floating code segment selector */
-	u_short	en_opcode;	/* opcode last executed (11 bits ) */
-	long	en_foo;		/* floating operand offset */
-	long	en_fos;		/* floating operand segment selector */
-};
-
-/* Contents of each floating point accumulator */
-struct	fpacc87 {
-#ifdef dontdef /* too unportable */
-	u_long	fp_mantlo;	/* mantissa low (31:0) */
-	u_long	fp_manthi;	/* mantissa high (63:32) */
-	int	fp_exp:15;	/* exponent */
-	int	fp_sgn:1;	/* mantissa sign */
-#else
-	u_char	fp_bytes[10];
-#endif
-};
-
-/* Floating point context */
-struct	save87 {
-	struct	env87 sv_env;	/* floating point control/status */
-	struct	fpacc87	sv_ac[8];	/* accumulator contents, 0-7 */
-	u_long	sv_unused001;
-	/*
-	 * Bogus padding for emulators.  Emulators should use their own
-	 * struct and arrange to store into this struct (ending here)
-	 * before it is inspected for ptracing or for core dumps.  Some
-	 * emulators overwrite the whole struct.  We have no good way of
-	 * knowing how much padding to leave.  Leave just enough for the
-	 * GPL emulator's i387_union (176 bytes total).
-	 */
-	u_char	sv_pad[64];	/* padding; used by emulators */
-};
-
-struct  envxmm {
-	u_int16_t	en_cw;		/* control word (16bits) */
-	u_int16_t	en_sw;		/* status word (16bits) */
-	u_int16_t	en_tw;		/* tag word (16bits) */
-	u_int16_t	en_opcode;	/* opcode last executed (11 bits ) */
-	u_int32_t	en_fip;		/* floating point instruction pointer */
-	u_int16_t	en_fcs;		/* floating code segment selector */
-	u_int16_t	en_pad0;	/* padding */
-	u_int32_t	en_foo;		/* floating operand offset */
-	u_int16_t	en_fos;		/* floating operand segment selector */
-	u_int16_t	en_pad1;	/* padding */
-	u_int32_t	en_mxcsr;	/* SSE sontorol/status register */
-	u_int32_t	en_pad2;	/* padding */
-};
-
-/* Contents of each SSE extended accumulator */
-struct  xmmacc {
-	u_char	xmm_bytes[16];
-};
-
-/*
- * savexmm is a 512-byte structure
- */
-struct  savexmm {
-	struct	envxmm	sv_env;			/* 32 */
-	struct {
-		struct fpacc87	fp_acc;		/* 10 */
-		u_char		fp_pad[6];      /* 6  (padding) */
-	} sv_fp[8];
-	struct xmmacc	sv_xmm[8];		/* 128 */
-	u_long sv_unused001;
-	u_char sv_pad[220];
-} __attribute__((aligned(16)));
-
-union	savefpu {
-	struct	save87	sv_87;
-	struct	savexmm	sv_xmm;
-};
-
-/*
- * The hardware default control word for i387's and later coprocessors is
- * 0x37F, giving:
- *
- *	round to nearest
- *	64-bit precision
- *	all exceptions masked.
- *
- * We modify the affine mode bit and precision bits in this to give:
- *
- *	affine mode for 287's (if they work at all) (1 in bitfield 1<<12)
- *	53-bit precision (2 in bitfield 3<<8)
- *
- * 64-bit precision often gives bad results with high level languages
- * because it makes the results of calculations depend on whether
- * intermediate values are stored in memory or in FPU registers.
- */
-#define	__INITIAL_NPXCW__	0x127F
-
-#ifdef _KERNEL
-
-struct proc;
-struct trapframe;
-
-extern uint32_t npx_mxcsr_mask;
-
-#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(CPU_DISABLE_SSE)
-void	npxprobemask (void);
-#endif
-void	npxexit (void);
-void	npxinit (void);
-void	npxsave (union savefpu *addr);
-#endif
-
-#endif /* !_CPU_NPX_H_ */
diff --git a/sys/cpu/i386/include/param.h b/sys/cpu/i386/include/param.h
deleted file mode 100644
index dd98fdb..0000000
--- a/sys/cpu/i386/include/param.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)param.h	5.8 (Berkeley) 6/28/91
- * $FreeBSD: src/sys/i386/include/param.h,v 1.54.2.8 2002/08/31 21:15:55 dillon Exp $
- */
-
-#ifndef _CPU_PARAM_H_
-
-/*
- * Do not prevent re-includes of <machine/param.h> if the file was included
- * with NO_NAMESPACE_POLLUTION, or expected macros will not exist.
- */
-#ifndef _NO_NAMESPACE_POLLUTION
-#define _CPU_PARAM_H_
-#endif
-
-/*
- * Machine dependent constants for Intel 386.
- */
-#ifndef _CPU_PARAM_H1_
-#define _CPU_PARAM_H1_
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...).   The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#ifndef _ALIGNBYTES
-#define _ALIGNBYTES	(sizeof(int) - 1)
-#endif
-#ifndef _ALIGN
-#define _ALIGN(p)	(((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
-#endif
-
-#ifndef _MACHINE
-#define	_MACHINE	i386	/* cpu architecture */
-#endif
-#ifndef _MACHINE_ARCH
-#define	_MACHINE_ARCH	i386	/* cpu architecture */
-#endif
-
-#endif	/* _CPU_PARAM_H1_ */
-
-#ifndef _NO_NAMESPACE_POLLUTION
-
-#ifndef MACHINE
-#define	MACHINE		"i386"	/* cpu architecture */
-#endif
-#ifndef MACHINE_ARCH
-#define	MACHINE_ARCH	"i386"	/* cpu architecture */
-#endif
-
-#define MID_MACHINE	MID_I386
-
-/*
- * Use SMP_MAXCPU instead of MAXCPU for structures that are intended to
- * remain compatible between UP and SMP builds.
- *
- * NOTE: Max supported cpus is 32 because we use 32 bit cpu masks.  On
- *	 32-bit systems the kernel build defaults SMP_MAXCPU to 16 to
- *	 reduce KVM overhead, but can be increased up to 32.
- */
-#ifndef SMP_MAXCPU
-#define SMP_MAXCPU	16
-#endif
-#define MAXCPU		SMP_MAXCPU
-
-#define ALIGNBYTES	_ALIGNBYTES
-#define ALIGN(p)	_ALIGN(p)
-
-#define PAGE_SHIFT	12
-#define PAGE_SIZE	(1<<PAGE_SHIFT)	/* bytes per mmu page (level 2) */
-#define PAGE_MASK	(PAGE_SIZE-1)
-#define NPTEPG		(PAGE_SIZE/(sizeof (pt_entry_t)))
-
-#define SEG_SHIFT	22
-#define SEG_SIZE	(1<<SEG_SHIFT)	/* bytes per mmu segment (level 1) */
-#define SEG_MASK	(SEG_SIZE-1)
-
-#define NPDEPG		(PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT	22		/* LOG2(NBPDR) */
-#define NBPDR		(1<<PDRSHIFT)	/* bytes/page dir */
-#define PDRMASK		(NBPDR-1)
-
-#define DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
-#define DEV_BSIZE	(1 << DEV_BSHIFT)
-#define DEV_BMASK	(DEV_BSIZE - 1)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE	PAGE_SIZE	/* default block device I/O size */
-#endif
-#define DFLTPHYS	(64 * 1024)	/* default max raw I/O transfer size */
-#define MAXPHYS		(128 * 1024)	/* max raw I/O transfer size */
-#define MAXDUMPPGS	(MAXPHYS/PAGE_SIZE)
-
-#define IOPAGES		2	/* pages of i/o permission bitmap */
-#define UPAGES		4	/* pages of u-area */
-
-/*
- * 32-bit machines do not have enough KVA, improve buffer cache
- * density at the cost of higher defragmentation and buffer_map
- * handling overheads.
- */
-#define BKVASIZE        16384	/* override 64K default */
-
-/*
- * Ceiling on amount of swblock kva space, can be changed via
- * kern.maxswzone /boot/loader.conf variable.
- */
-#ifndef VM_SWZONE_SIZE_MAX
-#define VM_SWZONE_SIZE_MAX	(32 * 1024 * 1024)
-#endif
-
-/*
- * Ceiling on size of buffer cache (really only effects write queueing,
- * the VM page cache is not effected), can be changed via
- * kern.maxbcache /boot/loader.conf variable.
- */
-#ifndef VM_BCACHE_SIZE_MAX
-#define VM_BCACHE_SIZE_MAX	(200 * 1024 * 1024)
-#endif
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x)	((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x)	(((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t.  We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily.  Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes)	 		/* calculates (bytes / DEV_BSIZE) */ \
-	(sizeof (bytes) > sizeof(long) \
-	 ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
-	 : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db)			/* calculates (db * DEV_BSIZE) */ \
-	((off_t)(db) << DEV_BSHIFT)
-
-/*
- * Mach derived conversion macros
- */
-#define trunc_page(x)		((x) & ~PAGE_MASK)
-#define round_page(x)		(((x) + PAGE_MASK) & ~PAGE_MASK)
-#define trunc_4mpage(x)		((x) & ~PDRMASK)
-#define round_4mpage(x)		((((x)) + PDRMASK) & ~PDRMASK)
-
-#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
-#define atop(x)			((x) >> PAGE_SHIFT)
-#endif
-#define ptoa(x)			((vm_paddr_t)(x) << PAGE_SHIFT)
-
-#define i386_btop(x)		((vm_pindex_t)((x) >> PAGE_SHIFT))
-#define i386_ptob(x)		((vm_paddr_t)(x) << PAGE_SHIFT)
-
-#define	pgtok(x)		((x) * (PAGE_SIZE / 1024))
-
-#ifdef _KERNEL
-
-/*
- * We put here the definition of two debugging macros/function which
- * are very convenient to have available.
- * The macro is called TSTMP() and is used to timestamp events in the
- * kernel using the TSC register, and export them to userland through
- * the sysctl variable debug.timestamp, which is a circular buffer
- * holding pairs of u_int32_t variables <timestamp, argument> .
- * They can be retrieved with something like
- *
- *	sysctl -b debug.timestamp | hexdump -e '"%15u %15u\n"'
- *
- * The function _TSTMP() is defined in i386/isa/clock.c. It does not
- * try to grab any locks or block interrupts or identify which CPU it
- * is running on. You are supposed to know what to do if you use it.
- *
- * The macros must be enabled with "options KERN_TIMESTAMP" in the kernel
- * config file, otherwise they default to an empty block.
- */
-
-#ifdef KERN_TIMESTAMP
-extern void _TSTMP(u_int32_t argument);
-#define TSTMP(class, unit, event, par)	_TSTMP(	\
-	(((class) &   0x0f) << 28 ) |		\
-	(((unit)  &   0x0f) << 24 ) |		\
-	(((event) &   0xff) << 16 ) |		\
-	(((par)   & 0xffff)       )   )
-
-#else /* !KERN_TIMESTAMP */
-#define        _TSTMP(x)                       {}
-#define        TSTMP(class, unit, event, par)  _TSTMP(0)
-#endif /* !KERN_TIMESTAMP */
-#endif /* _KERNEL */
-
-#endif /* !_NO_NAMESPACE_POLLUTION */
-#endif /* !_CPU_PARAM_H_ */
diff --git a/sys/cpu/i386/include/perfmon.h b/sys/cpu/i386/include/perfmon.h
deleted file mode 100644
index 2b57e66..0000000
--- a/sys/cpu/i386/include/perfmon.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied
- * warranty.
- * 
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/perfmon.h,v 1.7 1999/12/29 04:33:04 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/perfmon.h,v 1.5 2006/11/07 17:51:21 dillon Exp $
- */
-
-/*
- * Interface to performance-monitoring counters for Intel Pentium and
- * Pentium Pro CPUs.
- */
-
-#ifndef	_CPU_PERFMON_H_
-#define	_CPU_PERFMON_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-#ifndef _SYS_IOCCOM_H_
-#include <sys/ioccom.h>
-#endif
-
-#define	NPMC	2
-
-#define	PMIOSETUP	_IOW('5', 1, struct pmc)
-#define	PMIOGET		_IOWR('5', 7, struct pmc)
-#define	PMIOSTART	_IOW('5', 2, int)
-#define	PMIOSTOP	_IOW('5', 3, int)
-#define PMIOREAD	_IOWR('5', 4, struct pmc_data)
-#define	PMIORESET	_IOW('5', 5, int)
-#define	PMIOTSTAMP	_IOR('5', 6, struct pmc_tstamp)
-
-struct pmc {
-	int pmc_num;
-	union {
-		struct {
-			unsigned char pmcus_event;
-			unsigned char pmcus_unit;
-			unsigned char pmcus_flags;
-			unsigned char pmcus_mask;
-		} pmcu_s;
-		unsigned int pmcu_val;
-	} pmc_pmcu;
-};
-
-#define	PMC_ALL		(-1)
-
-#define	pmc_event	pmc_pmcu.pmcu_s.pmcus_event
-#define	pmc_unit	pmc_pmcu.pmcu_s.pmcus_unit
-#define	pmc_flags	pmc_pmcu.pmcu_s.pmcus_flags
-#define	pmc_mask	pmc_pmcu.pmcu_s.pmcus_mask
-#define	pmc_val		pmc_pmcu.pmcu_val
-
-#define	PMCF_USR	0x01	/* count events in user mode */
-#define	PMCF_OS		0x02	/* count events in kernel mode */
-#define	PMCF_E		0x04	/* use edge-detection mode */
-#define	PMCF_PC		0x08	/* PMx output pin control */
-#define	PMCF_INT	0x10	/* APIC interrupt enable (do not use) */
-#define	PMCF_EN		0x40	/* enable counters */
-#define	PMCF_INV	0x80	/* invert counter mask comparison */
-
-#define	PMCF_SYS_FLAGS	(PMCF_INT | PMCF_EN) /* user cannot set */
-
-struct pmc_data {
-	int pmcd_num;
-	quad_t pmcd_value;
-};
-
-struct pmc_tstamp {
-	int pmct_rate;
-	quad_t pmct_value;
-};
-
-#ifndef _KERNEL
-
-#define	_PATH_PERFMON	"/dev/perfmon"
-
-#else
-
-/*
- * Intra-kernel interface to performance monitoring counters
- */
-void	perfmon_init  (void);
-int	perfmon_avail (void);
-int	perfmon_setup (int, unsigned int);
-int	perfmon_get   (int, unsigned int *);
-int	perfmon_fini  (int);
-int	perfmon_start (int);
-int	perfmon_stop  (int);
-int	perfmon_read  (int, quad_t *);
-int	perfmon_reset (int);
-
-#endif /* _KERNEL */
-
-/*
- * Pentium Pro performance counters, from Appendix B.
- */
-/* Data Cache Unit */
-#define	PMC6_DATA_MEM_REFS	0x43
-#define	PMC6_DCU_LINES_IN	0x45
-#define	PMC6_DCU_M_LINES_IN	0x46
-#define	PMC6_DCU_M_LINES_OUT	0x47
-#define	PMC6_DCU_MISS_OUTSTANDING 0x48
-
-/* Instruction Fetch Unit */ 
-#define	PMC6_IFU_IFETCH		0x80
-#define	PMC6_IFU_IFETCH_MISS	0x81
-#define	PMC6_ITLB_MISS		0x85
-#define	PMC6_IFU_MEM_STALL	0x86
-#define	PMC6_ILD_STALL		0x87
-
-/* L2 Cache */
-#define	PMC6_L2_IFETCH		0x28 /* MESI */
-#define	PMC6_L2_LD		0x29 /* MESI */
-#define	PMC6_L2_ST		0x2a /* MESI */
-#define	PMC6_L2_LINES_IN	0x24
-#define	PMC6_L2_LINES_OUT	0x26
-#define	PMC6_L2_M_LINES_INM	0x25
-#define	PMC6_L2_M_LINES_OUTM	0x27
-#define	PMC6_L2_RQSTS		0x2e /* MESI */
-#define	PMC6_L2_ADS		0x21
-#define	PMC6_L2_DBUS_BUSY	0x22
-#define	PMC6_L2_DBUS_BUSY_RD	0x23
-
-/* External Bus Logic */
-#define	PMC6_BUS_DRDY_CLOCKS	0x62
-#define	PMC6_BUS_LOCK_CLOCKS	0x63
-#define	PMC6_BUS_REQ_OUTSTANDING 0x60
-#define	PMC6_BUS_TRAN_BRD	0x65
-#define	PMC6_BUS_TRAN_RFO	0x66
-#define	PMC6_BUS_TRAN_WB	0x67
-#define	PMC6_BUS_TRAN_IFETCH	0x68
-#define	PMC6_BUS_TRAN_INVAL	0x69
-#define	PMC6_BUS_TRAN_PWR	0x6a
-#define	PMC6_BUS_TRAN_P		0x6b
-#define	PMC6_BUS_TRAN_IO	0x6c
-#define	PMC6_BUS_TRAN_DEF	0x6d
-#define	PMC6_BUS_TRAN_BURST	0x6e
-#define	PMC6_BUS_TRAN_ANY	0x70
-#define	PMC6_BUS_TRAN_MEM	0x6f
-#define	PMC6_BUS_DATA_RCV	0x64
-#define	PMC6_BUS_BNR_DRV	0x61
-#define	PMC6_BUS_HIT_DRV	0x7a
-#define	PMC6_BUS_HITM_DRV	0x7b
-#define	PMC6_BUS_SNOOP_STALL	0x7e
-
-/* Floating Point Unit */
-#define	PMC6_FLOPS		0xc1 /* counter 0 only */
-#define	PMC6_FP_COMP_OPS_EXE	0x10 /* counter 0 only */
-#define	PMC6_FP_ASSIST		0x11 /* counter 1 only */
-#define	PMC6_MUL		0x12 /* counter 1 only */
-#define	PMC6_DIV		0x13 /* counter 1 only */
-#define	PMC6_CYCLES_DIV_BUSY	0x14 /* counter 0 only */
-
-/* Memory Ordering */
-#define	PMC6_LD_BLOCKS		0x03
-#define	PMC6_SB_DRAINS		0x04
-#define	PMC6_MISALIGN_MEM_REF	0x05
-
-/* Instruction Decoding and Retirement */
-#define	PMC6_INST_RETIRED	0xc0
-#define	PMC6_UOPS_RETIRED	0xc2
-#define	PMC6_INST_DECODER	0xd0 /* (sic) */
-
-/* Interrupts */
-#define	PMC6_HW_INT_RX		0xc8
-#define	PMC6_CYCLES_INT_MASKED	0xc6
-#define	PMC6_CYCLES_INT_PENDING_AND_MASKED 0xc7
-
-/* Branches */
-#define	PMC6_BR_INST_RETIRED	0xc4
-#define	PMC6_BR_MISS_PRED_RETIRED 0xc5
-#define	PMC6_BR_TAKEN_RETIRED	0xc9
-#define	PMC6_BR_MISS_PRED_TAKEN_RET 0xca
-#define	PMC6_BR_INST_DECODED	0xe0
-#define	PMC6_BTB_MISSES		0xe2
-#define	PMC6_BR_BOGUS		0xe4
-#define	PMC6_BACLEARS		0xe6
-
-/* Stalls */
-#define	PMC6_RESOURCE_STALLS	0xa2
-#define	PMC6_PARTIAL_RAT_STALLS	0xd2
-
-/* Segment Register Loads */
-#define	PMC6_SEGMENT_REG_LOADS	0x06
-
-/* Clocks */
-#define	PMC6_CPU_CLK_UNHALTED	0x79
-
-/*
- * Pentium Performance Counters
- * This list comes from the Harvard people, not Intel.
- */
-#define	PMC5_DATA_READ		0
-#define	PMC5_DATA_WRITE		1
-#define	PMC5_DATA_TLB_MISS	2
-#define	PMC5_DATA_READ_MISS	3
-#define	PMC5_DATA_WRITE_MISS	4
-#define	PMC5_WRITE_M_E		5
-#define	PMC5_DATA_LINES_WBACK	6
-#define	PMC5_DATA_CACHE_SNOOP	7
-#define	PMC5_DATA_CACHE_SNOOP_HIT 8
-#define	PMC5_MEM_ACCESS_BOTH	9
-#define	PMC5_BANK_CONFLICTS	10
-#define	PMC5_MISALIGNED_DATA	11
-#define	PMC5_INST_READ		12
-#define	PMC5_INST_TLB_MISS	13
-#define	PMC5_INST_CACHE_MISS	14
-#define	PMC5_SEGMENT_REG_LOAD	15
-#define	PMC5_BRANCHES		18
-#define	PMC5_BTB_HITS		19
-#define	PMC5_BRANCH_TAKEN	20
-#define	PMC5_PIPELINE_FLUSH	21
-#define	PMC5_INST_EXECUTED	22
-#define PMC5_INST_EXECUTED_V	23
-#define	PMC5_BUS_UTILIZATION	24
-#define	PMC5_WRITE_BACKUP_STALL	25
-#define	PMC5_DATA_READ_STALL	26
-#define	PMC5_WRITE_E_M_STALL	27
-#define	PMC5_LOCKED_BUS		28
-#define	PMC5_IO_CYCLE		29
-#define	PMC5_NONCACHE_MEMORY	30
-#define	PMC5_ADDR_GEN_INTERLOCK	31
-#define	PMC5_FLOPS		34
-#define	PMC5_BP0_MATCH		35
-#define	PMC5_BP1_MATCH		36
-#define	PMC5_BP2_MATCH		37
-#define	PMC5_BP3_MATCH		38
-#define	PMC5_HW_INTR		39
-#define	PMC5_DATA_RW		40
-#define	PMC5_DATA_RW_MISS	41
-
-#endif /* !_CPU_PERFMON_H_ */
diff --git a/sys/cpu/i386/include/pmap.h b/sys/cpu/i386/include/pmap.h
deleted file mode 100644
index e53e92f..0000000
--- a/sys/cpu/i386/include/pmap.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1991 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and William Jolitz of UUNET Technologies Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Derived from hp300 version by Mike Hibler, this version by William
- * Jolitz uses a recursive map [a pde points to the page directory] to
- * map the page tables using the pagetables themselves. This is done to
- * reduce the impact on kernel virtual memory for lots of sparse address
- * space, and to reduce the cost of memory to each process.
- *
- *	from: hp300: @(#)pmap.h	7.2 (Berkeley) 12/16/90
- *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/pmap.h,v 1.14 2007/01/14 20:07:11 dillon Exp $
- */
-
-#ifndef _CPU_PMAP_H_
-#define	_CPU_PMAP_H_
-
-/*
- * Page-directory and page-table entires follow this format, with a few
- * of the fields not present here and there, depending on a lot of things.
- */
-				/* ---- Intel Nomenclature ---- */
-#define	PG_V		0x001	/* P	Valid			*/
-#define PG_RW		0x002	/* R/W	Read/Write		*/
-#define PG_U		0x004	/* U/S  User/Supervisor		*/
-#define	PG_NC_PWT	0x008	/* PWT	Write through		*/
-#define	PG_NC_PCD	0x010	/* PCD	Cache disable		*/
-#define PG_A		0x020	/* A	Accessed		*/
-#define	PG_M		0x040	/* D	Dirty			*/
-#define	PG_PS		0x080	/* PS	Page size (0=4k,1=4M)	*/
-#define	PG_PTE_PAT	0x080	/* PAT	PAT index		*/
-#define	PG_G		0x100	/* G	Global			*/
-#define	PG_AVAIL1	0x200	/*    /	Available for system	*/
-#define	PG_AVAIL2	0x400	/*   <	programmers use		*/
-#define	PG_AVAIL3	0x800	/*    \				*/
-#define	PG_PDE_PAT	0x1000	/* PAT	PAT index		*/
-
-
-/* Our various interpretations of the above */
-#define PG_W		PG_AVAIL1	/* "Wired" pseudoflag */
-#define	PG_MANAGED	PG_AVAIL2
-#define	PG_FRAME	(~((vm_paddr_t)PAGE_MASK))
-#define	PG_PROT		(PG_RW|PG_U)	/* all protection bits . */
-#define PG_N		(PG_NC_PWT|PG_NC_PCD)	/* Non-cacheable */
-
-/*
- * Page Protection Exception bits, stored in tf_err on a real fault
- * and in tf_xflags on a signal frame or virtual kernel's trap frame.
- * These only apply to T_PAGEFLT faults.
- *
- * PGEX_U is also used internally by the virtual kernel to indicate
- * whether the frame is a userland frame or a supervisor frame.
- */
-#define PGEX_P		0x01	/* Protection violation vs. not present */
-#define PGEX_W		0x02	/* during a Write cycle */
-#define PGEX_U		0x04	/* access from User mode (UPL) */
-
-/*
- * Virtual kernel bits, managed by software.  Stored in tf_xflags.
- *
- * PGEX_FPFAULT - Force the FP unit to generate a T_DNA fault if an
- *		  emulated user process tried to use it.  This bit is
- *		  only used by vmspace_ctl().
- */
-#define PGEX_FPFAULT	0x80
-
-#endif /* !_CPU_PMAP_H_ */
diff --git a/sys/cpu/i386/include/profile.h b/sys/cpu/i386/include/profile.h
deleted file mode 100644
index 02bdd01..0000000
--- a/sys/cpu/i386/include/profile.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)profile.h	8.1 (Berkeley) 6/11/93
- * $FreeBSD: src/sys/i386/include/profile.h,v 1.20 1999/12/29 04:33:05 peter Exp $
- */
-
-#ifndef _CPU_PROFILE_H_
-#define	_CPU_PROFILE_H_
-
-#ifndef _SYS_CDEFS_H_
-#include <sys/cdefs.h>
-#endif
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-
-#ifdef _KERNEL
-
-/*
- * Config generates something to tell the compiler to align functions on 16
- * byte boundaries.  A strict alignment is good for keeping the tables small.
- */
-#define	FUNCTION_ALIGNMENT	16
-
-/*
- * The kernel uses assembler stubs instead of unportable inlines.
- * This is mainly to save a little time when profiling is not enabled,
- * which is the usual case for the kernel.
- */
-#define	_MCOUNT_DECL void mcount
-#define	MCOUNT
-
-#ifdef GUPROF
-#define	CALIB_SCALE	1000
-#define	KCOUNT(p,index)	((p)->kcount[(index) \
-			 / (HISTFRACTION * sizeof(HISTCOUNTER))])
-#define	MCOUNT_DECL(s)
-#define	MCOUNT_ENTER(s)
-#define	MCOUNT_EXIT(s)
-#define	PC_TO_I(p, pc)	((uintfptr_t)(pc) - (uintfptr_t)(p)->lowpc)
-#else
-#define	MCOUNT_DECL(s)	u_long s;
-struct spinlock_deprecated;
-extern struct spinlock_deprecated mcount_spinlock;
-void spin_lock_np(struct spinlock_deprecated *sp);
-void spin_unlock_np(struct spinlock_deprecated *sp);
-#define	MCOUNT_ENTER(s)	{ s = read_eflags(); \
- 			  __asm __volatile("cli" : : : "memory"); \
-			  spin_lock_np(&mcount_spinlock); }
-#define	MCOUNT_EXIT(s)	{ spin_unlock_np(&mcount_spinlock); write_eflags(s); }
-#endif /* GUPROF */
-
-#else /* !_KERNEL */
-
-#define	FUNCTION_ALIGNMENT	4
-
-#define	_MCOUNT_DECL static __inline void _mcount
-
-#define	MCOUNT \
-void \
-mcount(void) \
-{ \
-	register int c asm("ecx"); \
-	register int d asm("edx"); \
-	register int a asm("eax"); \
-	uintfptr_t selfpc, frompc; \
-	/* \
-	 * mcount can't trash any registers, but _mcount \
-	 * follows the i386 abi and considers eax, ecx and \
-	 * edx caller-saved. We're the caller, so save them \
-	 * here. \
-	 */ \
-	asm("push %%ecx" : : "r" (c) : "memory"); \
-	asm("push %%edx" : : "r" (d): "memory"); \
-	asm("push %%eax" : : "r" (a) : "memory"); \
-	/* \
-	 * Find the return address for mcount, \
-	 * and the return address for mcount's caller. \
-	 * \
-	 * selfpc = pc pushed by call to mcount \
-	 */ \
-	asm("movl 4(%%ebp),%0" : "=r" (selfpc)); \
-	/* \
-	 * frompc = pc pushed by call to mcount's caller. \
-	 * The caller's stack frame has already been built, so %ebp is \
-	 * the caller's frame pointer.  The caller's raddr is in the \
-	 * caller's frame following the caller's caller's frame pointer. \
-	 */ \
-	asm("movl (%%ebp),%0" : "=r" (frompc)); \
-	frompc = ((uintfptr_t *)frompc)[1]; \
-	_mcount(frompc, selfpc); \
-	/* restore the registers that _mcount possibly trashed */	\
-	asm volatile ("pop %%eax" : "=r" (a) : ); \
-	asm volatile ("pop %%edx" : "=r" (d) : ); \
-	asm volatile ("pop %%ecx" : "=r" (c) : ); \
-}
-
-typedef	unsigned int	uintfptr_t;
-
-#endif /* _KERNEL */
-
-/*
- * An unsigned integral type that can hold non-negative difference between
- * function pointers.
- */
-typedef	u_int	fptrdiff_t;
-
-#ifdef _KERNEL
-
-void	mcount (uintfptr_t frompc, uintfptr_t selfpc);
-
-#ifdef GUPROF
-struct gmonparam;
-
-void	nullfunc_loop_profiled (void);
-void	nullfunc_profiled (void);
-void	startguprof (struct gmonparam *p);
-void	stopguprof (struct gmonparam *p);
-#else
-#define	startguprof(p)
-#define	stopguprof(p)
-#endif /* GUPROF */
-
-#else /* !_KERNEL */
-
-__BEGIN_DECLS
-#ifdef __GNUC__
-void	mcount (void) __asm(".mcount");
-#endif
-/*static void	_mcount (uintfptr_t frompc, uintfptr_t selfpc);*/
-__END_DECLS
-
-#endif /* _KERNEL */
-
-#ifdef GUPROF
-/* XXX doesn't quite work outside kernel yet. */
-extern int	cputime_bias;
-
-__BEGIN_DECLS
-int	cputime (void);
-void	empty_loop (void);
-void	mexitcount (uintfptr_t selfpc);
-void	nullfunc (void);
-void	nullfunc_loop (void);
-__END_DECLS
-#endif
-
-#endif /* !_CPU_PROFILE_H_ */
diff --git a/sys/cpu/i386/include/psl.h b/sys/cpu/i386/include/psl.h
deleted file mode 100644
index 4a7c4d3..0000000
--- a/sys/cpu/i386/include/psl.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)psl.h	5.2 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/i386/include/psl.h,v 1.10.2.1 2001/11/22 08:53:35 sobomax Exp $
- * $DragonFly: src/sys/cpu/i386/include/psl.h,v 1.3 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_PSL_H_
-#define	_CPU_PSL_H_
-
-/*
- * 386 processor status longword.
- */
-#define	PSL_C		0x00000001	/* carry bit */
-#define	PSL_PF		0x00000004	/* parity bit */
-#define	PSL_AF		0x00000010	/* bcd carry bit */
-#define	PSL_Z		0x00000040	/* zero bit */
-#define	PSL_N		0x00000080	/* negative bit */
-#define	PSL_T		0x00000100	/* trace enable bit */
-#define	PSL_I		0x00000200	/* interrupt enable bit */
-#define	PSL_D		0x00000400	/* string instruction direction bit */
-#define	PSL_V		0x00000800	/* overflow bit */
-#define	PSL_IOPL	0x00003000	/* i/o privilege level */
-#define	PSL_NT		0x00004000	/* nested task bit */
-#define	PSL_RF		0x00010000	/* resume flag bit */
-#define	PSL_VM		0x00020000	/* virtual 8086 mode bit */
-#define	PSL_AC		0x00040000	/* alignment checking */
-#define	PSL_VIF		0x00080000	/* virtual interrupt enable */
-#define	PSL_VIP		0x00100000	/* virtual interrupt pending */
-#define	PSL_ID		0x00200000	/* identification bit */
-
-/*
- * The i486 manual says that we are not supposed to change reserved flags,
- * but this is too much trouble since the reserved flags depend on the cpu
- * and setting them to their historical values works in practice.
- */
-#define	PSL_RESERVED_DEFAULT	0x00000002
-
-/*
- * Initial flags for kernel and user mode.  The kernel later inherits
- * PSL_I and some other flags from user mode.
- */
-#define	PSL_KERNEL	PSL_RESERVED_DEFAULT
-#define	PSL_USER	(PSL_RESERVED_DEFAULT | PSL_I)
-
-/*
- * Bits that can be changed in user mode on 486's.  We allow these bits
- * to be changed using ptrace(), sigreturn() and procfs.  Setting PS_NT
- * is undesirable but it may as well be allowed since users can inflict
- * it on the kernel directly.  Changes to PSL_AC are silently ignored on
- * 386's.
- */
-#define	PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \
-			| PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID)
-
-#endif /* !_CPU_PSL_H_ */
diff --git a/sys/cpu/i386/include/reg.h b/sys/cpu/i386/include/reg.h
deleted file mode 100644
index fa5ac11..0000000
--- a/sys/cpu/i386/include/reg.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)reg.h	5.5 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/i386/include/reg.h,v 1.22.2.2 2002/11/07 22:47:55 alfred Exp $
- * $DragonFly: src/sys/cpu/i386/include/reg.h,v 1.8 2007/01/08 03:33:37 dillon Exp $
- */
-
-#ifndef _CPU_REG_H_
-#define	_CPU_REG_H_
-
-/*
- * Indices for registers in `struct trapframe' and `struct regs'.
- *
- * This interface is deprecated.  In the kernel, it is only used in FPU
- * emulators to convert from register numbers encoded in instructions to
- * register values.  Everything else just accesses the relevant struct
- * members.  In userland, debuggers tend to abuse this interface since
- * they don't understand that `struct regs' is a struct.  I hope they have
- * stopped accessing the registers in the trap frame via PT_{READ,WRITE}_U
- * and we can stop supporting the user area soon.
- */
-#define	tGS	(0)
-#define	tFS	(1)
-#define	tES	(2)
-#define	tDS	(3)
-#define	tEDI	(4)
-#define	tESI	(5)
-#define	tEBP	(6)
-#define	tISP	(7)
-#define	tEBX	(8)
-#define	tEDX	(9)
-#define	tECX	(10)
-#define	tEAX	(11)
-#define tXFLAGS	(12)
-#define	tTRAPNO	(13)
-#define	tERR	(14)
-#define	tEIP	(15)
-#define	tCS	(16)
-#define	tEFLAGS	(17)
-#define	tESP	(18)
-#define	tSS	(19)
-
-/*
- * Indices for registers in `struct regs' only.
- *
- * Some registers live in the pcb and are only in an "array" with the
- * other registers in application interfaces that copy all the registers
- * to or from a `struct regs'.
- */
-
-/*
- * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS.
- */
-struct reg {
-	unsigned int	r_gs;
-	unsigned int	r_fs;
-	unsigned int	r_es;
-	unsigned int	r_ds;
-	unsigned int	r_edi;
-	unsigned int	r_esi;
-	unsigned int	r_ebp;
-	unsigned int	r_isp;
-	unsigned int	r_ebx;
-	unsigned int	r_edx;
-	unsigned int	r_ecx;
-	unsigned int	r_eax;
-	unsigned int	r_xflags;
-	unsigned int	r_trapno;
-	unsigned int	r_err;
-	unsigned int	r_eip;
-	unsigned int	r_cs;
-	unsigned int	r_eflags;
-	unsigned int	r_esp;
-	unsigned int	r_ss;
-};
-
-/*
- * Register set accessible via /proc/$pid/fpregs.
- */
-struct fpreg {
-	/*
-	 * XXX should get struct from npx.h.  Here we give a slightly
-	 * simplified struct.  This may be too much detail.  Perhaps
-	 * an array of unsigned longs is best.
-	 */
-	unsigned long	fpr_env[7];
-	unsigned char	fpr_acc[8][10];
-	unsigned long	fpr_ex_sw;
-	unsigned char	fpr_pad[64];
-};
-
-/*
- * Register set accessible via /proc/$pid/dbregs.
- */
-struct dbreg {
-	unsigned int  dr0;	/* debug address register 0 */
-	unsigned int  dr1;	/* debug address register 1 */
-	unsigned int  dr2;	/* debug address register 2 */
-	unsigned int  dr3;	/* debug address register 3 */
-	unsigned int  dr4;	/* reserved */
-	unsigned int  dr5;	/* reserved */
-	unsigned int  dr6;	/* debug status register */
-	unsigned int  dr7;	/* debug control register */
-};
-
-#define DBREG_DR7_EXEC      0x00      /* break on execute       */
-#define DBREG_DR7_WRONLY    0x01      /* break on write         */
-#define DBREG_DR7_RDWR      0x03      /* break on read or write */
-#define DBREG_DRX(d,x) ((&(d)->dr0)[x]) /* reference dr0 - dr7 by
-                                         register number */
-
-#endif /* !_CPU_REG_H_ */
diff --git a/sys/cpu/i386/include/reloc.h b/sys/cpu/i386/include/reloc.h
deleted file mode 100644
index d109bc8..0000000
--- a/sys/cpu/i386/include/reloc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)reloc.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/i386/include/reloc.h,v 1.7 1999/08/28 00:44:23 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/reloc.h,v 1.4 2006/11/07 18:49:59 dillon Exp $
- */
-
-#ifndef _CPU_RELOC_H_
-#define _CPU_RELOC_H_
-
-/* Relocation format. */
-struct relocation_info {
-	int r_address;			  /* offset in text or data segment */
-	unsigned int   r_symbolnum : 24,  /* ordinal number of add symbol */
-			   r_pcrel :  1,  /* 1 if value should be pc-relative */
-			  r_length :  2,  /* log base 2 of value's width */
-			  r_extern :  1,  /* 1 if need to add symbol to value */
-			 r_baserel :  1,  /* linkage table relative */
-			r_jmptable :  1,  /* relocate to jump table */
-			r_relative :  1,  /* load address relative */
-			    r_copy :  1;  /* run time copy */
-};
-
-#endif
diff --git a/sys/cpu/i386/include/segments.h b/sys/cpu/i386/include/segments.h
deleted file mode 100644
index 2edf448..0000000
--- a/sys/cpu/i386/include/segments.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*-
- * Copyright (c) 1989, 1990 William F. Jolitz
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)segments.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/include/segments.h,v 1.24 1999/12/29 04:33:07 peter Exp $
- */
-
-#ifndef _CPU_SEGMENTS_H_
-#define	_CPU_SEGMENTS_H_
-
-/*
- * 386 Segmentation Data Structures and definitions
- *	William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989
- */
-
-/*
- * Selectors
- */
-
-#define SEL_RPL_MASK	0x0003
-
-#define	ISPL(s)	((s)&3)		/* what is the priority level of a selector */
-#define	SEL_KPL	0		/* kernel priority level */
-#define	SEL_UPL	3		/* user priority level */
-#define	ISLDT(s)	((s)&SEL_LDT)	/* is it local or global */
-#define	SEL_LDT	4		/* local descriptor table */
-#define	IDXSEL(s)	(((s)>>3) & 0x1fff)		/* index of selector */
-#define	LSEL(s,r)	(((s)<<3) | SEL_LDT | r)	/* a local selector */
-#define	GSEL(s,r)	(((s)<<3) | r)			/* a global selector */
-
-#ifndef LOCORE
-
-/*
- * Memory and System segment descriptors
- */
-struct	segment_descriptor	{
-	unsigned sd_lolimit:16 ;	/* segment extent (lsb) */
-	unsigned sd_lobase:24 __attribute__ ((packed));
-					/* segment base address (lsb) */
-	unsigned sd_type:5 ;		/* segment type */
-	unsigned sd_dpl:2 ;		/* segment descriptor priority level */
-	unsigned sd_p:1 ;		/* segment descriptor present */
-	unsigned sd_hilimit:4 ;		/* segment extent (msb) */
-	unsigned sd_xx:2 ;		/* unused */
-	unsigned sd_def32:1 ;		/* default 32 vs 16 bit size */
-	unsigned sd_gran:1 ;		/* limit granularity (byte/page units)*/
-	unsigned sd_hibase:8 ;		/* segment base address  (msb) */
-} ;
-
-/*
- * Gate descriptors (e.g. indirect descriptors)
- */
-struct	gate_descriptor	{
-	unsigned gd_looffset:16 ;	/* gate offset (lsb) */
-	unsigned gd_selector:16 ;	/* gate segment selector */
-	unsigned gd_stkcpy:5 ;		/* number of stack wds to cpy */
-	unsigned gd_xx:3 ;		/* unused */
-	unsigned gd_type:5 ;		/* segment type */
-	unsigned gd_dpl:2 ;		/* segment descriptor priority level */
-	unsigned gd_p:1 ;		/* segment descriptor present */
-	unsigned gd_hioffset:16 ;	/* gate offset (msb) */
-} ;
-
-/*
- * Generic descriptor
- */
-union	descriptor	{
-	struct	segment_descriptor sd;
-	struct	gate_descriptor gd;
-};
-
-#endif
-
-	/* system segments and gate types */
-#define	SDT_SYSNULL	 0	/* system null */
-#define	SDT_SYS286TSS	 1	/* system 286 TSS available */
-#define	SDT_SYSLDT	 2	/* system local descriptor table */
-#define	SDT_SYS286BSY	 3	/* system 286 TSS busy */
-#define	SDT_SYS286CGT	 4	/* system 286 call gate */
-#define	SDT_SYSTASKGT	 5	/* system task gate */
-#define	SDT_SYS286IGT	 6	/* system 286 interrupt gate */
-#define	SDT_SYS286TGT	 7	/* system 286 trap gate */
-#define	SDT_SYSNULL2	 8	/* system null again */
-#define	SDT_SYS386TSS	 9	/* system 386 TSS available */
-#define	SDT_SYSNULL3	10	/* system null again */
-#define	SDT_SYS386BSY	11	/* system 386 TSS busy */
-#define	SDT_SYS386CGT	12	/* system 386 call gate */
-#define	SDT_SYSNULL4	13	/* system null again */
-#define	SDT_SYS386IGT	14	/* system 386 interrupt gate */
-#define	SDT_SYS386TGT	15	/* system 386 trap gate */
-
-	/* memory segment types */
-#define	SDT_MEMRO	16	/* memory read only */
-#define	SDT_MEMROA	17	/* memory read only accessed */
-#define	SDT_MEMRW	18	/* memory read write */
-#define	SDT_MEMRWA	19	/* memory read write accessed */
-#define	SDT_MEMROD	20	/* memory read only expand dwn limit */
-#define	SDT_MEMRODA	21	/* memory read only expand dwn limit accessed */
-#define	SDT_MEMRWD	22	/* memory read write expand dwn limit */
-#define	SDT_MEMRWDA	23	/* memory read write expand dwn limit accessed */
-#define	SDT_MEME	24	/* memory execute only */
-#define	SDT_MEMEA	25	/* memory execute only accessed */
-#define	SDT_MEMER	26	/* memory execute read */
-#define	SDT_MEMERA	27	/* memory execute read accessed */
-#define	SDT_MEMEC	28	/* memory execute only conforming */
-#define	SDT_MEMEAC	29	/* memory execute only accessed conforming */
-#define	SDT_MEMERC	30	/* memory execute read conforming */
-#define	SDT_MEMERAC	31	/* memory execute read accessed conforming */
-
-#ifndef LOCORE
-
-/* is memory segment descriptor pointer ? */
-#define ISMEMSDP(s)	((s->d_type) >= SDT_MEMRO && (s->d_type) <= SDT_MEMERAC)
-
-/* is 286 gate descriptor pointer ? */
-#define IS286GDP(s)	(((s->d_type) >= SDT_SYS286CGT \
-				 && (s->d_type) < SDT_SYS286TGT))
-
-/* is 386 gate descriptor pointer ? */
-#define IS386GDP(s)	(((s->d_type) >= SDT_SYS386CGT \
-				&& (s->d_type) < SDT_SYS386TGT))
-
-/* is gate descriptor pointer ? */
-#define ISGDP(s)	(IS286GDP(s) || IS386GDP(s))
-
-/* is segment descriptor pointer ? */
-#define ISSDP(s)	(ISMEMSDP(s) || !ISGDP(s))
-
-/* is system segment descriptor pointer ? */
-#define ISSYSSDP(s)	(!ISMEMSDP(s) && !ISGDP(s))
-
-/*
- * Software definitions are in this convenient format,
- * which are translated into inconvenient segment descriptors
- * when needed to be used by the 386 hardware
- */
-
-struct	soft_segment_descriptor	{
-	unsigned ssd_base ;		/* segment base address  */
-	unsigned ssd_limit ;		/* segment extent */
-	unsigned ssd_type:5 ;		/* segment type */
-	unsigned ssd_dpl:2 ;		/* segment descriptor priority level */
-	unsigned ssd_p:1 ;		/* segment descriptor present */
-	unsigned ssd_xx:4 ;		/* unused */
-	unsigned ssd_xx1:2 ;		/* unused */
-	unsigned ssd_def32:1 ;		/* default 32 vs 16 bit size */
-	unsigned ssd_gran:1 ;		/* limit granularity (byte/page units)*/
-};
-
-/*
- * region descriptors, used to load gdt/idt tables before segments yet exist.
- */
-struct region_descriptor {
-	unsigned rd_limit:16;				/* segment extent */
-	unsigned rd_base:32 __attribute__ ((packed));	/* base address  */
-};
-
-#endif
-
-/*
- * Segment Protection Exception code bits
- */
-
-#define	SEGEX_EXT	0x01	/* recursive or externally induced */
-#define	SEGEX_IDT	0x02	/* interrupt descriptor table */
-#define	SEGEX_TI	0x04	/* local descriptor table */
-				/* other bits are affected descriptor index */
-#define SEGEX_IDX(s)	(((s)>>3)&0x1fff)
-
-/*
- * Size of IDT table.
- */
-#define	NIDT	256		/* we use them all */
-
-/*
- * Entries in the Global Descriptor Table (GDT)
- */
-#define	GNULL_SEL	0	/* Null Descriptor */
-#define	GCODE_SEL	1	/* Kernel Code Descriptor */
-#define	GDATA_SEL	2	/* Kernel Data Descriptor */
-#define	GPRIV_SEL	3	/* SMP Per-Processor Private Data */
-#define	GPROC0_SEL	4	/* Task state process slot zero and up */
-#define	GLDT_SEL	5	/* LDT - eventually one per process */
-#define	GUSERLDT_SEL	6	/* User LDT */
-#define	GTGATE_SEL	7	/* Process task switch gate */
-#define	GBIOSLOWMEM_SEL	8	/* BIOS low memory access (must be entry 8) */
-#define	GPANIC_SEL	9	/* Task state to consider panic from */
-#define GBIOSCODE32_SEL	10	/* BIOS interface (32bit Code) */
-#define GBIOSCODE16_SEL	11	/* BIOS interface (16bit Code) */
-#define GBIOSDATA_SEL	12	/* BIOS interface (Data) */
-#define GBIOSUTIL_SEL	13	/* BIOS interface (Utility) */
-#define GBIOSARGS_SEL	14	/* BIOS interface (Arguments) */
-#define	GTLS_START	15	/* Thread TLS Descriptor */
-#define	GTLS_END	17	/* Thread TLS Descriptor */
-#define	GNDIS_SEL	18	/* For the NDIS layer */
-
-#define NGTLS		(GTLS_END - GTLS_START + 1)
-#define NGDT 		19
-
-/*
- * Entries in the Local Descriptor Table (LDT)
- */
-#define	LSYS5CALLS_SEL	0	/* forced by intel BCS */
-#define	LSYS5SIGR_SEL	1
-#define	L43BSDCALLS_SEL	2	/* notyet */
-#define	LUCODE_SEL	3
-#define LSOL26CALLS_SEL	4	/* Solaris >= 2.6 system call gate */
-#define	LUDATA_SEL	5
-/* separate stack, es,fs,gs sels ? */
-/* #define	LPOSIXCALLS_SEL	5*/	/* notyet */
-#define LBSDICALLS_SEL	16	/* BSDI system call gate */
-#define NLDT		(LBSDICALLS_SEL + 1)
-
-#ifndef LOCORE
-
-struct savetls {
-	struct segment_descriptor tls[NGTLS];
-};
-
-#endif
-
-#if defined(_KERNEL) && !defined(LOCORE)
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-
-extern int	_default_ldt;
-extern union descriptor gdt[];
-extern struct soft_segment_descriptor gdt_segs[];
-extern struct gate_descriptor *idt;
-extern union descriptor ldt[NLDT];
-extern struct mtx dt_lock;
-
-void	lgdt		(struct region_descriptor *rdp);
-void	lidt		(struct region_descriptor *rdp);
-void	lldt		(u_short sel);
-void	sdtossd		(struct segment_descriptor *sdp,
-			     struct soft_segment_descriptor *ssdp);
-void	ssdtosd		(struct soft_segment_descriptor *ssdp,
-			     struct segment_descriptor *sdp);
-#endif /* _KERNEL */
-
-#endif /* !_CPU_SEGMENTS_H_ */
diff --git a/sys/cpu/i386/include/setjmp.h b/sys/cpu/i386/include/setjmp.h
deleted file mode 100644
index 5977230..0000000
--- a/sys/cpu/i386/include/setjmp.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $FreeBSD: src/sys/i386/include/setjmp.h,v 1.4.2.1 2000/10/27 09:16:05 bde Exp $ */
-/*
- * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by John Birrell.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _CPU_SETJMP_H_
-#define _CPU_SETJMP_H_
-
-#define	_JBLEN	11		/* Size of the jmp_buf on x86. */
-
-/*
- * jmp_buf and sigjmp_buf are encapsulated in different structs to force
- * compile-time diagnostics for mismatches.  The structs are the same
- * internally to avoid some run-time errors for mismatches.
- */
-#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
-typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
-#endif
-
-typedef struct _jmp_buf { int _jb[_JBLEN + 1]; } jmp_buf[1];
-
-#endif
-
diff --git a/sys/cpu/i386/include/sigframe.h b/sys/cpu/i386/include/sigframe.h
deleted file mode 100644
index 20b155a..0000000
--- a/sys/cpu/i386/include/sigframe.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * Copyright (c) 1999 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer 
- *    in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/sigframe.h,v 1.5 1999/12/04 10:40:24 marcel Exp $
- * $DragonFly: src/sys/cpu/i386/include/sigframe.h,v 1.5 2006/11/07 17:51:21 dillon Exp $
- */
-
-#ifndef _CPU_SIGFRAME_H_
-#define	_CPU_SIGFRAME_H_
-
-#ifndef _MACHINE_TYPES_H_
-#include <machine/types.h>
-#endif
-#ifndef _SYS_SIGNAL_H_
-#include <sys/signal.h>
-#endif
-#ifndef _SYS_UCONTEXT_H_
-#include <sys/ucontext.h>
-#endif
-
-/*
- * Signal frames, arguments passed to application signal handlers.
- */
-
-struct sigframe {
-	/*
-	 * The first four members may be used by applications.
-	 *
-	 * NOTE: The 4th argument is undocumented, ill commented
-	 * on and seems to be somewhat BSD "standard".  Handlers
-	 * installed with sigvec may be using it.
-	 */
-	register_t	sf_signum;
-	register_t	sf_siginfo;	/* code or pointer to sf_si */
-	register_t	sf_ucontext;	/* points to sf_uc */
-	register_t	sf_addr;	/* undocumented 4th arg */
-
-	union {
-		__siginfohandler_t	*sf_action;
-		__sighandler_t		*sf_handler;
-	} sf_ahu;
-	ucontext_t	sf_uc;		/* = *sf_ucontext */
-	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
-};
-
-#endif /* !_CPU_SIGFRAME_H_ */
diff --git a/sys/cpu/i386/include/signal.h b/sys/cpu/i386/include/signal.h
deleted file mode 100644
index 7f89629..0000000
--- a/sys/cpu/i386/include/signal.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 1986, 1989, 1991, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)signal.h	8.1 (Berkeley) 6/11/93
- * $FreeBSD: src/sys/i386/include/signal.h,v 1.12 1999/11/12 13:52:11 marcel Exp $
- */
-
-#ifndef _CPU_SIGNAL_H_
-#define	_CPU_SIGNAL_H_
-
-/*
- * Machine-dependent signal definitions
- */
-
-typedef int sig_atomic_t;
-
-#if __BSD_VISIBLE
-
-/*
- * XXX temporarily use a <machine/bla.h> path instead of "bla.h" so the
- * XFree86-4-clients port, which uses -I-, builds.  Use of -I- should
- * be banned, or the option should be fixed to not screw up relative-path
- * includes.
- */
-
-#ifndef _SYS_SIGNAL_H_
-#include <sys/signal.h>
-#endif
-#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
-
-/*
- * Information pushed on stack when a signal is delivered.
- * This is used by the kernel to restore state following
- * execution of the signal handler.  It is also made available
- * to the handler to allow it to restore state properly if
- * a non-standard exit is performed.
- *
- * The sequence of the fields/registers in struct sigcontext should match
- * those in mcontext_t.
- */
-struct	sigcontext {
-	sigset_t sc_mask;		/* signal mask to restore */
-	int	sc_onstack;		/* sigstack state to restore */
-	int	sc_gs;			/* machine state (struct trapframe): */
-	int	sc_fs;
-	int	sc_es;
-	int	sc_ds;
-	int	sc_edi;
-	int	sc_esi;
-	int	sc_ebp;
-	int	sc_isp;
-	int	sc_ebx;
-	int	sc_edx;
-	int	sc_ecx;
-	int	sc_eax;
-	int	sc_xflags;
-	int	sc_trapno;
-	int	sc_err;
-	int	sc_eip;
-	int	sc_cs;
-	int	sc_efl;
-	int	sc_esp;
-	int	sc_ss;
-
-	int	mc_len;
-	int	mc_fpformat;
-	int	mc_ownedfp;
-
-	/*
-	 * Full FPU state is 512 bytes.  Add another 16 bytes worth of spare.
-	 *
-	 * This field must be 16-byte aligned.
-	 */
-	int	sc_fpregs[128];		/* machine state (FPU): */
-	int	sc_spare[16];
-};
-
-#define	sc_sp		sc_esp
-#define	sc_fp		sc_ebp
-#define	sc_pc		sc_eip
-#define	sc_ps		sc_efl
-#define	sc_eflags	sc_efl
-
-#endif /* __BSD_VISIBLE */
-
-#endif /* !_CPU_SIGNAL_H_ */
diff --git a/sys/cpu/i386/include/specialreg.h b/sys/cpu/i386/include/specialreg.h
deleted file mode 100644
index 065c623..0000000
--- a/sys/cpu/i386/include/specialreg.h
+++ /dev/null
@@ -1,537 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)specialreg.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/include/specialreg.h,v 1.54 2009/09/10 17:27:36 jkim Exp $
- */
-
-#ifndef _CPU_SPECIALREG_H_
-#define	_CPU_SPECIALREG_H_
-
-/*
- * Bits in 386 special registers:
- */
-#define	CR0_PE	0x00000001	/* Protected mode Enable */
-#define	CR0_MP	0x00000002	/* "Math" (fpu) Present */
-#define	CR0_EM	0x00000004	/* EMulate FPU instructions. (trap ESC only) */
-#define	CR0_TS	0x00000008	/* Task Switched (if MP, trap ESC and WAIT) */
-#define	CR0_PG	0x80000000	/* PaGing enable */
-
-/*
- * Bits in 486 special registers:
- */
-#define	CR0_NE	0x00000020	/* Numeric Error enable (EX16 vs IRQ13) */
-#define	CR0_WP	0x00010000	/* Write Protect (honor page protect in
-							   all modes) */
-#define	CR0_AM	0x00040000	/* Alignment Mask (set to enable AC flag) */
-#define	CR0_NW  0x20000000	/* Not Write-through */
-#define	CR0_CD  0x40000000	/* Cache Disable */
-
-/*
- * Bits in PPro special registers
- */
-#define	CR4_VME	0x00000001	/* Virtual 8086 mode extensions */
-#define	CR4_PVI	0x00000002	/* Protected-mode virtual interrupts */
-#define	CR4_TSD	0x00000004	/* Time stamp disable */
-#define	CR4_DE	0x00000008	/* Debugging extensions */
-#define	CR4_PSE	0x00000010	/* Page size extensions */
-#define	CR4_PAE	0x00000020	/* Physical address extension */
-#define	CR4_MCE	0x00000040	/* Machine check enable */
-#define	CR4_PGE	0x00000080	/* Page global enable */
-#define	CR4_PCE	0x00000100	/* Performance monitoring counter enable */
-#define	CR4_FXSR 0x00000200	/* Fast FPU save/restore used by OS */
-#define	CR4_XMM	0x00000400	/* enable SIMD/MMX2 to use except 16 */
-
-/*
- * Bits in AMD64 special registers.  EFER is 64 bits wide.
- */
-#define	EFER_NXE 0x000000800	/* PTE No-Execute bit enable (R/W) */
-
-/*
- * CPUID instruction features register
- */
-#define	CPUID_FPU	0x00000001
-#define	CPUID_VME	0x00000002
-#define	CPUID_DE	0x00000004
-#define	CPUID_PSE	0x00000008
-#define	CPUID_TSC	0x00000010
-#define	CPUID_MSR	0x00000020
-#define	CPUID_PAE	0x00000040
-#define	CPUID_MCE	0x00000080
-#define	CPUID_CX8	0x00000100
-#define	CPUID_APIC	0x00000200
-#define	CPUID_B10	0x00000400
-#define	CPUID_SEP	0x00000800
-#define	CPUID_MTRR	0x00001000
-#define	CPUID_PGE	0x00002000
-#define	CPUID_MCA	0x00004000
-#define	CPUID_CMOV	0x00008000
-#define	CPUID_PAT	0x00010000
-#define	CPUID_PSE36	0x00020000
-#define	CPUID_PSN	0x00040000
-#define	CPUID_CLFSH	0x00080000
-#define	CPUID_B20	0x00100000
-#define	CPUID_DS	0x00200000
-#define	CPUID_ACPI	0x00400000
-#define	CPUID_MMX	0x00800000
-#define	CPUID_FXSR	0x01000000
-#define	CPUID_SSE	0x02000000
-#define	CPUID_XMM	0x02000000
-#define	CPUID_SSE2	0x04000000
-#define	CPUID_SS	0x08000000
-#define	CPUID_HTT	0x10000000
-#define	CPUID_TM	0x20000000
-#define	CPUID_IA64	0x40000000
-#define	CPUID_PBE	0x80000000
-
-#define	CPUID2_SSE3	0x00000001
-#define	CPUID2_PCLMULQDQ 0x00000002
-#define	CPUID2_DTES64	0x00000004
-#define	CPUID2_MON	0x00000008
-#define	CPUID2_DS_CPL	0x00000010
-#define	CPUID2_VMX	0x00000020
-#define	CPUID2_SMX	0x00000040
-#define	CPUID2_EST	0x00000080
-#define	CPUID2_TM2	0x00000100
-#define	CPUID2_SSSE3	0x00000200
-#define	CPUID2_CNXTID	0x00000400
-#define	CPUID2_CX16	0x00002000
-#define	CPUID2_XTPR	0x00004000
-#define	CPUID2_PDCM	0x00008000
-#define	CPUID2_DCA	0x00040000
-#define	CPUID2_SSE41	0x00080000
-#define	CPUID2_SSE42	0x00100000
-#define	CPUID2_X2APIC	0x00200000
-#define	CPUID2_POPCNT	0x00800000
-#define	CPUID2_AESNI	0x02000000
-#define	CPUID2_RDRAND	0x40000000
-#define	CPUID2_VMM	0x80000000	/* AMD 25481 2.34 page 11 */
-
-/*
- * Important bits in the AMD extended cpuid flags
- */
-#define	AMDID_SYSCALL	0x00000800
-#define	AMDID_MP	0x00080000
-#define	AMDID_NX	0x00100000
-#define	AMDID_EXT_MMX	0x00400000
-#define	AMDID_FFXSR	0x01000000
-#define	AMDID_PAGE1GB	0x04000000
-#define	AMDID_RDTSCP	0x08000000
-#define	AMDID_LM	0x20000000
-#define	AMDID_EXT_3DNOW	0x40000000
-#define	AMDID_3DNOW	0x80000000
-
-#define	AMDID2_LAHF	0x00000001
-#define	AMDID2_CMP	0x00000002
-#define	AMDID2_SVM	0x00000004
-#define	AMDID2_EXT_APIC	0x00000008
-#define	AMDID2_CR8	0x00000010
-#define	AMDID2_ABM	0x00000020
-#define	AMDID2_SSE4A	0x00000040
-#define	AMDID2_MAS	0x00000080
-#define	AMDID2_PREFETCH	0x00000100
-#define	AMDID2_OSVW	0x00000200
-#define	AMDID2_IBS	0x00000400
-#define	AMDID2_SSE5	0x00000800
-#define	AMDID2_SKINIT	0x00001000
-#define	AMDID2_WDT	0x00002000
-
-/*
- * CPUID instruction 1 eax info
- */
-#define	CPUID_STEPPING		0x0000000f
-#define	CPUID_MODEL		0x000000f0
-#define	CPUID_FAMILY		0x00000f00
-#define	CPUID_EXT_MODEL		0x000f0000
-#define	CPUID_EXT_FAMILY	0x0ff00000
-#define	CPUID_TO_MODEL(id) \
-    ((((id) & CPUID_MODEL) >> 4) | \
-    ((((id) & CPUID_FAMILY) >= 0x600) ? \
-    (((id) & CPUID_EXT_MODEL) >> 12) : 0))
-#define	CPUID_TO_FAMILY(id) \
-    ((((id) & CPUID_FAMILY) >> 8) + \
-    ((((id) & CPUID_FAMILY) == 0xf00) ? \
-    (((id) & CPUID_EXT_FAMILY) >> 20) : 0))
-
-/*
- * CPUID instruction 1 ebx info
- */
-#define	CPUID_BRAND_INDEX	0x000000ff
-#define	CPUID_CLFUSH_SIZE	0x0000ff00
-#define	CPUID_HTT_CORES		0x00ff0000
-#define	CPUID_HTT_CORE_SHIFT	16
-#define	CPUID_LOCAL_APIC_ID	0xff000000
-
-/*
- * CPUID instruction 0xb ebx info.
- */
-#define	CPUID_TYPE_INVAL	0
-#define	CPUID_TYPE_SMT		1
-#define	CPUID_TYPE_CORE		2
-
-/*
- * INTEL Deterministic Cache Parameters
- * (Function 04h)
- */
-#define	FUNC_4_MAX_CORE_NO(eax)	((((eax) >> 26) & 0x3f))
-
-/*
- * INTEL x2APIC Features / Processor topology
- * (Function 0Bh) 
- */
-#define	FUNC_B_THREAD_LEVEL	0
-
-#define	FUNC_B_INVALID_TYPE	0
-#define	FUNC_B_THREAD_TYPE	1
-#define	FUNC_B_CORE_TYPE	2
-
-#define	FUNC_B_TYPE(ecx)	(((ecx) >> 8) & 0xff)
-#define	FUNC_B_BITS_SHIFT_NEXT_LEVEL(eax)	((eax) & 0x1f)
-#define	FUNC_B_LEVEL_MAX_SIBLINGS(ebx)	((ebx) & 0xffff)
-
-/*
- * Thermal and PM Features
- */
-#define CPUID_THERMAL2_SETBH	0x00000008
-
-/*
- * AMD extended function 8000_0007h edx info
- */
-#define	AMDPM_TS		0x00000001
-#define	AMDPM_FID		0x00000002
-#define	AMDPM_VID		0x00000004
-#define	AMDPM_TTP		0x00000008
-#define	AMDPM_TM		0x00000010
-#define	AMDPM_STC		0x00000020
-#define	AMDPM_100MHZ_STEPS	0x00000040
-#define	AMDPM_HW_PSTATE		0x00000080
-#define	AMDPM_TSC_INVARIANT	0x00000100
-
-/*
- * AMD extended function 8000_0008h ecx info
- */
-#define	AMDID_CMP_CORES		0x000000ff
-#define	AMDID_COREID_SIZE	0x0000f000
-#define	AMDID_COREID_SIZE_SHIFT	12
-
-/*
- * CPUID manufacturers identifiers
- */
-#define	AMD_VENDOR_ID		"AuthenticAMD"
-#define	CENTAUR_VENDOR_ID	"CentaurHauls"
-#define	INTEL_VENDOR_ID		"GenuineIntel"
-#define	NEXGEN_VENDOR_ID	"NexGenDriven"
-#define	NSC_VENDOR_ID		"Geode by NSC"
-#define	RISE_VENDOR_ID		"RiseRiseRise"
-#define	SIS_VENDOR_ID		"SiS SiS SiS "
-#define	TRANSMETA_VENDOR_ID	"GenuineTMx86"
-#define	UMC_VENDOR_ID		"UMC UMC UMC "
-
-/*
- * Model-specific registers for the i386 family
- */
-#define	MSR_P5_MC_ADDR		0x000
-#define	MSR_P5_MC_TYPE		0x001
-#define	MSR_TSC			0x010
-#define	MSR_P5_CESR		0x011
-#define	MSR_P5_CTR0		0x012
-#define	MSR_P5_CTR1		0x013
-#define	MSR_IA32_PLATFORM_ID	0x017
-#define	MSR_APICBASE		0x01b
-#define	MSR_EBL_CR_POWERON	0x02a
-#define	MSR_TEST_CTL		0x033
-#define	MSR_BIOS_UPDT_TRIG	0x079
-#define	MSR_BBL_CR_D0		0x088
-#define	MSR_BBL_CR_D1		0x089
-#define	MSR_BBL_CR_D2		0x08a
-#define	MSR_BIOS_SIGN		0x08b
-#define	MSR_PERFCTR0		0x0c1
-#define	MSR_PERFCTR1		0x0c2
-#define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
-#define	MSR_MTRRcap		0x0fe
-#define	MSR_BBL_CR_ADDR		0x116
-#define	MSR_BBL_CR_DECC		0x118
-#define	MSR_BBL_CR_CTL		0x119
-#define	MSR_BBL_CR_TRIG		0x11a
-#define	MSR_BBL_CR_BUSY		0x11b
-#define	MSR_BBL_CR_CTL3		0x11e
-#define	MSR_SYSENTER_CS_MSR	0x174
-#define	MSR_SYSENTER_ESP_MSR	0x175
-#define	MSR_SYSENTER_EIP_MSR	0x176
-#define	MSR_MCG_CAP		0x179
-#define	MSR_MCG_STATUS		0x17a
-#define	MSR_MCG_CTL		0x17b
-#define	MSR_EVNTSEL0		0x186
-#define	MSR_EVNTSEL1		0x187
-#define	MSR_THERM_CONTROL	0x19a
-#define	MSR_THERM_INTERRUPT	0x19b
-#define	MSR_THERM_STATUS	0x19c
-#define	MSR_IA32_MISC_ENABLE	0x1a0
-#define	MSR_IA32_TEMPERATURE_TARGET	0x1a2
-#define	MSR_PKG_THERM_STATUS	0x1b1
-#define	MSR_PKG_THERM_INTR	0x1b2
-#define	MSR_DEBUGCTLMSR		0x1d9
-#define	MSR_LASTBRANCHFROMIP	0x1db
-#define	MSR_LASTBRANCHTOIP	0x1dc
-#define	MSR_LASTINTFROMIP	0x1dd
-#define	MSR_LASTINTTOIP		0x1de
-#define	MSR_ROB_CR_BKUPTMPDR6	0x1e0
-#define	MSR_MTRRVarBase		0x200
-#define	MSR_MTRR64kBase		0x250
-#define	MSR_MTRR16kBase		0x258
-#define	MSR_MTRR4kBase		0x268
-#define	MSR_PAT			0x277
-#define	MSR_MTRRdefType		0x2ff
-#define	MSR_MC0_CTL		0x400
-#define	MSR_MC0_STATUS		0x401
-#define	MSR_MC0_ADDR		0x402
-#define	MSR_MC0_MISC		0x403
-#define	MSR_MC1_CTL		0x404
-#define	MSR_MC1_STATUS		0x405
-#define	MSR_MC1_ADDR		0x406
-#define	MSR_MC1_MISC		0x407
-#define	MSR_MC2_CTL		0x408
-#define	MSR_MC2_STATUS		0x409
-#define	MSR_MC2_ADDR		0x40a
-#define	MSR_MC2_MISC		0x40b
-#define	MSR_MC3_CTL		0x40c
-#define	MSR_MC3_STATUS		0x40d
-#define	MSR_MC3_ADDR		0x40e
-#define	MSR_MC3_MISC		0x40f
-#define	MSR_MC4_CTL		0x410
-#define	MSR_MC4_STATUS		0x411
-#define	MSR_MC4_ADDR		0x412
-#define	MSR_MC4_MISC		0x413
-
-/*
- * Constants related to MSR's.
- */
-#define	APICBASE_RESERVED	0x000006ff
-#define	APICBASE_BSP		0x00000100
-#define	APICBASE_ENABLED	0x00000800
-#define	APICBASE_ADDRESS	0xfffff000
-
-/*
- * PAT modes.
- */
-#define	PAT_UNCACHEABLE		0x00
-#define	PAT_WRITE_COMBINING	0x01
-#define	PAT_WRITE_THROUGH	0x04
-#define	PAT_WRITE_PROTECTED	0x05
-#define	PAT_WRITE_BACK		0x06
-#define	PAT_UNCACHED		0x07
-#define	PAT_VALUE(i, m)		((long long)(m) << (8 * (i)))
-#define	PAT_MASK(i)		PAT_VALUE(i, 0xff)
-
-/*
- * Constants related to MTRRs
- */
-#define	MTRR_UNCACHEABLE	0x00
-#define	MTRR_WRITE_COMBINING	0x01
-#define	MTRR_WRITE_THROUGH	0x04
-#define	MTRR_WRITE_PROTECTED	0x05
-#define	MTRR_WRITE_BACK		0x06
-#define	MTRR_N64K		8	/* numbers of fixed-size entries */
-#define	MTRR_N16K		16
-#define	MTRR_N4K		64
-#define	MTRR_CAP_WC		0x0000000000000400ULL
-#define	MTRR_CAP_FIXED		0x0000000000000100ULL
-#define	MTRR_CAP_VCNT		0x00000000000000ffULL
-#define	MTRR_DEF_ENABLE		0x0000000000000800ULL
-#define	MTRR_DEF_FIXED_ENABLE	0x0000000000000400ULL
-#define	MTRR_DEF_TYPE		0x00000000000000ffULL
-#define	MTRR_PHYSBASE_PHYSBASE	0x000ffffffffff000ULL
-#define	MTRR_PHYSBASE_TYPE	0x00000000000000ffULL
-#define	MTRR_PHYSMASK_PHYSMASK	0x000ffffffffff000ULL
-#define	MTRR_PHYSMASK_VALID	0x0000000000000800ULL
-
-/*
- * Machine Check register constants.
- */
-#define	MCG_CAP_COUNT		0x000000ff
-#define	MCG_CAP_CTL_P		0x00000100
-#define	MCG_CAP_EXT_P		0x00000200
-#define	MCG_CAP_TES_P		0x00000800
-#define	MCG_CAP_EXT_CNT		0x00ff0000
-#define	MCG_STATUS_RIPV		0x00000001
-#define	MCG_STATUS_EIPV		0x00000002
-#define	MCG_STATUS_MCIP		0x00000004
-#define	MCG_CTL_ENABLE		0xffffffffffffffffUL
-#define	MCG_CTL_DISABLE		0x0000000000000000UL
-#define	MSR_MC_CTL(x)		(MSR_MC0_CTL + (x) * 4)
-#define	MSR_MC_STATUS(x)	(MSR_MC0_STATUS + (x) * 4)
-#define	MSR_MC_ADDR(x)		(MSR_MC0_ADDR + (x) * 4)
-#define	MSR_MC_MISC(x)		(MSR_MC0_MISC + (x) * 4)
-#define	MC_STATUS_MCA_ERROR	0x000000000000ffffUL
-#define	MC_STATUS_MODEL_ERROR	0x00000000ffff0000UL
-#define	MC_STATUS_OTHER_INFO	0x01ffffff00000000UL
-#define	MC_STATUS_PCC		0x0200000000000000UL
-#define	MC_STATUS_ADDRV		0x0400000000000000UL
-#define	MC_STATUS_MISCV		0x0800000000000000UL
-#define	MC_STATUS_EN		0x1000000000000000UL
-#define	MC_STATUS_UC		0x2000000000000000UL
-#define	MC_STATUS_OVER		0x4000000000000000UL
-#define	MC_STATUS_VAL		0x8000000000000000UL
-
-/*
- * The following four 3-byte registers control the non-cacheable regions.
- * These registers must be written as three separate bytes.
- *
- * NCRx+0: A31-A24 of starting address
- * NCRx+1: A23-A16 of starting address
- * NCRx+2: A15-A12 of starting address | NCR_SIZE_xx.
- *
- * The non-cacheable region's starting address must be aligned to the
- * size indicated by the NCR_SIZE_xx field.
- */
-#define	NCR1	0xc4
-#define	NCR2	0xc7
-#define	NCR3	0xca
-#define	NCR4	0xcd
-
-#define	NCR_SIZE_0K	0
-#define	NCR_SIZE_4K	1
-#define	NCR_SIZE_8K	2
-#define	NCR_SIZE_16K	3
-#define	NCR_SIZE_32K	4
-#define	NCR_SIZE_64K	5
-#define	NCR_SIZE_128K	6
-#define	NCR_SIZE_256K	7
-#define	NCR_SIZE_512K	8
-#define	NCR_SIZE_1M	9
-#define	NCR_SIZE_2M	10
-#define	NCR_SIZE_4M	11
-#define	NCR_SIZE_8M	12
-#define	NCR_SIZE_16M	13
-#define	NCR_SIZE_32M	14
-#define	NCR_SIZE_4G	15
-
-/*
- * The address region registers are used to specify the location and
- * size for the eight address regions.
- *
- * ARRx + 0: A31-A24 of start address
- * ARRx + 1: A23-A16 of start address
- * ARRx + 2: A15-A12 of start address | ARR_SIZE_xx
- */
-#define	ARR0	0xc4
-#define	ARR1	0xc7
-#define	ARR2	0xca
-#define	ARR3	0xcd
-#define	ARR4	0xd0
-#define	ARR5	0xd3
-#define	ARR6	0xd6
-#define	ARR7	0xd9
-
-#define	ARR_SIZE_0K		0
-#define	ARR_SIZE_4K		1
-#define	ARR_SIZE_8K		2
-#define	ARR_SIZE_16K	3
-#define	ARR_SIZE_32K	4
-#define	ARR_SIZE_64K	5
-#define	ARR_SIZE_128K	6
-#define	ARR_SIZE_256K	7
-#define	ARR_SIZE_512K	8
-#define	ARR_SIZE_1M		9
-#define	ARR_SIZE_2M		10
-#define	ARR_SIZE_4M		11
-#define	ARR_SIZE_8M		12
-#define	ARR_SIZE_16M	13
-#define	ARR_SIZE_32M	14
-#define	ARR_SIZE_4G		15
-
-/*
- * The region control registers specify the attributes associated with
- * the ARRx addres regions.
- */
-#define	RCR0	0xdc
-#define	RCR1	0xdd
-#define	RCR2	0xde
-#define	RCR3	0xdf
-#define	RCR4	0xe0
-#define	RCR5	0xe1
-#define	RCR6	0xe2
-#define	RCR7	0xe3
-
-#define	RCR_RCD	0x01	/* Disables caching for ARRx (x = 0-6). */
-#define	RCR_RCE	0x01	/* Enables caching for ARR7. */
-#define	RCR_WWO	0x02	/* Weak write ordering. */
-#define	RCR_WL	0x04	/* Weak locking. */
-#define	RCR_WG	0x08	/* Write gathering. */
-#define	RCR_WT	0x10	/* Write-through. */
-#define	RCR_NLB	0x20	/* LBA# pin is not asserted. */
-
-/* AMD Write Allocate Top-Of-Memory and Control Register */
-#define	AMD_WT_ALLOC_TME	0x40000	/* top-of-memory enable */
-#define	AMD_WT_ALLOC_PRE	0x20000	/* programmable range enable */
-#define	AMD_WT_ALLOC_FRE	0x10000	/* fixed (A0000-FFFFF) range enable */
-
-/* AMD64 MSR's */
-#define	MSR_EFER	0xc0000080	/* extended features */
-#define	MSR_K8_UCODE_UPDATE	0xc0010020	/* update microcode */
-
-/* AMD MSRs */
-#define MSR_AMD_DE_CFG  0xc0011029
-
-/* VIA ACE crypto featureset: for via_feature_rng */
-#define	VIA_HAS_RNG		1	/* cpu has RNG */
-
-/* VIA ACE crypto featureset: for via_feature_xcrypt */
-#define	VIA_HAS_AES		1	/* cpu has AES */
-#define	VIA_HAS_SHA		2	/* cpu has SHA1 & SHA256 */
-#define	VIA_HAS_MM		4	/* cpu has RSA instructions */
-#define	VIA_HAS_AESCTR		8	/* cpu has AES-CTR instructions */
-
-/* Centaur Extended Feature flags */
-#define	VIA_CPUID_HAS_RNG	0x000004
-#define	VIA_CPUID_DO_RNG	0x000008
-#define	VIA_CPUID_HAS_ACE	0x000040
-#define	VIA_CPUID_DO_ACE	0x000080
-#define	VIA_CPUID_HAS_ACE2	0x000100
-#define	VIA_CPUID_DO_ACE2	0x000200
-#define	VIA_CPUID_HAS_PHE	0x000400
-#define	VIA_CPUID_DO_PHE	0x000800
-#define	VIA_CPUID_HAS_PMM	0x001000
-#define	VIA_CPUID_DO_PMM	0x002000
-
-/* VIA ACE xcrypt-* instruction context control options */
-#define	VIA_CRYPT_CWLO_ROUND_M		0x0000000f
-#define	VIA_CRYPT_CWLO_ALG_M		0x00000070
-#define	VIA_CRYPT_CWLO_ALG_AES		0x00000000
-#define	VIA_CRYPT_CWLO_KEYGEN_M		0x00000080
-#define	VIA_CRYPT_CWLO_KEYGEN_HW	0x00000000
-#define	VIA_CRYPT_CWLO_KEYGEN_SW	0x00000080
-#define	VIA_CRYPT_CWLO_NORMAL		0x00000000
-#define	VIA_CRYPT_CWLO_INTERMEDIATE	0x00000100
-#define	VIA_CRYPT_CWLO_ENCRYPT		0x00000000
-#define	VIA_CRYPT_CWLO_DECRYPT		0x00000200
-#define	VIA_CRYPT_CWLO_KEY128		0x0000000a	/* 128bit, 10 rds */
-#define	VIA_CRYPT_CWLO_KEY192		0x0000040c	/* 192bit, 12 rds */
-#define	VIA_CRYPT_CWLO_KEY256		0x0000080e	/* 256bit, 15 rds */
-
-#endif /* !_CPU_SPECIALREG_H_ */
diff --git a/sys/cpu/i386/include/stdarg.h b/sys/cpu/i386/include/stdarg.h
deleted file mode 100644
index 8d4ed7d..0000000
--- a/sys/cpu/i386/include/stdarg.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)stdarg.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/i386/include/stdarg.h,v 1.10 1999/08/28 00:44:26 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/stdarg.h,v 1.8 2008/01/13 18:02:20 corecode Exp $
- */
-
-#ifndef _CPU_STDARG_H_
-#define	_CPU_STDARG_H_
-
-/*
- * GNUC mess
- */
-#if defined(__GNUC__)
-typedef __builtin_va_list	__va_list;	/* internally known to gcc */
-#else
-typedef	char *			__va_list;
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list		__gnuc_va_list;	/* compatibility w/GNU headers*/
-#endif
-
-/*
- * Standard va types and macros
- */
-#define	__va_size(type) \
-	(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-
-#ifdef __GNUC__
-
-#define __va_start(ap, last) \
-	__builtin_va_start(ap, last)
-#define __va_arg(ap, type) \
-	__builtin_va_arg((ap), type)
-#define __va_copy(dest, src) \
-	__builtin_va_copy((dest), (src))
-#define __va_end(ap) \
-	__builtin_va_end(ap)
-
-#else /* !__GNUC__ */
-
-/* Provide a free-standing implementation */
-#define __va_start(ap, last) \
-	((ap) = (__va_list)&(last) + __va_size(last))
-#define __va_arg(ap, type) \
-	(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
-/* This assumes a typical stack machine */
-#define __va_copy(dest, src) \
-	((void)((dest) = (src)))
-#define __va_end(ap)
-
-#endif /* __GNUC__ */
-
-#endif /* !_CPU_STDARG_H_ */
diff --git a/sys/cpu/i386/include/stdint.h b/sys/cpu/i386/include/stdint.h
deleted file mode 100644
index 8b5cada..0000000
--- a/sys/cpu/i386/include/stdint.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-
- * Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
- * Copyright (c) 2001 The NetBSD Foundation, Inc.  All rights reserved.
- * Copyright (c) 1990, 1993 The Regents of the University of California. 
- *		All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $
- */
-
-#ifndef _CPU_STDINT_H_
-#define	_CPU_STDINT_H_
-
-/*
- * Basic types upon which most other types are built.
- */
-typedef	__signed char	__int8_t;
-typedef	unsigned char	__uint8_t;
-typedef	short		__int16_t;
-typedef	unsigned short	__uint16_t;
-typedef	int		__int32_t;
-typedef	unsigned int	__uint32_t;
-typedef int		__boolean_t;
-
-/*
- * This mess is to override compiler options that might restrict long long
- * and for lint which doesn't understand GNUC attributes.
- */
-#if defined(lint)
-typedef	long long		__int64_t;
-typedef	unsigned long long	__uint64_t;
-#elif defined(__GNUC__)
-typedef	int __attribute__((__mode__(__DI__)))		__int64_t;
-typedef	unsigned int __attribute__((__mode__(__DI__)))	__uint64_t;
-#else
-typedef	long long		__int64_t;
-typedef	unsigned long long	__uint64_t;
-#endif
-
-/*
- * Standard type definitions.
- */
-typedef	__int64_t	__intmax_t;
-typedef	__uint64_t	__uintmax_t;
-
-typedef	__int32_t	__intptr_t;
-typedef	__uint32_t	__uintptr_t;
-
-typedef	__int32_t	__ptrdiff_t;		/* ptr1 - ptr2 */
-
-typedef	__int32_t	__int_fast8_t;
-typedef	__int32_t	__int_fast16_t;
-typedef	__int32_t	__int_fast32_t;
-typedef	__int64_t	__int_fast64_t;
-typedef	__int8_t	__int_least8_t;
-typedef	__int16_t	__int_least16_t;
-typedef	__int32_t	__int_least32_t;
-typedef	__int64_t	__int_least64_t;
-typedef	__uint32_t	__uint_fast8_t;
-typedef	__uint32_t	__uint_fast16_t;
-typedef	__uint32_t	__uint_fast32_t;
-typedef	__uint64_t	__uint_fast64_t;
-typedef	__uint8_t	__uint_least8_t;
-typedef	__uint16_t	__uint_least16_t;
-typedef	__uint32_t	__uint_least32_t;
-typedef	__uint64_t	__uint_least64_t;
-
-/*
- * System types conveniently placed in this header file in order to put them
- * in proximity with the limit macros below and for convenient access by
- * other include files which need to pick and choose particular types but
- * do not wish to overly pollute their namespaces.
- */
-
-typedef __uint32_t	__size_t;
-typedef __int32_t	__ssize_t;
-typedef long		__time_t;
-typedef int		__timer_t;
-typedef __int32_t	__register_t;
-typedef __uint32_t	__u_register_t;
-typedef __int32_t	__sig_atomic_t;
-typedef unsigned long	__clock_t;
-typedef unsigned long	__clockid_t;
-typedef __uint32_t	__socklen_t;
-typedef volatile int	__atomic_intr_t;
-/*
- * Its convenient to put these here rather then create another header file.
- */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
-#define __offsetof(type, field) __builtin_offsetof(type, field)
-#else
-#ifndef __cplusplus
-#define __offsetof(type, field) ((__size_t)(&((type *)0)->field))
-#else
-#define __offsetof(type, field)					\
-	(__offsetof__ (reinterpret_cast <__size_t>		\
-		 (&reinterpret_cast <const volatile char &>	\
-		  (static_cast<type *> (0)->field))))
-#endif
-#endif
-
-#define __arysize(ary)         (sizeof(ary)/sizeof((ary)[0]))
-
-#endif /* _CPU_STDINT_H_ */
diff --git a/sys/cpu/i386/include/sysarch.h b/sys/cpu/i386/include/sysarch.h
deleted file mode 100644
index e2af4d1..0000000
--- a/sys/cpu/i386/include/sysarch.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/sysarch.h,v 1.13.2.2 2002/10/07 17:17:28 jhb Exp $
- * $DragonFly: src/sys/cpu/i386/include/sysarch.h,v 1.5 2006/11/07 17:51:21 dillon Exp $
- */
-
-/*
- * Architecture specific syscalls (i386)
- */
-#ifndef _CPU_SYSARCH_H_
-#define _CPU_SYSARCH_H_
-
-#define I386_GET_LDT	0
-#define I386_SET_LDT	1
-				/* I386_IOPL */
-#define I386_GET_IOPERM	3
-#define I386_SET_IOPERM	4
-				/* xxxxx */
-#define I386_VM86	6
-
-struct i386_ldt_args {
-	unsigned int start;
-	union	descriptor *descs;
-	unsigned int num;
-}; 
-
-struct i386_ioperm_args {
-	unsigned int start;
-	unsigned int length;
-	int	enable;
-};
-
-struct i386_vm86_args {
-	int	sub_op;			/* sub-operation to perform */
-	char	*sub_args;		/* args */
-};
-
-#ifndef _KERNEL
-#include <sys/cdefs.h>
-
-union descriptor;
-struct dbreg;
-
-__BEGIN_DECLS
-int i386_get_ldt (int, union descriptor *, int);
-int i386_set_ldt (int, union descriptor *, int);
-int i386_get_ioperm (unsigned int, unsigned int *, int *);
-int i386_set_ioperm (unsigned int, unsigned int, int);
-int i386_vm86 (int, void *);
-int i386_set_watch (int, unsigned int, int, int, struct dbreg *);
-int i386_clr_watch (int, struct dbreg *);
-int sysarch(int, void *);
-__END_DECLS
-#endif
-
-#endif /* !_CPU_SYSARCH_H_ */
diff --git a/sys/cpu/i386/include/tls.h b/sys/cpu/i386/include/tls.h
deleted file mode 100644
index b4b1ce4..0000000
--- a/sys/cpu/i386/include/tls.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * 
- * $DragonFly: src/sys/cpu/i386/include/tls.h,v 1.12 2007/04/13 12:12:27 corecode Exp $
- */
-
-#ifndef	_CPU_TLS_H_
-#define	_CPU_TLS_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-#ifndef _SYS_TLS_H_
-#include <sys/tls.h>
-#endif
-
-/*
- * NOTE: the tcb_{self,dtv,pthread,errno) fields must be declared
- * in the structure in the specified order as assembly will access the
- * fields with a hardwired offset.
- *
- * Outside of this file, the system call layer generation will hardwire
- * the offset for tcb_errno.
- */
-struct tls_tcb {
-	struct tls_tcb *tcb_self;	/* pointer to self*/
-	void *tcb_dtv;			/* Dynamic Thread Vector */
-	void *tcb_pthread;		/* thread library's data*/
-	int *tcb_errno_p;		/* pointer to per-thread errno */
-	void *tcb_segstack;		/* used for segmented stacks */
-					/* e.g. by LLVM to store stack bound. */
-					/* NOTE: do not reorder this field */
-					/* as LLVM uses a fixed offset (16) */
-	void *tcb_unused[3];
-};
-
-struct tls_dtv {
-	uintptr_t dtv_generation;
-	uintptr_t dtv_max_index;
-	void *dtv_offset[__ARRAY_ZERO];
-};
-
-#define	RTLD_TCB_HAS_SELF_POINTER
-#define	RTLD_STATIC_TLS_ALIGN           16
-#define	RTLD_STATIC_TLS_ALIGN_MASK      (RTLD_STATIC_TLS_ALIGN - 1)
-#define	RTLD_STATIC_TLS_EXTRA		640
-#define RTLD_STATIC_TLS_VARIANT_II
-
-/* Get the current TCB. */
-static __inline struct tls_tcb *
-tls_get_tcb(void)
-{
-	void *self;
-
-	__asm __volatile ("movl %%gs:%1, %0"
-	    : "=r" (self)
-	    : "m" (((struct tls_tcb *)0)->tcb_self));
-
-	return(self);
-}
-
-/* Get the current thread. */
-static __inline void *
-tls_get_curthread(void)
-{
-	void *self;
-
-	__asm __volatile ("movl %%gs:%1, %0"
-	    : "=r" (self)
-	    : "m" (((struct tls_tcb *)0)->tcb_pthread));
-
-	return(self);
-}
-
-static __inline void
-tls_set_tcb(struct tls_tcb *tcb)
-{
-	struct tls_info info;
-	int seg;
-
-	info.base = tcb;
-	info.size = -1;
-	seg = set_tls_area(0, &info, sizeof(info));
-	__asm __volatile("mov %0, %%gs" : : "g" (seg));
-}
-
-static __inline void
-tls_set_gs(void *base, size_t bytes)
-{
-	struct tls_info info;
-	int seg;
-
-	info.base = base;
-	info.size = bytes;
-	seg = set_tls_area(0, &info, sizeof(info));
-	__asm __volatile("mov %0, %%gs" : : "g" (seg));
-}
-
-static __inline void
-tls_set_fs(void *base, size_t bytes)
-{
-	struct tls_info info;
-	int seg;
-
-	info.base = base;
-	info.size = bytes;
-	seg = set_tls_area(1, &info, sizeof(info));
-	__asm __volatile("mov %0, %%fs" : : "g" (seg));
-}
-
-#ifndef _KERNEL
-
-struct tls_tcb	*_rtld_allocate_tls(void);
-struct tls_tcb	*_libc_allocate_tls(void);
-void		 _rtld_free_tls(struct tls_tcb *);
-void		 _libc_free_tls(struct tls_tcb *);
-void		 _rtld_call_init(void);
-struct tls_tcb	*_libc_init_tls(void);
-struct tls_tcb	*_init_tls(void);
-
-#endif
-
-#endif	/* !_CPU_TLS_H_ */
diff --git a/sys/cpu/i386/include/trap.h b/sys/cpu/i386/include/trap.h
deleted file mode 100644
index 26bab8c..0000000
--- a/sys/cpu/i386/include/trap.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)trap.h	5.4 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/include/trap.h,v 1.10.2.2 2001/08/15 01:23:52 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/trap.h,v 1.4 2007/01/07 08:37:33 dillon Exp $
- */
-
-#ifndef _CPU_TRAP_H_
-#define	_CPU_TRAP_H_
-
-/*
- * Trap type values
- * also known in trap.c for name strings
- */
-
-#define	T_PRIVINFLT	1	/* privileged instruction */
-#define	T_BPTFLT	3	/* breakpoint instruction */
-#define	T_ARITHTRAP	6	/* arithmetic trap */
-#define	T_ASTFLT	7	/* system forced exception */
-#define	T_PROTFLT	9	/* protection fault */
-#define	T_TRCTRAP	10	/* debug exception (sic) */
-#define	T_PAGEFLT	12	/* page fault */
-#define	T_ALIGNFLT	14	/* alignment fault */
-
-#define	T_DIVIDE	18	/* integer divide fault */
-#define	T_NMI		19	/* non-maskable trap */
-#define	T_OFLOW		20	/* overflow trap */
-#define	T_BOUND		21	/* bound instruction fault */
-#define	T_DNA		22	/* device not available fault */
-#define	T_DOUBLEFLT	23	/* double fault */
-#define	T_FPOPFLT	24	/* fp coprocessor operand fetch fault */
-#define	T_TSSFLT	25	/* invalid tss fault */
-#define	T_SEGNPFLT	26	/* segment not present fault */
-#define	T_STKFLT	27	/* stack fault */
-#define	T_MCHK		28	/* machine check trap */
-#define	T_XMMFLT	29	/* SIMD floating-point exception */
-#define	T_RESERVED	30	/* reserved (unknown) */
-
-/* XXX most of the following codes aren't used, but could be. */
-
-/* definitions for <sys/signal.h> */
-#define	    ILL_RESAD_FAULT	T_RESADFLT
-#define	    ILL_PRIVIN_FAULT	T_PRIVINFLT
-#define	    ILL_RESOP_FAULT	T_RESOPFLT
-#define	    ILL_ALIGN_FAULT	T_ALIGNFLT
-#define	    ILL_FPOP_FAULT	T_FPOPFLT	/* coprocessor operand fault */
-
-/* old FreeBSD macros, deprecated */
-#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
-#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
-#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal divide by zero */
-#define	FPE_FLTOVF_TRAP	0x4	/* floating overflow */
-#define	FPE_FLTUND_TRAP	0x5	/* floating underflow */
-#define	FPE_FPU_NP_TRAP	0x6	/* floating point unit not present  */
-#define	FPE_SUBRNG_TRAP	0x7	/* subrange out of bounds */
-
-/* codes for SIGBUS */
-#define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault protection base */
-#define	    BUS_SEGNP_FAULT	T_SEGNPFLT	/* segment not present */
-#define	    BUS_STK_FAULT	T_STKFLT	/* stack segment */
-#define	    BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */
-
-/* Trap's coming from user mode */
-#define T_SYSCALL80		0x080
-#define	T_USER			0x100
-
-#endif /* !_CPU_TRAP_H_ */
diff --git a/sys/cpu/i386/include/tss.h b/sys/cpu/i386/include/tss.h
deleted file mode 100644
index be4f5a9..0000000
--- a/sys/cpu/i386/include/tss.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)tss.h	5.4 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/i386/include/tss.h,v 1.11 1999/12/29 04:33:09 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/tss.h,v 1.5 2006/11/07 06:43:22 dillon Exp $
- */
-
-#ifndef _CPU_TSS_H_
-#define _CPU_TSS_H_
-
-/*
- * Intel 386 Context Data Type
- */
-
-struct i386tss {
-	int	tss_link;	/* actually 16 bits: top 16 bits must be zero */
-	int	tss_esp0; 	/* kernel stack pointer privilege level 0 */
-#define	tss_ksp	tss_esp0
-	int	tss_ss0;	/* actually 16 bits: top 16 bits must be zero */
-	int	tss_esp1; 	/* kernel stack pointer privilege level 1 */
-	int	tss_ss1;	/* actually 16 bits: top 16 bits must be zero */
-	int	tss_esp2; 	/* kernel stack pointer privilege level 2 */
-	int	tss_ss2;	/* actually 16 bits: top 16 bits must be zero */
-	int	tss_cr3; 	/* page table directory */
-#define	tss_ptd	tss_cr3
-	int	tss_eip; 	/* program counter */
-#define	tss_pc	tss_eip
-	int	tss_eflags; 	/* program status longword */
-#define	tss_psl	tss_eflags
-	int	tss_eax;
-	int	tss_ecx;
-	int	tss_edx;
-	int	tss_ebx;
-	int	tss_esp; 	/* user stack pointer */
-#define	tss_usp	tss_esp
-	int	tss_ebp; 	/* user frame pointer */
-#define	tss_fp	tss_ebp
-	int	tss_esi;
-	int	tss_edi;
-	int	tss_es;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_cs;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_ss;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_ds;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_fs;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_gs;		/* actually 16 bits: top 16 bits must be zero */
-	int	tss_ldt;	/* actually 16 bits: top 16 bits must be zero */
-	int	tss_ioopt;	/* options & io offset bitmap: currently zero */
-				/* XXX unimplemented .. i/o permission bitmap */
-};
-
-#endif /* _CPU_TSS_H_ */
-
diff --git a/sys/cpu/i386/include/types.h b/sys/cpu/i386/include/types.h
deleted file mode 100644
index 1240852..0000000
--- a/sys/cpu/i386/include/types.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h	8.3 (Berkeley) 1/5/94
- * $FreeBSD: src/sys/i386/include/types.h,v 1.19.2.1 2001/03/21 10:50:58 peter Exp $
- */
-
-#ifndef _CPU_TYPES_H_
-#define	_CPU_TYPES_H_
-
-#include <machine/stdint.h>
-
-typedef	unsigned long	vm_offset_t;	/* address space bounded offset */
-typedef	unsigned long	vm_size_t;	/* address space bounded size */
-typedef	__int64_t	vm_ooffset_t;	/* VM object bounded offset */
-typedef	__uint64_t	vm_pindex_t;	/* physical page index */
-typedef __uint64_t	vm_poff_t;	/* physical offset */
-typedef __uint64_t	vm_paddr_t;	/* physical addr (same as vm_poff_t) */
-
-typedef	__int32_t	__segsz_t;	/* segment size */
-
-typedef	__int32_t	register_t;
-typedef	__uint32_t	u_register_t;
-
-#ifdef _KERNEL
-typedef	int		intfptr_t;
-typedef	unsigned int	uintfptr_t;
-#endif
-
-/*
- * MMU page tables
- */
-typedef __uint32_t	pd_entry_t;
-typedef __uint32_t	pt_entry_t;
-typedef __uint32_t	cpumask_t;	/* mask representing a set of cpus */
-typedef __uint32_t	cpulock_t;	/* count and exclusive lock */
-
-#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
-
-/*
- * NOTE! CPUMASK_TESTMASK() - caller should only test == 0 or != 0
- */
-
-#define CPUMASK_INITIALIZER_ALLONES	(cpumask_t)-1
-#define CPUMASK_INITIALIZER_ONLYONE	(cpumask_t)1
-
-#define CPUMASK_SIMPLE(cpu)	(1U << (cpu))
-#define BSRCPUMASK(mask)	bsrl(mask)
-#define BSFCPUMASK(mask)	bsfl(mask)
-
-#define CPUMASK_CMPMASKEQ(mask1, mask2)	((mask1) == (mask2))
-#define CPUMASK_CMPMASKNEQ(mask1, mask2) ((mask1) != (mask2))
-#define CPUMASK_ISUP(mask)		 ((mask) == 1)
-
-#define CPUMASK_TESTZERO(mask)		((mask) == 0)
-#define CPUMASK_TESTNZERO(mask)		((mask) != 0)
-#define CPUMASK_TESTBIT(mask, i)	((mask) & CPUMASK_SIMPLE(i))
-#define CPUMASK_TESTMASK(mask1, mask2)	((mask1) & (mask2))
-#define CPUMASK_LOWMASK(mask)		(mask)
-
-#define CPUMASK_ORBIT(mask, i)		mask |= CPUMASK_SIMPLE(i)
-#define CPUMASK_ANDBIT(mask, i)         mask &= CPUMASK_SIMPLE(i)
-#define CPUMASK_NANDBIT(mask, i)        mask &= ~CPUMASK_SIMPLE(i)
-
-#define CPUMASK_ASSZERO(mask)		mask = 0
-#define CPUMASK_ASSALLONES(mask)	mask = (cpumask_t)-1
-#define CPUMASK_ASSBIT(mask, i)		mask = CPUMASK_SIMPLE(i)
-#define CPUMASK_ASSBMASK(mask, i)	mask = (CPUMASK_SIMPLE(i) - 1)
-#define CPUMASK_ASSNBMASK(mask, i)	mask = ~(CPUMASK_SIMPLE(i) - 1)
-
-#define CPUMASK_ANDMASK(mask, m1)	mask &= (m1)
-#define CPUMASK_NANDMASK(mask, m1)	mask &= ~(m1)
-#define CPUMASK_ORMASK(mask, m1)	mask |= (m1)
-
-#define ATOMIC_CPUMASK_ORBIT(mask, i)		\
-			atomic_set_cpumask(&(mask), CPUMASK_SIMPLE(i))
-#define ATOMIC_CPUMASK_NANDBIT(mask, i)		\
-			atomic_clear_cpumask(&(mask), CPUMASK_SIMPLE(i))
-#define ATOMIC_CPUMASK_ORMASK(mask, m1)	\
-			atomic_set_cpumask(&(mask), m1)
-#define ATOMIC_CPUMASK_NANDMASK(mask, m1)	\
-			atomic_clear_cpumask(&(mask), m1)
-
-#endif
-
-#define CPULOCK_EXCLBIT	0		/* exclusive lock bit number */
-#define CPULOCK_EXCL	0x00000001	/* exclusive lock */
-#define CPULOCK_INCR	0x00000002	/* auxillary counter add/sub */
-#define CPULOCK_CNTMASK	0x7FFFFFFE
-
-#define PDESIZE         sizeof(pd_entry_t) /* for assembly files */
-#define PTESIZE         sizeof(pt_entry_t) /* for assembly files */
-
-#endif /* !_CPU_TYPES_H_ */
-
diff --git a/sys/cpu/i386/include/ucontext.h b/sys/cpu/i386/include/ucontext.h
deleted file mode 100644
index 46f0887..0000000
--- a/sys/cpu/i386/include/ucontext.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * Copyright (c) 1999 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer 
- *    in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/ucontext.h,v 1.4 1999/10/11 20:33:09 luoqi Exp $
- * $DragonFly: src/sys/cpu/i386/include/ucontext.h,v 1.5 2007/01/13 21:15:55 dillon Exp $
- */
-
-#ifndef _CPU_UCONTEXT_H_
-#define	_CPU_UCONTEXT_H_
-
-typedef struct __mcontext {
-	/*
-	 * The first 20 fields must match the definition of
-	 * sigcontext. So that we can support sigcontext
-	 * and ucontext_t at the same time.
-	 */
-	int	mc_onstack;		/* XXX - sigcontext compat. */
-	int	mc_gs;
-	int	mc_fs;
-	int	mc_es;
-	int	mc_ds;
-	int	mc_edi;
-	int	mc_esi;
-	int	mc_ebp;
-	int	mc_isp;
-	int	mc_ebx;
-	int	mc_edx;
-	int	mc_ecx;
-	int	mc_eax;
-	int	mc_xflags;
-	int	mc_trapno;
-	int	mc_err;
-	int	mc_eip;
-	int	mc_cs;
-	int	mc_eflags;
-	int	mc_esp;			/* machine state */
-	int	mc_ss;
-
-	int	mc_len;
-	int	mc_fpformat;
-	int	mc_ownedfp;
-
-	/* 16 byte aligned */
-
-	int	mc_fpregs[128];		/* full fp state */
-	int	__spare__[16];
-} mcontext_t;
-
-#define _MC_FPFMT_NODEV		0x10000 /* device not present or configured */
-#define _MC_FPFMT_387		0x10001
-#define _MC_FPFMT_XMM		0x10002
-
-#define _MC_FPOWNED_NONE	0x20000 /* FP state not used */
-#define _MC_FPOWNED_FPU		0x20001 /* FP state came from FPU */
-#define _MC_FPOWNED_PCB		0x20002 /* FP state came from PCB */
-
-#endif /* !_CPU_UCONTEXT_H_ */
diff --git a/sys/cpu/i386/include/varargs.h b/sys/cpu/i386/include/varargs.h
deleted file mode 100644
index 6258ec7..0000000
--- a/sys/cpu/i386/include/varargs.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)varargs.h	8.2 (Berkeley) 3/22/94
- * $FreeBSD: src/sys/i386/include/varargs.h,v 1.8 1999/08/28 00:44:27 peter Exp $
- * $DragonFly: src/sys/cpu/i386/include/varargs.h,v 1.4 2006/11/07 17:51:21 dillon Exp $
- */
-
-#ifndef _CPU_VARARGS_H_
-#define	_CPU_VARARGS_H_
-
-typedef char *va_list;
-
-#define	__va_size(type) \
-	(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-
-#ifdef __GNUC__
-#define	va_alist	__builtin_va_alist
-#define	va_dcl	int va_alist; ...
-#else
-#define	va_dcl	int va_alist;
-#endif
-
-#define	va_start(ap) \
-	((ap) = (va_list)&va_alist)
-
-#define	va_arg(ap, type) \
-	(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
-
-#define	va_end(ap)
-
-#endif /* !_CPU_VARARGS_H_ */
diff --git a/sys/cpu/i386/include/vframe.h b/sys/cpu/i386/include/vframe.h
deleted file mode 100644
index 13f9023..0000000
--- a/sys/cpu/i386/include/vframe.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2006 The DragonFly Project.  All rights reserved.
- * 
- * This code is derived from software contributed to The DragonFly Project
- * by Matthew Dillon <dillon@backplane.com>
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CPU_VFRAME_H_
-#define _CPU_VFRAME_H_
-
-#include <machine/npx.h>
-#include <machine/segments.h>
-
-/*
- * Virtualized external frame.  This is used by the virtual kernel in
- * addition to trapframe.
- */
-struct vextframe {
-	struct savetls vx_tls;
-};
-
-#endif
-
diff --git a/sys/cpu/i386/include/vm86.h b/sys/cpu/i386/include/vm86.h
deleted file mode 100644
index a15f186..0000000
--- a/sys/cpu/i386/include/vm86.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*-
- * Copyright (c) 1997 Jonathan Lemon
- * All rights reserved.
- *
- * Derived from register.h, which is
- *     Copyright (c) 1996 Michael Smith.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/include/vm86.h,v 1.13 1999/09/02 20:59:50 luoqi Exp $
- * $DragonFly: src/sys/cpu/i386/include/vm86.h,v 1.9 2007/01/08 03:33:37 dillon Exp $
- */
-
-#ifndef _CPU_VM86_H_
-#define _CPU_VM86_H_
-
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
-#endif
-
-/* standard register representation */
-typedef union {
-	u_int	r_ex;
-	struct {
-		u_short	r_x;
-		u_int	:16;
-	} r_w;
-	struct {
-		u_char	r_l;
-		u_char	r_h;
-		u_int	:16;
-	} r_b;
-} reg86_t;
-
-/* layout must match definition of struct trapframe_vm86 in <machine/frame.h> */
-
-struct vm86frame {
-	int	kernel_gs;
-	int	kernel_fs;
-	int	kernel_es;
-	int	kernel_ds;
-	reg86_t	edi;
-	reg86_t	esi;
-	reg86_t	ebp;
-	reg86_t	isp;
-	reg86_t	ebx;
-	reg86_t	edx;
-	reg86_t	ecx;
-	reg86_t	eax;
-	int	vmf_xflags;
-	int	vmf_trapno;
-	int	vmf_err;
-	reg86_t	eip;
-	reg86_t	cs;
-	reg86_t	eflags;
-	reg86_t	esp;
-	reg86_t	ss;
-	reg86_t	es;
-	reg86_t	ds;
-	reg86_t	fs;
-	reg86_t	gs;
-#define vmf_ah		eax.r_b.r_h
-#define vmf_al		eax.r_b.r_l
-#define vmf_ax		eax.r_w.r_x
-#define vmf_eax		eax.r_ex
-#define vmf_bh		ebx.r_b.r_h
-#define vmf_bl		ebx.r_b.r_l
-#define vmf_bx		ebx.r_w.r_x
-#define vmf_ebx		ebx.r_ex
-#define vmf_ch		ecx.r_b.r_h
-#define vmf_cl		ecx.r_b.r_l
-#define vmf_cx		ecx.r_w.r_x
-#define vmf_ecx		ecx.r_ex
-#define vmf_dh		edx.r_b.r_h
-#define vmf_dl		edx.r_b.r_l
-#define vmf_dx		edx.r_w.r_x
-#define vmf_edx		edx.r_ex
-#define vmf_si		esi.r_w.r_x
-#define vmf_di		edi.r_w.r_x
-#define vmf_cs		cs.r_w.r_x
-#define vmf_ds		ds.r_w.r_x
-#define vmf_es		es.r_w.r_x
-#define vmf_ss		ss.r_w.r_x
-#define vmf_sp		esp.r_w.r_x
-#define vmf_ip		eip.r_w.r_x
-#define vmf_flags	eflags.r_w.r_x
-#define vmf_eflags	eflags.r_ex
-};
-
-#define VM86_PMAPSIZE	3
-#define VMAP_MALLOC	1	/* page was malloced by us */
-
-struct vm86context {
-	int	npages;
-	struct	vm86pmap {
-		int	flags;
-		int	pte_num;
-		vm_offset_t	kva;
-		u_int	old_pte;
-	} pmap[VM86_PMAPSIZE];
-};
-
-#define VM_USERCHANGE   (PSL_USERCHANGE | PSL_RF)
-#define VME_USERCHANGE  (VM_USERCHANGE | PSL_VIP | PSL_VIF)
-
-struct vm86_kernel {
-	caddr_t	vm86_intmap;			/* interrupt map */
-	u_int	vm86_eflags;			/* emulated flags */
-	int	vm86_has_vme;			/* VME support */
-	int	vm86_inited;			/* we were initialized */
-	int	vm86_debug;
-	caddr_t	vm86_sproc;			/* address of sproc */
-};
-
-#define VM86_INIT	1
-#define VM86_SET_VME	2
-#define VM86_GET_VME	3
-#define VM86_INTCALL	4
-
-struct vm86_init_args {
-        int     debug;                  /* debug flag */
-        int     cpu_type;               /* cpu type to emulate */
-        u_char  int_map[32];            /* interrupt map */ 
-};
-
-struct vm86_vme_args {
-	int	state;			/* status */
-};
-
-struct vm86_intcall_args {
-	int	intnum;
-	struct 	vm86frame vmf;
-};
-
-extern	int in_vm86call;
-extern 	pt_entry_t *vm86paddr;
-
-struct lwp;
-
-extern	int vm86_emulate (struct vm86frame *);
-extern	int vm86_sysarch (struct lwp *, char *);
-extern void vm86_trap (struct vm86frame *, int);
-extern 	int vm86_intcall (int, struct vm86frame *);
-extern 	int vm86_datacall (int, struct vm86frame *, struct vm86context *);
-extern void vm86_initialize (void);
-extern vm_offset_t vm86_getpage (struct vm86context *, int);
-extern vm_offset_t vm86_addpage (struct vm86context *, int, vm_offset_t);
-extern int vm86_getptr (struct vm86context *, vm_offset_t,
-				u_short *, u_short *);
-
-extern vm_offset_t vm86_getaddr (struct vm86context *, u_short, u_short);
-
-#endif /* _CPU_VM86_H_ */
diff --git a/sys/cpu/i386/misc/atomic.c b/sys/cpu/i386/misc/atomic.c
deleted file mode 100644
index a97d672..0000000
--- a/sys/cpu/i386/misc/atomic.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 1999 Peter Jeremy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/i386/atomic.c,v 1.3 1999/08/28 00:43:40 peter Exp $
- * $DragonFly: src/sys/cpu/i386/misc/atomic.c,v 1.3 2006/11/08 20:59:52 dillon Exp $
- */
-
-/* This file creates publically callable functions to perform various
- * simple arithmetic on memory which is atomic in the presence of
- * interrupts and multiple processors.
- */
-#include <sys/types.h>
-
-/* Firstly make atomic.h generate prototypes as it will for kernel modules */
-#define KLD_MODULE
-#include <machine/atomic.h>
-#undef _MACHINE_ATOMIC_H_	/* forget we included it */
-#undef _CPU_ATOMIC_H_		/* forget we included it */
-#undef KLD_MODULE
-
-/* Make atomic.h generate public functions */
-#define static
-#undef __inline
-#define __inline
-
-#include <machine/atomic.h>
diff --git a/sys/cpu/i386/misc/bzeront.s b/sys/cpu/i386/misc/bzeront.s
deleted file mode 100644
index 5759338..0000000
--- a/sys/cpu/i386/misc/bzeront.s
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2010 The DragonFly Project. All rights reserved.
- * All rights reserved.
- *
- * This code is derived from software contributed to The DragonFly Project
- * by Venkatesh Srinivas <me@endeavour.zapto.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asmacros.h>
-#include <machine/cputypes.h>
-#include <machine/pmap.h>
-#include <machine/specialreg.h>
-
-#include "assym.s"
-
-	.text
-
-/*
- * void bzeront(void *buf, size_t n);
- * bzero() using non-temporal stores to bypass cache pollution
- *
- * Only use on dword-aligned buffers with dword-multiple length
- */
-ENTRY(bzeront)
-	movl 8(%esp), %ecx
-	movl 4(%esp), %eax
-	xorl %edx, %edx
-	shrl $2, %ecx
-1:
-	movnti %edx, (%eax)
-	addl $4, %eax
-	subl $1, %ecx
-	jnz 1b
-	ret
diff --git a/sys/cpu/i386/misc/db_disasm.c b/sys/cpu/i386/misc/db_disasm.c
deleted file mode 100644
index a0d2918..0000000
--- a/sys/cpu/i386/misc/db_disasm.c
+++ /dev/null
@@ -1,1423 +0,0 @@
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $FreeBSD: src/sys/i386/i386/db_disasm.c,v 1.23.2.1 2001/07/29 22:48:37 kris Exp $
- */
-
-/*
- * Instruction disassembler.
- */
-#include <sys/param.h>
-
-#include <ddb/ddb.h>
-#include <ddb/db_access.h>
-#include <ddb/db_sym.h>
-
-/*
- * Size attributes
- */
-#define	BYTE	0
-#define	WORD	1
-#define	LONG	2
-#define	QUAD	3
-#define	SNGL	4
-#define	DBLR	5
-#define	EXTR	6
-#define	SDEP	7
-#define	NONE	8
-
-/*
- * Addressing modes
- */
-#define	E	1			/* general effective address */
-#define	Eind	2			/* indirect address (jump, call) */
-#define	Ew	3			/* address, word size */
-#define	Eb	4			/* address, byte size */
-#define	R	5			/* register, in 'reg' field */
-#define	Rw	6			/* word register, in 'reg' field */
-#define	Ri	7			/* register in instruction */
-#define	S	8			/* segment reg, in 'reg' field */
-#define	Si	9			/* segment reg, in instruction */
-#define	A	10			/* accumulator */
-#define	BX	11			/* (bx) */
-#define	CL	12			/* cl, for shifts */
-#define	DX	13			/* dx, for IO */
-#define	SI	14			/* si */
-#define	DI	15			/* di */
-#define	CR	16			/* control register */
-#define	DR	17			/* debug register */
-#define	TR	18			/* test register */
-#define	I	19			/* immediate, unsigned */
-#define	Is	20			/* immediate, signed */
-#define	Ib	21			/* byte immediate, unsigned */
-#define	Ibs	22			/* byte immediate, signed */
-#define	Iw	23			/* word immediate, unsigned */
-#define	O	25			/* direct address */
-#define	Db	26			/* byte displacement from EIP */
-#define	Dl	27			/* long displacement from EIP */
-#define	o1	28			/* constant 1 */
-#define	o3	29			/* constant 3 */
-#define	OS	30			/* immediate offset/segment */
-#define	ST	31			/* FP stack top */
-#define	STI	32			/* FP stack */
-#define	X	33			/* extended FP op */
-#define	XA	34			/* for 'fstcw %ax' */
-#define	El	35			/* address, long size */
-#define	Ril	36			/* long register in instruction */
-#define	Iba	37			/* byte immediate, don't print if 0xa */
-
-struct inst {
-	const char *	i_name;		/* name */
-	short	i_has_modrm;		/* has regmodrm byte */
-	short	i_size;			/* operand size */
-	int	i_mode;			/* addressing modes */
-	const void *	i_extra;	/* pointer to extra opcode table */
-};
-
-#define	op1(x)		(x)
-#define	op2(x,y)	((x)|((y)<<8))
-#define	op3(x,y,z)	((x)|((y)<<8)|((z)<<16))
-
-struct finst {
-	const char *	f_name;		/* name for memory instruction */
-	int	f_size;			/* size for memory instruction */
-	int	f_rrmode;		/* mode for rr instruction */
-	const void *	f_rrname;	/* name for rr instruction
-					   (or pointer to table) */
-};
-
-static const char * const db_Grp6[] = {
-	"sldt",
-	"str",
-	"lldt",
-	"ltr",
-	"verr",
-	"verw",
-	"",
-	""
-};
-
-static const char * const db_Grp7[] = {
-	"sgdt",
-	"sidt",
-	"lgdt",
-	"lidt",
-	"smsw",
-	"",
-	"lmsw",
-	"invlpg"
-};
-
-static const char * const db_Grp8[] = {
-	"",
-	"",
-	"",
-	"",
-	"bt",
-	"bts",
-	"btr",
-	"btc"
-};
-
-static const char * const db_Grp9[] = {
-	"",
-	"cmpxchg8b",
-	"",
-	"",
-	"",
-	"",
-	"",
-	""
-};
-
-static const struct inst db_inst_0f0x[] = {
-/*00*/	{ "",	   TRUE,  NONE,  op1(Ew),     db_Grp6 },
-/*01*/	{ "",	   TRUE,  NONE,  op1(Ew),     db_Grp7 },
-/*02*/	{ "lar",   TRUE,  LONG,  op2(E,R),    0 },
-/*03*/	{ "lsl",   TRUE,  LONG,  op2(E,R),    0 },
-/*04*/	{ "",      FALSE, NONE,  0,	      0 },
-/*05*/	{ "",      FALSE, NONE,  0,	      0 },
-/*06*/	{ "clts",  FALSE, NONE,  0,	      0 },
-/*07*/	{ "",      FALSE, NONE,  0,	      0 },
-
-/*08*/	{ "invd",  FALSE, NONE,  0,	      0 },
-/*09*/	{ "wbinvd",FALSE, NONE,  0,	      0 },
-/*0a*/	{ "",      FALSE, NONE,  0,	      0 },
-/*0b*/	{ "",      FALSE, NONE,  0,	      0 },
-/*0c*/	{ "",      FALSE, NONE,  0,	      0 },
-/*0d*/	{ "",      FALSE, NONE,  0,	      0 },
-/*0e*/	{ "",      FALSE, NONE,  0,	      0 },
-/*0f*/	{ "",      FALSE, NONE,  0,	      0 },
-};
-
-static const struct inst db_inst_0f2x[] = {
-/*20*/	{ "mov",   TRUE,  LONG,  op2(CR,El),  0 },
-/*21*/	{ "mov",   TRUE,  LONG,  op2(DR,El),  0 },
-/*22*/	{ "mov",   TRUE,  LONG,  op2(El,CR),  0 },
-/*23*/	{ "mov",   TRUE,  LONG,  op2(El,DR),  0 },
-/*24*/	{ "mov",   TRUE,  LONG,  op2(TR,El),  0 },
-/*25*/	{ "",      FALSE, NONE,  0,	      0 },
-/*26*/	{ "mov",   TRUE,  LONG,  op2(El,TR),  0 },
-/*27*/	{ "",      FALSE, NONE,  0,	      0 },
-
-/*28*/	{ "",      FALSE, NONE,  0,	      0 },
-/*29*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2a*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2b*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2c*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2d*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2e*/	{ "",      FALSE, NONE,  0,	      0 },
-/*2f*/	{ "",      FALSE, NONE,  0,	      0 },
-};
-
-static const struct inst db_inst_0f3x[] = {
-/*30*/	{ "wrmsr", FALSE, NONE,  0,	      0 },
-/*31*/	{ "rdtsc", FALSE, NONE,  0,	      0 },
-/*32*/	{ "rdmsr", FALSE, NONE,  0,	      0 },
-/*33*/	{ "rdpmc", FALSE, NONE,  0,	      0 },
-/*34*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*35*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*36*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*37*/	{ "",	   FALSE, NONE,  0,	      0 },
-
-/*38*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*39*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3a*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3b*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3c*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3d*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3e*/	{ "",	   FALSE, NONE,  0,	      0 },
-/*3f*/	{ "",	   FALSE, NONE,  0,	      0 },
-};
-
-static const struct inst db_inst_0f8x[] = {
-/*80*/	{ "jo",    FALSE, NONE,  op1(Dl),     0 },
-/*81*/	{ "jno",   FALSE, NONE,  op1(Dl),     0 },
-/*82*/	{ "jb",    FALSE, NONE,  op1(Dl),     0 },
-/*83*/	{ "jnb",   FALSE, NONE,  op1(Dl),     0 },
-/*84*/	{ "jz",    FALSE, NONE,  op1(Dl),     0 },
-/*85*/	{ "jnz",   FALSE, NONE,  op1(Dl),     0 },
-/*86*/	{ "jbe",   FALSE, NONE,  op1(Dl),     0 },
-/*87*/	{ "jnbe",  FALSE, NONE,  op1(Dl),     0 },
-
-/*88*/	{ "js",    FALSE, NONE,  op1(Dl),     0 },
-/*89*/	{ "jns",   FALSE, NONE,  op1(Dl),     0 },
-/*8a*/	{ "jp",    FALSE, NONE,  op1(Dl),     0 },
-/*8b*/	{ "jnp",   FALSE, NONE,  op1(Dl),     0 },
-/*8c*/	{ "jl",    FALSE, NONE,  op1(Dl),     0 },
-/*8d*/	{ "jnl",   FALSE, NONE,  op1(Dl),     0 },
-/*8e*/	{ "jle",   FALSE, NONE,  op1(Dl),     0 },
-/*8f*/	{ "jnle",  FALSE, NONE,  op1(Dl),     0 },
-};
-
-static const struct inst db_inst_0f9x[] = {
-/*90*/	{ "seto",  TRUE,  NONE,  op1(Eb),     0 },
-/*91*/	{ "setno", TRUE,  NONE,  op1(Eb),     0 },
-/*92*/	{ "setb",  TRUE,  NONE,  op1(Eb),     0 },
-/*93*/	{ "setnb", TRUE,  NONE,  op1(Eb),     0 },
-/*94*/	{ "setz",  TRUE,  NONE,  op1(Eb),     0 },
-/*95*/	{ "setnz", TRUE,  NONE,  op1(Eb),     0 },
-/*96*/	{ "setbe", TRUE,  NONE,  op1(Eb),     0 },
-/*97*/	{ "setnbe",TRUE,  NONE,  op1(Eb),     0 },
-
-/*98*/	{ "sets",  TRUE,  NONE,  op1(Eb),     0 },
-/*99*/	{ "setns", TRUE,  NONE,  op1(Eb),     0 },
-/*9a*/	{ "setp",  TRUE,  NONE,  op1(Eb),     0 },
-/*9b*/	{ "setnp", TRUE,  NONE,  op1(Eb),     0 },
-/*9c*/	{ "setl",  TRUE,  NONE,  op1(Eb),     0 },
-/*9d*/	{ "setnl", TRUE,  NONE,  op1(Eb),     0 },
-/*9e*/	{ "setle", TRUE,  NONE,  op1(Eb),     0 },
-/*9f*/	{ "setnle",TRUE,  NONE,  op1(Eb),     0 },
-};
-
-static const struct inst db_inst_0fax[] = {
-/*a0*/	{ "push",  FALSE, NONE,  op1(Si),     0 },
-/*a1*/	{ "pop",   FALSE, NONE,  op1(Si),     0 },
-/*a2*/	{ "cpuid", FALSE, NONE,  0,	      0 },
-/*a3*/	{ "bt",    TRUE,  LONG,  op2(R,E),    0 },
-/*a4*/	{ "shld",  TRUE,  LONG,  op3(Ib,R,E), 0 },
-/*a5*/	{ "shld",  TRUE,  LONG,  op3(CL,R,E), 0 },
-/*a6*/	{ "",      FALSE, NONE,  0,	      0 },
-/*a7*/	{ "",      FALSE, NONE,  0,	      0 },
-
-/*a8*/	{ "push",  FALSE, NONE,  op1(Si),     0 },
-/*a9*/	{ "pop",   FALSE, NONE,  op1(Si),     0 },
-/*aa*/	{ "rsm",   FALSE, NONE,  0,	      0 },
-/*ab*/	{ "bts",   TRUE,  LONG,  op2(R,E),    0 },
-/*ac*/	{ "shrd",  TRUE,  LONG,  op3(Ib,R,E), 0 },
-/*ad*/	{ "shrd",  TRUE,  LONG,  op3(CL,R,E), 0 },
-/*a6*/	{ "",      FALSE, NONE,  0,	      0 },
-/*a7*/	{ "imul",  TRUE,  LONG,  op2(E,R),    0 },
-};
-
-static const struct inst db_inst_0fbx[] = {
-/*b0*/	{ "cmpxchg",TRUE, BYTE,	 op2(R, E),   0 },
-/*b0*/	{ "cmpxchg",TRUE, LONG,	 op2(R, E),   0 },
-/*b2*/	{ "lss",   TRUE,  LONG,  op2(E, R),   0 },
-/*b3*/	{ "btr",   TRUE,  LONG,  op2(R, E),   0 },
-/*b4*/	{ "lfs",   TRUE,  LONG,  op2(E, R),   0 },
-/*b5*/	{ "lgs",   TRUE,  LONG,  op2(E, R),   0 },
-/*b6*/	{ "movzb", TRUE,  LONG,  op2(Eb, R),  0 },
-/*b7*/	{ "movzw", TRUE,  LONG,  op2(Ew, R),  0 },
-
-/*b8*/	{ "",      FALSE, NONE,  0,	      0 },
-/*b9*/	{ "",      FALSE, NONE,  0,	      0 },
-/*ba*/	{ "",      TRUE,  LONG,  op2(Ib, E),  db_Grp8 },
-/*bb*/	{ "btc",   TRUE,  LONG,  op2(R, E),   0 },
-/*bc*/	{ "bsf",   TRUE,  LONG,  op2(E, R),   0 },
-/*bd*/	{ "bsr",   TRUE,  LONG,  op2(E, R),   0 },
-/*be*/	{ "movsb", TRUE,  LONG,  op2(Eb, R),  0 },
-/*bf*/	{ "movsw", TRUE,  LONG,  op2(Ew, R),  0 },
-};
-
-static const struct inst db_inst_0fcx[] = {
-/*c0*/	{ "xadd",  TRUE,  BYTE,	 op2(R, E),   0 },
-/*c1*/	{ "xadd",  TRUE,  LONG,	 op2(R, E),   0 },
-/*c2*/	{ "",	   FALSE, NONE,	 0,	      0 },
-/*c3*/	{ "",	   FALSE, NONE,	 0,	      0 },
-/*c4*/	{ "",	   FALSE, NONE,	 0,	      0 },
-/*c5*/	{ "",	   FALSE, NONE,	 0,	      0 },
-/*c6*/	{ "",	   FALSE, NONE,	 0,	      0 },
-/*c7*/	{ "",	   TRUE,  NONE,  op1(E),      db_Grp9 },
-/*c8*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*c9*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*ca*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*cb*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*cc*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*cd*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*ce*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-/*cf*/	{ "bswap", FALSE, LONG,  op1(Ril),    0 },
-};
-
-static const struct inst * const db_inst_0f[] = {
-	db_inst_0f0x,
-	0,
-	db_inst_0f2x,
-	db_inst_0f3x,
-	0,
-	0,
-	0,
-	0,
-	db_inst_0f8x,
-	db_inst_0f9x,
-	db_inst_0fax,
-	db_inst_0fbx,
-	db_inst_0fcx,
-	0,
-	0,
-	0
-};
-
-static const char * const db_Esc92[] = {
-	"fnop",	"",	"",	"",	"",	"",	"",	""
-};
-static const char * const db_Esc94[] = {
-	"fchs",	"fabs",	"",	"",	"ftst",	"fxam",	"",	""
-};
-static const char * const db_Esc95[] = {
-	"fld1",	"fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz",""
-};
-static const char * const db_Esc96[] = {
-	"f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp",
-	"fincstp"
-};
-static const char * const db_Esc97[] = {
-	"fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos"
-};
-
-static const char * const db_Esca5[] = {
-	"",	"fucompp","",	"",	"",	"",	"",	""
-};
-
-static const char * const db_Escb4[] = {
-	"fneni","fndisi",	"fnclex","fninit","fsetpm",	"",	"",	""
-};
-
-static const char * const db_Esce3[] = {
-	"",	"fcompp","",	"",	"",	"",	"",	""
-};
-
-static const char * const db_Escf4[] = {
-	"fnstsw","",	"",	"",	"",	"",	"",	""
-};
-
-static const struct finst db_Esc8[] = {
-/*0*/	{ "fadd",   SNGL,  op2(STI,ST),	0 },
-/*1*/	{ "fmul",   SNGL,  op2(STI,ST),	0 },
-/*2*/	{ "fcom",   SNGL,  op2(STI,ST),	0 },
-/*3*/	{ "fcomp",  SNGL,  op2(STI,ST),	0 },
-/*4*/	{ "fsub",   SNGL,  op2(STI,ST),	0 },
-/*5*/	{ "fsubr",  SNGL,  op2(STI,ST),	0 },
-/*6*/	{ "fdiv",   SNGL,  op2(STI,ST),	0 },
-/*7*/	{ "fdivr",  SNGL,  op2(STI,ST),	0 },
-};
-
-static const struct finst db_Esc9[] = {
-/*0*/	{ "fld",    SNGL,  op1(STI),	0 },
-/*1*/	{ "",       NONE,  op1(STI),	"fxch" },
-/*2*/	{ "fst",    SNGL,  op1(X),	db_Esc92 },
-/*3*/	{ "fstp",   SNGL,  0,		0 },
-/*4*/	{ "fldenv", NONE,  op1(X),	db_Esc94 },
-/*5*/	{ "fldcw",  NONE,  op1(X),	db_Esc95 },
-/*6*/	{ "fnstenv",NONE,  op1(X),	db_Esc96 },
-/*7*/	{ "fnstcw", NONE,  op1(X),	db_Esc97 },
-};
-
-static const struct finst db_Esca[] = {
-/*0*/	{ "fiadd",  LONG,  0,		0 },
-/*1*/	{ "fimul",  LONG,  0,		0 },
-/*2*/	{ "ficom",  LONG,  0,		0 },
-/*3*/	{ "ficomp", LONG,  0,		0 },
-/*4*/	{ "fisub",  LONG,  0,		0 },
-/*5*/	{ "fisubr", LONG,  op1(X),	db_Esca5 },
-/*6*/	{ "fidiv",  LONG,  0,		0 },
-/*7*/	{ "fidivr", LONG,  0,		0 }
-};
-
-static const struct finst db_Escb[] = {
-/*0*/	{ "fild",   LONG,  0,		0 },
-/*1*/	{ "",       NONE,  0,		0 },
-/*2*/	{ "fist",   LONG,  0,		0 },
-/*3*/	{ "fistp",  LONG,  0,		0 },
-/*4*/	{ "",       WORD,  op1(X),	db_Escb4 },
-/*5*/	{ "fld",    EXTR,  0,		0 },
-/*6*/	{ "",       WORD,  0,		0 },
-/*7*/	{ "fstp",   EXTR,  0,		0 },
-};
-
-static const struct finst db_Escc[] = {
-/*0*/	{ "fadd",   DBLR,  op2(ST,STI),	0 },
-/*1*/	{ "fmul",   DBLR,  op2(ST,STI),	0 },
-/*2*/	{ "fcom",   DBLR,  0,		0 },
-/*3*/	{ "fcomp",  DBLR,  0,		0 },
-/*4*/	{ "fsub",   DBLR,  op2(ST,STI),	"fsubr" },
-/*5*/	{ "fsubr",  DBLR,  op2(ST,STI),	"fsub" },
-/*6*/	{ "fdiv",   DBLR,  op2(ST,STI),	"fdivr" },
-/*7*/	{ "fdivr",  DBLR,  op2(ST,STI),	"fdiv" },
-};
-
-static const struct finst db_Escd[] = {
-/*0*/	{ "fld",    DBLR,  op1(STI),	"ffree" },
-/*1*/	{ "",       NONE,  0,		0 },
-/*2*/	{ "fst",    DBLR,  op1(STI),	0 },
-/*3*/	{ "fstp",   DBLR,  op1(STI),	0 },
-/*4*/	{ "frstor", NONE,  op1(STI),	"fucom" },
-/*5*/	{ "",       NONE,  op1(STI),	"fucomp" },
-/*6*/	{ "fnsave", NONE,  0,		0 },
-/*7*/	{ "fnstsw", NONE,  0,		0 },
-};
-
-static const struct finst db_Esce[] = {
-/*0*/	{ "fiadd",  WORD,  op2(ST,STI),	"faddp" },
-/*1*/	{ "fimul",  WORD,  op2(ST,STI),	"fmulp" },
-/*2*/	{ "ficom",  WORD,  0,		0 },
-/*3*/	{ "ficomp", WORD,  op1(X),	db_Esce3 },
-/*4*/	{ "fisub",  WORD,  op2(ST,STI),	"fsubrp" },
-/*5*/	{ "fisubr", WORD,  op2(ST,STI),	"fsubp" },
-/*6*/	{ "fidiv",  WORD,  op2(ST,STI),	"fdivrp" },
-/*7*/	{ "fidivr", WORD,  op2(ST,STI),	"fdivp" },
-};
-
-static const struct finst db_Escf[] = {
-/*0*/	{ "fild",   WORD,  0,		0 },
-/*1*/	{ "",       NONE,  0,		0 },
-/*2*/	{ "fist",   WORD,  0,		0 },
-/*3*/	{ "fistp",  WORD,  0,		0 },
-/*4*/	{ "fbld",   NONE,  op1(XA),	db_Escf4 },
-/*5*/	{ "fild",   QUAD,  0,		0 },
-/*6*/	{ "fbstp",  NONE,  0,		0 },
-/*7*/	{ "fistp",  QUAD,  0,		0 },
-};
-
-static const struct finst * const db_Esc_inst[] = {
-	db_Esc8, db_Esc9, db_Esca, db_Escb,
-	db_Escc, db_Escd, db_Esce, db_Escf
-};
-
-static const char * const db_Grp1[] = {
-	"add",
-	"or",
-	"adc",
-	"sbb",
-	"and",
-	"sub",
-	"xor",
-	"cmp"
-};
-
-static const char * const db_Grp2[] = {
-	"rol",
-	"ror",
-	"rcl",
-	"rcr",
-	"shl",
-	"shr",
-	"shl",
-	"sar"
-};
-
-static const struct inst db_Grp3[] = {
-	{ "test",  TRUE, NONE, op2(I,E), 0 },
-	{ "test",  TRUE, NONE, op2(I,E), 0 },
-	{ "not",   TRUE, NONE, op1(E),   0 },
-	{ "neg",   TRUE, NONE, op1(E),   0 },
-	{ "mul",   TRUE, NONE, op2(E,A), 0 },
-	{ "imul",  TRUE, NONE, op2(E,A), 0 },
-	{ "div",   TRUE, NONE, op2(E,A), 0 },
-	{ "idiv",  TRUE, NONE, op2(E,A), 0 },
-};
-
-static const struct inst db_Grp4[] = {
-	{ "inc",   TRUE, BYTE, op1(E),   0 },
-	{ "dec",   TRUE, BYTE, op1(E),   0 },
-	{ "",      TRUE, NONE, 0,	 0 },
-	{ "",      TRUE, NONE, 0,	 0 },
-	{ "",      TRUE, NONE, 0,	 0 },
-	{ "",      TRUE, NONE, 0,	 0 },
-	{ "",      TRUE, NONE, 0,	 0 },
-	{ "",      TRUE, NONE, 0,	 0 }
-};
-
-static const struct inst db_Grp5[] = {
-	{ "inc",   TRUE, LONG, op1(E),   0 },
-	{ "dec",   TRUE, LONG, op1(E),   0 },
-	{ "call",  TRUE, LONG, op1(Eind),0 },
-	{ "lcall", TRUE, LONG, op1(Eind),0 },
-	{ "jmp",   TRUE, LONG, op1(Eind),0 },
-	{ "ljmp",  TRUE, LONG, op1(Eind),0 },
-	{ "push",  TRUE, LONG, op1(E),   0 },
-	{ "",      TRUE, NONE, 0,	 0 }
-};
-
-static const struct inst db_inst_table[256] = {
-/*00*/	{ "add",   TRUE,  BYTE,  op2(R, E),  0 },
-/*01*/	{ "add",   TRUE,  LONG,  op2(R, E),  0 },
-/*02*/	{ "add",   TRUE,  BYTE,  op2(E, R),  0 },
-/*03*/	{ "add",   TRUE,  LONG,  op2(E, R),  0 },
-/*04*/	{ "add",   FALSE, BYTE,  op2(I, A),  0 },
-/*05*/	{ "add",   FALSE, LONG,  op2(Is, A), 0 },
-/*06*/	{ "push",  FALSE, NONE,  op1(Si),    0 },
-/*07*/	{ "pop",   FALSE, NONE,  op1(Si),    0 },
-
-/*08*/	{ "or",    TRUE,  BYTE,  op2(R, E),  0 },
-/*09*/	{ "or",    TRUE,  LONG,  op2(R, E),  0 },
-/*0a*/	{ "or",    TRUE,  BYTE,  op2(E, R),  0 },
-/*0b*/	{ "or",    TRUE,  LONG,  op2(E, R),  0 },
-/*0c*/	{ "or",    FALSE, BYTE,  op2(I, A),  0 },
-/*0d*/	{ "or",    FALSE, LONG,  op2(I, A),  0 },
-/*0e*/	{ "push",  FALSE, NONE,  op1(Si),    0 },
-/*0f*/	{ "",      FALSE, NONE,  0,	     0 },
-
-/*10*/	{ "adc",   TRUE,  BYTE,  op2(R, E),  0 },
-/*11*/	{ "adc",   TRUE,  LONG,  op2(R, E),  0 },
-/*12*/	{ "adc",   TRUE,  BYTE,  op2(E, R),  0 },
-/*13*/	{ "adc",   TRUE,  LONG,  op2(E, R),  0 },
-/*14*/	{ "adc",   FALSE, BYTE,  op2(I, A),  0 },
-/*15*/	{ "adc",   FALSE, LONG,  op2(Is, A), 0 },
-/*16*/	{ "push",  FALSE, NONE,  op1(Si),    0 },
-/*17*/	{ "pop",   FALSE, NONE,  op1(Si),    0 },
-
-/*18*/	{ "sbb",   TRUE,  BYTE,  op2(R, E),  0 },
-/*19*/	{ "sbb",   TRUE,  LONG,  op2(R, E),  0 },
-/*1a*/	{ "sbb",   TRUE,  BYTE,  op2(E, R),  0 },
-/*1b*/	{ "sbb",   TRUE,  LONG,  op2(E, R),  0 },
-/*1c*/	{ "sbb",   FALSE, BYTE,  op2(I, A),  0 },
-/*1d*/	{ "sbb",   FALSE, LONG,  op2(Is, A), 0 },
-/*1e*/	{ "push",  FALSE, NONE,  op1(Si),    0 },
-/*1f*/	{ "pop",   FALSE, NONE,  op1(Si),    0 },
-
-/*20*/	{ "and",   TRUE,  BYTE,  op2(R, E),  0 },
-/*21*/	{ "and",   TRUE,  LONG,  op2(R, E),  0 },
-/*22*/	{ "and",   TRUE,  BYTE,  op2(E, R),  0 },
-/*23*/	{ "and",   TRUE,  LONG,  op2(E, R),  0 },
-/*24*/	{ "and",   FALSE, BYTE,  op2(I, A),  0 },
-/*25*/	{ "and",   FALSE, LONG,  op2(I, A),  0 },
-/*26*/	{ "",      FALSE, NONE,  0,	     0 },
-/*27*/	{ "daa",   FALSE, NONE,  0,	     0 },
-
-/*28*/	{ "sub",   TRUE,  BYTE,  op2(R, E),  0 },
-/*29*/	{ "sub",   TRUE,  LONG,  op2(R, E),  0 },
-/*2a*/	{ "sub",   TRUE,  BYTE,  op2(E, R),  0 },
-/*2b*/	{ "sub",   TRUE,  LONG,  op2(E, R),  0 },
-/*2c*/	{ "sub",   FALSE, BYTE,  op2(I, A),  0 },
-/*2d*/	{ "sub",   FALSE, LONG,  op2(Is, A), 0 },
-/*2e*/	{ "",      FALSE, NONE,  0,	     0 },
-/*2f*/	{ "das",   FALSE, NONE,  0,	     0 },
-
-/*30*/	{ "xor",   TRUE,  BYTE,  op2(R, E),  0 },
-/*31*/	{ "xor",   TRUE,  LONG,  op2(R, E),  0 },
-/*32*/	{ "xor",   TRUE,  BYTE,  op2(E, R),  0 },
-/*33*/	{ "xor",   TRUE,  LONG,  op2(E, R),  0 },
-/*34*/	{ "xor",   FALSE, BYTE,  op2(I, A),  0 },
-/*35*/	{ "xor",   FALSE, LONG,  op2(I, A),  0 },
-/*36*/	{ "",      FALSE, NONE,  0,	     0 },
-/*37*/	{ "aaa",   FALSE, NONE,  0,	     0 },
-
-/*38*/	{ "cmp",   TRUE,  BYTE,  op2(R, E),  0 },
-/*39*/	{ "cmp",   TRUE,  LONG,  op2(R, E),  0 },
-/*3a*/	{ "cmp",   TRUE,  BYTE,  op2(E, R),  0 },
-/*3b*/	{ "cmp",   TRUE,  LONG,  op2(E, R),  0 },
-/*3c*/	{ "cmp",   FALSE, BYTE,  op2(I, A),  0 },
-/*3d*/	{ "cmp",   FALSE, LONG,  op2(Is, A), 0 },
-/*3e*/	{ "",      FALSE, NONE,  0,	     0 },
-/*3f*/	{ "aas",   FALSE, NONE,  0,	     0 },
-
-/*40*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*41*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*42*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*43*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*44*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*45*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*46*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-/*47*/	{ "inc",   FALSE, LONG,  op1(Ri),    0 },
-
-/*48*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*49*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4a*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4b*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4c*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4d*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4e*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-/*4f*/	{ "dec",   FALSE, LONG,  op1(Ri),    0 },
-
-/*50*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*51*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*52*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*53*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*54*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*55*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*56*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-/*57*/	{ "push",  FALSE, LONG,  op1(Ri),    0 },
-
-/*58*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*59*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5a*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5b*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5c*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5d*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5e*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-/*5f*/	{ "pop",   FALSE, LONG,  op1(Ri),    0 },
-
-/*60*/	{ "pusha", FALSE, LONG,  0,	     0 },
-/*61*/	{ "popa",  FALSE, LONG,  0,	     0 },
-/*62*/  { "bound", TRUE,  LONG,  op2(E, R),  0 },
-/*63*/	{ "arpl",  TRUE,  NONE,  op2(Rw,Ew), 0 },
-
-/*64*/	{ "",      FALSE, NONE,  0,	     0 },
-/*65*/	{ "",      FALSE, NONE,  0,	     0 },
-/*66*/	{ "",      FALSE, NONE,  0,	     0 },
-/*67*/	{ "",      FALSE, NONE,  0,	     0 },
-
-/*68*/	{ "push",  FALSE, LONG,  op1(I),     0 },
-/*69*/  { "imul",  TRUE,  LONG,  op3(I,E,R), 0 },
-/*6a*/	{ "push",  FALSE, LONG,  op1(Ibs),   0 },
-/*6b*/  { "imul",  TRUE,  LONG,  op3(Ibs,E,R),0 },
-/*6c*/	{ "ins",   FALSE, BYTE,  op2(DX, DI), 0 },
-/*6d*/	{ "ins",   FALSE, LONG,  op2(DX, DI), 0 },
-/*6e*/	{ "outs",  FALSE, BYTE,  op2(SI, DX), 0 },
-/*6f*/	{ "outs",  FALSE, LONG,  op2(SI, DX), 0 },
-
-/*70*/	{ "jo",    FALSE, NONE,  op1(Db),     0 },
-/*71*/	{ "jno",   FALSE, NONE,  op1(Db),     0 },
-/*72*/	{ "jb",    FALSE, NONE,  op1(Db),     0 },
-/*73*/	{ "jnb",   FALSE, NONE,  op1(Db),     0 },
-/*74*/	{ "jz",    FALSE, NONE,  op1(Db),     0 },
-/*75*/	{ "jnz",   FALSE, NONE,  op1(Db),     0 },
-/*76*/	{ "jbe",   FALSE, NONE,  op1(Db),     0 },
-/*77*/	{ "jnbe",  FALSE, NONE,  op1(Db),     0 },
-
-/*78*/	{ "js",    FALSE, NONE,  op1(Db),     0 },
-/*79*/	{ "jns",   FALSE, NONE,  op1(Db),     0 },
-/*7a*/	{ "jp",    FALSE, NONE,  op1(Db),     0 },
-/*7b*/	{ "jnp",   FALSE, NONE,  op1(Db),     0 },
-/*7c*/	{ "jl",    FALSE, NONE,  op1(Db),     0 },
-/*7d*/	{ "jnl",   FALSE, NONE,  op1(Db),     0 },
-/*7e*/	{ "jle",   FALSE, NONE,  op1(Db),     0 },
-/*7f*/	{ "jnle",  FALSE, NONE,  op1(Db),     0 },
-
-/*80*/  { "",	   TRUE,  BYTE,  op2(I, E),   db_Grp1 },
-/*81*/  { "",	   TRUE,  LONG,  op2(I, E),   db_Grp1 },
-/*82*/  { "",	   TRUE,  BYTE,  op2(I, E),   db_Grp1 },
-/*83*/  { "",	   TRUE,  LONG,  op2(Ibs,E),  db_Grp1 },
-/*84*/	{ "test",  TRUE,  BYTE,  op2(R, E),   0 },
-/*85*/	{ "test",  TRUE,  LONG,  op2(R, E),   0 },
-/*86*/	{ "xchg",  TRUE,  BYTE,  op2(R, E),   0 },
-/*87*/	{ "xchg",  TRUE,  LONG,  op2(R, E),   0 },
-
-/*88*/	{ "mov",   TRUE,  BYTE,  op2(R, E),   0 },
-/*89*/	{ "mov",   TRUE,  LONG,  op2(R, E),   0 },
-/*8a*/	{ "mov",   TRUE,  BYTE,  op2(E, R),   0 },
-/*8b*/	{ "mov",   TRUE,  LONG,  op2(E, R),   0 },
-/*8c*/  { "mov",   TRUE,  NONE,  op2(S, Ew),  0 },
-/*8d*/	{ "lea",   TRUE,  LONG,  op2(E, R),   0 },
-/*8e*/	{ "mov",   TRUE,  NONE,  op2(Ew, S),  0 },
-/*8f*/	{ "pop",   TRUE,  LONG,  op1(E),      0 },
-
-/*90*/	{ "nop",   FALSE, NONE,  0,	      0 },
-/*91*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*92*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*93*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*94*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*95*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*96*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-/*97*/	{ "xchg",  FALSE, LONG,  op2(A, Ri),  0 },
-
-/*98*/	{ "cbw",   FALSE, SDEP,  0,	      "cwde" },	/* cbw/cwde */
-/*99*/	{ "cwd",   FALSE, SDEP,  0,	      "cdq"  },	/* cwd/cdq */
-/*9a*/	{ "lcall", FALSE, NONE,  op1(OS),     0 },
-/*9b*/	{ "wait",  FALSE, NONE,  0,	      0 },
-/*9c*/	{ "pushf", FALSE, LONG,  0,	      0 },
-/*9d*/	{ "popf",  FALSE, LONG,  0,	      0 },
-/*9e*/	{ "sahf",  FALSE, NONE,  0,	      0 },
-/*9f*/	{ "lahf",  FALSE, NONE,  0,	      0 },
-
-/*a0*/	{ "mov",   FALSE, BYTE,  op2(O, A),   0 },
-/*a1*/	{ "mov",   FALSE, LONG,  op2(O, A),   0 },
-/*a2*/	{ "mov",   FALSE, BYTE,  op2(A, O),   0 },
-/*a3*/	{ "mov",   FALSE, LONG,  op2(A, O),   0 },
-/*a4*/	{ "movs",  FALSE, BYTE,  op2(SI,DI),  0 },
-/*a5*/	{ "movs",  FALSE, LONG,  op2(SI,DI),  0 },
-/*a6*/	{ "cmps",  FALSE, BYTE,  op2(SI,DI),  0 },
-/*a7*/	{ "cmps",  FALSE, LONG,  op2(SI,DI),  0 },
-
-/*a8*/	{ "test",  FALSE, BYTE,  op2(I, A),   0 },
-/*a9*/	{ "test",  FALSE, LONG,  op2(I, A),   0 },
-/*aa*/	{ "stos",  FALSE, BYTE,  op1(DI),     0 },
-/*ab*/	{ "stos",  FALSE, LONG,  op1(DI),     0 },
-/*ac*/	{ "lods",  FALSE, BYTE,  op1(SI),     0 },
-/*ad*/	{ "lods",  FALSE, LONG,  op1(SI),     0 },
-/*ae*/	{ "scas",  FALSE, BYTE,  op1(SI),     0 },
-/*af*/	{ "scas",  FALSE, LONG,  op1(SI),     0 },
-
-/*b0*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b1*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b2*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b3*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b4*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b5*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b6*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-/*b7*/	{ "mov",   FALSE, BYTE,  op2(I, Ri),  0 },
-
-/*b8*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*b9*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*ba*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*bb*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*bc*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*bd*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*be*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-/*bf*/	{ "mov",   FALSE, LONG,  op2(I, Ri),  0 },
-
-/*c0*/	{ "",	   TRUE,  BYTE,  op2(Ib, E),  db_Grp2 },
-/*c1*/	{ "",	   TRUE,  LONG,  op2(Ib, E),  db_Grp2 },
-/*c2*/	{ "ret",   FALSE, NONE,  op1(Iw),     0 },
-/*c3*/	{ "ret",   FALSE, NONE,  0,	      0 },
-/*c4*/	{ "les",   TRUE,  LONG,  op2(E, R),   0 },
-/*c5*/	{ "lds",   TRUE,  LONG,  op2(E, R),   0 },
-/*c6*/	{ "mov",   TRUE,  BYTE,  op2(I, E),   0 },
-/*c7*/	{ "mov",   TRUE,  LONG,  op2(I, E),   0 },
-
-/*c8*/	{ "enter", FALSE, NONE,  op2(Iw, Ib), 0 },
-/*c9*/	{ "leave", FALSE, NONE,  0,           0 },
-/*ca*/	{ "lret",  FALSE, NONE,  op1(Iw),     0 },
-/*cb*/	{ "lret",  FALSE, NONE,  0,	      0 },
-/*cc*/	{ "int",   FALSE, NONE,  op1(o3),     0 },
-/*cd*/	{ "int",   FALSE, NONE,  op1(Ib),     0 },
-/*ce*/	{ "into",  FALSE, NONE,  0,	      0 },
-/*cf*/	{ "iret",  FALSE, NONE,  0,	      0 },
-
-/*d0*/	{ "",	   TRUE,  BYTE,  op2(o1, E),  db_Grp2 },
-/*d1*/	{ "",	   TRUE,  LONG,  op2(o1, E),  db_Grp2 },
-/*d2*/	{ "",	   TRUE,  BYTE,  op2(CL, E),  db_Grp2 },
-/*d3*/	{ "",	   TRUE,  LONG,  op2(CL, E),  db_Grp2 },
-/*d4*/	{ "aam",   FALSE, NONE,  op1(Iba),    0 },
-/*d5*/	{ "aad",   FALSE, NONE,  op1(Iba),    0 },
-/*d6*/	{ ".byte\t0xd6", FALSE, NONE, 0,      0 },
-/*d7*/	{ "xlat",  FALSE, BYTE,  op1(BX),     0 },
-
-/*d8*/  { "",      TRUE,  NONE,  0,	      db_Esc8 },
-/*d9*/  { "",      TRUE,  NONE,  0,	      db_Esc9 },
-/*da*/  { "",      TRUE,  NONE,  0,	      db_Esca },
-/*db*/  { "",      TRUE,  NONE,  0,	      db_Escb },
-/*dc*/  { "",      TRUE,  NONE,  0,	      db_Escc },
-/*dd*/  { "",      TRUE,  NONE,  0,	      db_Escd },
-/*de*/  { "",      TRUE,  NONE,  0,	      db_Esce },
-/*df*/  { "",      TRUE,  NONE,  0,	      db_Escf },
-
-/*e0*/	{ "loopne",FALSE, NONE,  op1(Db),     0 },
-/*e1*/	{ "loope", FALSE, NONE,  op1(Db),     0 },
-/*e2*/	{ "loop",  FALSE, NONE,  op1(Db),     0 },
-/*e3*/	{ "jcxz",  FALSE, SDEP,  op1(Db),     "jecxz" },
-/*e4*/	{ "in",    FALSE, BYTE,  op2(Ib, A),  0 },
-/*e5*/	{ "in",    FALSE, LONG,  op2(Ib, A) , 0 },
-/*e6*/	{ "out",   FALSE, BYTE,  op2(A, Ib),  0 },
-/*e7*/	{ "out",   FALSE, LONG,  op2(A, Ib) , 0 },
-
-/*e8*/	{ "call",  FALSE, NONE,  op1(Dl),     0 },
-/*e9*/	{ "jmp",   FALSE, NONE,  op1(Dl),     0 },
-/*ea*/	{ "ljmp",  FALSE, NONE,  op1(OS),     0 },
-/*eb*/	{ "jmp",   FALSE, NONE,  op1(Db),     0 },
-/*ec*/	{ "in",    FALSE, BYTE,  op2(DX, A),  0 },
-/*ed*/	{ "in",    FALSE, LONG,  op2(DX, A) , 0 },
-/*ee*/	{ "out",   FALSE, BYTE,  op2(A, DX),  0 },
-/*ef*/	{ "out",   FALSE, LONG,  op2(A, DX) , 0 },
-
-/*f0*/	{ "",      FALSE, NONE,  0,	     0 },
-/*f1*/	{ ".byte\t0xf1", FALSE, NONE, 0,     0 },
-/*f2*/	{ "",      FALSE, NONE,  0,	     0 },
-/*f3*/	{ "",      FALSE, NONE,  0,	     0 },
-/*f4*/	{ "hlt",   FALSE, NONE,  0,	     0 },
-/*f5*/	{ "cmc",   FALSE, NONE,  0,	     0 },
-/*f6*/	{ "",      TRUE,  BYTE,  0,	     db_Grp3 },
-/*f7*/	{ "",	   TRUE,  LONG,  0,	     db_Grp3 },
-
-/*f8*/	{ "clc",   FALSE, NONE,  0,	     0 },
-/*f9*/	{ "stc",   FALSE, NONE,  0,	     0 },
-/*fa*/	{ "cli",   FALSE, NONE,  0,	     0 },
-/*fb*/	{ "sti",   FALSE, NONE,  0,	     0 },
-/*fc*/	{ "cld",   FALSE, NONE,  0,	     0 },
-/*fd*/	{ "std",   FALSE, NONE,  0,	     0 },
-/*fe*/	{ "",	   TRUE,  NONE,  0,	     db_Grp4 },
-/*ff*/	{ "",	   TRUE,  NONE,  0,	     db_Grp5 },
-};
-
-static const struct inst db_bad_inst = { "???", FALSE, NONE, 0, 0 };
-
-#define	f_mod(byte)	((byte)>>6)
-#define	f_reg(byte)	(((byte)>>3)&0x7)
-#define	f_rm(byte)	((byte)&0x7)
-
-#define	sib_ss(byte)	((byte)>>6)
-#define	sib_index(byte)	(((byte)>>3)&0x7)
-#define	sib_base(byte)	((byte)&0x7)
-
-struct i_addr {
-	int		is_reg;	/* if reg, reg number is in 'disp' */
-	int		disp;
-	const char *	base;
-	const char *	index;
-	int		ss;
-	int		defss;	/* default stack segment */
-};
-
-static const char * const db_index_reg_16[8] = {
-	"%bx,%si",
-	"%bx,%di",
-	"%bp,%si",
-	"%bp,%di",
-	"%si",
-	"%di",
-	"%bp",
-	"%bx"
-};
-
-static const char * const db_reg[3][8] = {
-	{ "%al",  "%cl",  "%dl",  "%bl",  "%ah",  "%ch",  "%dh",  "%bh" },
-	{ "%ax",  "%cx",  "%dx",  "%bx",  "%sp",  "%bp",  "%si",  "%di" },
-	{ "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi" }
-};
-
-static const char * const db_seg_reg[8] = {
-	"%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", ""
-};
-
-/*
- * lengths for size attributes
- */
-static const int db_lengths[] = {
-	1,	/* BYTE */
-	2,	/* WORD */
-	4,	/* LONG */
-	8,	/* QUAD */
-	4,	/* SNGL */
-	8,	/* DBLR */
-	10,	/* EXTR */
-};
-
-#define	get_value_inc(result, loc, size, is_signed) \
-	result = db_get_value((loc), (size), (is_signed)); \
-	(loc) += (size);
-
-static db_addr_t
-		db_disasm_esc (db_addr_t loc, int inst, int short_addr,
-				   int size, const char *seg);
-static void	db_print_address (const char *seg, int size,
-				      struct i_addr *addrp);
-static db_addr_t
-		db_read_address (db_addr_t loc, int short_addr,
-				     int regmodrm, struct i_addr *addrp);
-
-/*
- * Read address at location and return updated location.
- */
-static db_addr_t
-db_read_address(db_addr_t loc, int short_addr, int regmodrm,
-		struct i_addr *addrp)
-{
-	int		mod, rm, sib, index, disp;
-
-	mod = f_mod(regmodrm);
-	rm  = f_rm(regmodrm);
-
-	if (mod == 3) {
-	    addrp->is_reg = TRUE;
-	    addrp->disp = rm;
-	    return (loc);
-	}
-	addrp->is_reg = FALSE;
-	addrp->index = NULL;
-	addrp->ss = 0;
-	addrp->defss = 0;
-
-	if (short_addr) {
-	    if (mod != 3) {
-		switch(rm) {
-		case 0:
-		case 1:
-		    addrp->index = "%bx";
-		    break;
-		case 2:
-		case 3:
-		    addrp->index = "%bp";
-		    addrp->defss = 1;
-		    break;
-		case 6:
-		    if (mod == 1 || mod == 2)
-			addrp->defss = 1;
-		    break;
-		}
-	    }
-	    switch (mod) {
-		case 0:
-		    if (rm == 6) {
-			get_value_inc(disp, loc, 2, FALSE);
-			addrp->disp = disp;
-			addrp->base = NULL;
-		    }
-		    else {
-			addrp->disp = 0;
-			addrp->base = db_index_reg_16[rm];
-		    }
-		    break;
-		case 1:
-		    get_value_inc(disp, loc, 1, TRUE);
-		    disp &= 0xFFFF;
-		    addrp->disp = disp;
-		    addrp->base = db_index_reg_16[rm];
-		    break;
-		case 2:
-		    get_value_inc(disp, loc, 2, FALSE);
-		    addrp->disp = disp;
-		    addrp->base = db_index_reg_16[rm];
-		    break;
-	    }
-	} else {
-	    if (mod != 3 && rm == 4) {
-		get_value_inc(sib, loc, 1, FALSE);
-		rm = sib_base(sib);
-		index = sib_index(sib);
-		if (index != 4)
-		    addrp->index = db_reg[LONG][index];
-		addrp->ss = sib_ss(sib);
-	    }
-
-	    switch (mod) {
-		case 0:
-		    if (rm == 5) {
-			get_value_inc(addrp->disp, loc, 4, FALSE);
-			addrp->base = NULL;
-		    }
-		    else {
-			addrp->disp = 0;
-			addrp->base = db_reg[LONG][rm];
-		    }
-		    break;
-
-		case 1:
-		    get_value_inc(disp, loc, 1, TRUE);
-		    addrp->disp = disp;
-		    addrp->base = db_reg[LONG][rm];
-		    break;
-
-		case 2:
-		    get_value_inc(disp, loc, 4, FALSE);
-		    addrp->disp = disp;
-		    addrp->base = db_reg[LONG][rm];
-		    break;
-	    }
-	}
-	return (loc);
-}
-
-static void
-db_print_address(const char *seg, int size, struct i_addr *addrp)
-{
-	if (addrp->is_reg) {
-	    db_printf("%s", db_reg[size][addrp->disp]);
-	    return;
-	}
-
-	if (seg) {
-	    db_printf("%s:", seg);
-	} else if (addrp->defss) {
-	    db_printf("%%ss:");
-	}
-
-	db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY);
-	if (addrp->base != NULL || addrp->index != NULL) {
-	    db_printf("(");
-	    if (addrp->base)
-		db_printf("%s", addrp->base);
-	    if (addrp->index)
-		db_printf(",%s,%d", addrp->index, 1<<addrp->ss);
-	    db_printf(")");
-	}
-}
-
-/*
- * Disassemble floating-point ("escape") instruction
- * and return updated location.
- */
-static db_addr_t
-db_disasm_esc(db_addr_t loc, int inst, int short_addr, int size,
-	      const char *seg)
-{
-	int		regmodrm;
-	const struct finst *	fp;
-	int		mod;
-	struct i_addr	address;
-	const char *	name;
-
-	get_value_inc(regmodrm, loc, 1, FALSE);
-	fp = &db_Esc_inst[inst - 0xd8][f_reg(regmodrm)];
-	mod = f_mod(regmodrm);
-	if (mod != 3) {
-	    if (*fp->f_name == '\0') {
-		db_printf("<bad instruction>");
-		return (loc);
-	    }
-	    /*
-	     * Normal address modes.
-	     */
-	    loc = db_read_address(loc, short_addr, regmodrm, &address);
-	    db_printf("%s", fp->f_name);
-	    switch(fp->f_size) {
-		case SNGL:
-		    db_printf("s");
-		    break;
-		case DBLR:
-		    db_printf("l");
-		    break;
-		case EXTR:
-		    db_printf("t");
-		    break;
-		case WORD:
-		    db_printf("s");
-		    break;
-		case LONG:
-		    db_printf("l");
-		    break;
-		case QUAD:
-		    db_printf("q");
-		    break;
-		default:
-		    break;
-	    }
-	    db_printf("\t");
-	    db_print_address(seg, BYTE, &address);
-	}
-	else {
-	    /*
-	     * 'reg-reg' - special formats
-	     */
-	    switch (fp->f_rrmode) {
-		case op2(ST,STI):
-		    name = (fp->f_rrname) ? fp->f_rrname : fp->f_name;
-		    db_printf("%s\t%%st,%%st(%d)",name,f_rm(regmodrm));
-		    break;
-		case op2(STI,ST):
-		    name = (fp->f_rrname) ? fp->f_rrname : fp->f_name;
-		    db_printf("%s\t%%st(%d),%%st",name, f_rm(regmodrm));
-		    break;
-		case op1(STI):
-		    name = (fp->f_rrname) ? fp->f_rrname : fp->f_name;
-		    db_printf("%s\t%%st(%d)",name, f_rm(regmodrm));
-		    break;
-		case op1(X):
-		    name = ((const char * const *)fp->f_rrname)[f_rm(regmodrm)];
-		    if (*name == '\0')
-			goto bad;
-		    db_printf("%s", name);
-		    break;
-		case op1(XA):
-		    name = ((const char * const *)fp->f_rrname)[f_rm(regmodrm)];
-		    if (*name == '\0')
-			goto bad;
-		    db_printf("%s\t%%ax", name);
-		    break;
-		default:
-		bad:
-		    db_printf("<bad instruction>");
-		    break;
-	    }
-	}
-
-	return (loc);
-}
-
-/*
- * Disassemble instruction at 'loc'.  'altfmt' specifies an
- * (optional) alternate format.  Return the address of the
- * start of the next instruction.
- *
- * If regs is non-null it may be used to obtain context, such as
- * whether we are in word or long mode.
- */
-db_addr_t
-db_disasm(db_addr_t loc, boolean_t altfmt, db_regs_t *regs)
-{
-	int	inst;
-	int	size;
-	int	short_addr;
-	const char *	seg;
-	const struct inst *	ip;
-	const char *	i_name;
-	int	i_size;
-	int	i_mode;
-	int	regmodrm = 0;
-	boolean_t	first;
-	int	displ;
-	int	prefix;
-	int	imm;
-	int	imm2;
-	int	len;
-	struct i_addr	address;
-
-	get_value_inc(inst, loc, 1, FALSE);
-	seg = NULL;
-
-#ifdef _GDT_ARRAY_PRESENT
-	if (regs && gdt[mycpu->gd_cpuid * NGDT + IDXSEL(regs->tf_cs & 0xFFFF)].sd.sd_def32 == 0) {
-		size = WORD;
-		short_addr = TRUE;
-	} else
-#endif
-	{
-		size = LONG;
-		short_addr = FALSE;
-	}
-
-	/*
-	 * Get prefixes
-	 */
-	prefix = TRUE;
-	do {
-	    switch (inst) {
-		case 0x66:		/* data16 */
-		    size = WORD;
-		    break;
-		case 0x67:
-		    short_addr = TRUE;
-		    break;
-		case 0x26:
-		    seg = "%es";
-		    break;
-		case 0x36:
-		    seg = "%ss";
-		    break;
-		case 0x2e:
-		    seg = "%cs";
-		    break;
-		case 0x3e:
-		    seg = "%ds";
-		    break;
-		case 0x64:
-		    seg = "%fs";
-		    break;
-		case 0x65:
-		    seg = "%gs";
-		    break;
-		case 0xf0:
-		    db_printf("lock ");
-		    break;
-		case 0xf2:
-		    db_printf("repne ");
-		    break;
-		case 0xf3:
-		    db_printf("repe ");	/* XXX repe VS rep */
-		    break;
-		default:
-		    prefix = FALSE;
-		    break;
-	    }
-	    if (prefix) {
-		get_value_inc(inst, loc, 1, FALSE);
-	    }
-	} while (prefix);
-
-	if (inst >= 0xd8 && inst <= 0xdf) {
-	    loc = db_disasm_esc(loc, inst, short_addr, size, seg);
-	    db_printf("\n");
-	    return (loc);
-	}
-
-	if (inst == 0x0f) {
-	    get_value_inc(inst, loc, 1, FALSE);
-	    ip = db_inst_0f[inst>>4];
-	    if (ip == NULL) {
-		ip = &db_bad_inst;
-	    }
-	    else {
-		ip = &ip[inst&0xf];
-	    }
-	}
-	else
-	    ip = &db_inst_table[inst];
-
-	if (ip->i_has_modrm) {
-	    get_value_inc(regmodrm, loc, 1, FALSE);
-	    loc = db_read_address(loc, short_addr, regmodrm, &address);
-	}
-
-	i_name = ip->i_name;
-	i_size = ip->i_size;
-	i_mode = ip->i_mode;
-
-	if (ip->i_extra == db_Grp1 || ip->i_extra == db_Grp2 ||
-	    ip->i_extra == db_Grp6 || ip->i_extra == db_Grp7 ||
-	    ip->i_extra == db_Grp8 || ip->i_extra == db_Grp9) {
-	    i_name = ((const char * const *)ip->i_extra)[f_reg(regmodrm)];
-	}
-	else if (ip->i_extra == db_Grp3) {
-	    ip = ip->i_extra;
-	    ip = &ip[f_reg(regmodrm)];
-	    i_name = ip->i_name;
-	    i_mode = ip->i_mode;
-	}
-	else if (ip->i_extra == db_Grp4 || ip->i_extra == db_Grp5) {
-	    ip = ip->i_extra;
-	    ip = &ip[f_reg(regmodrm)];
-	    i_name = ip->i_name;
-	    i_mode = ip->i_mode;
-	    i_size = ip->i_size;
-	}
-
-	if (i_size == SDEP) {
-	    if (size == WORD)
-		db_printf("%s", i_name);
-	    else
-		db_printf("%s", (const char *)ip->i_extra);
-	}
-	else {
-	    db_printf("%s", i_name);
-	    if (i_size != NONE) {
-		if (i_size == BYTE) {
-		    db_printf("b");
-		    size = BYTE;
-		}
-		else if (i_size == WORD) {
-		    db_printf("w");
-		    size = WORD;
-		}
-		else if (size == WORD)
-		    db_printf("w");
-		else
-		    db_printf("l");
-	    }
-	}
-	db_printf("\t");
-	for (first = TRUE;
-	     i_mode != 0;
-	     i_mode >>= 8, first = FALSE)
-	{
-	    if (!first)
-		db_printf(",");
-
-	    switch (i_mode & 0xFF) {
-
-		case E:
-		    db_print_address(seg, size, &address);
-		    break;
-
-		case Eind:
-		    db_printf("*");
-		    db_print_address(seg, size, &address);
-		    break;
-
-		case El:
-		    db_print_address(seg, LONG, &address);
-		    break;
-
-		case Ew:
-		    db_print_address(seg, WORD, &address);
-		    break;
-
-		case Eb:
-		    db_print_address(seg, BYTE, &address);
-		    break;
-
-		case R:
-		    db_printf("%s", db_reg[size][f_reg(regmodrm)]);
-		    break;
-
-		case Rw:
-		    db_printf("%s", db_reg[WORD][f_reg(regmodrm)]);
-		    break;
-
-		case Ri:
-		    db_printf("%s", db_reg[size][f_rm(inst)]);
-		    break;
-
-		case Ril:
-		    db_printf("%s", db_reg[LONG][f_rm(inst)]);
-		    break;
-
-		case S:
-		    db_printf("%s", db_seg_reg[f_reg(regmodrm)]);
-		    break;
-
-		case Si:
-		    db_printf("%s", db_seg_reg[f_reg(inst)]);
-		    break;
-
-		case A:
-		    db_printf("%s", db_reg[size][0]);	/* acc */
-		    break;
-
-		case BX:
-		    if (seg)
-			db_printf("%s:", seg);
-		    db_printf("(%s)", short_addr ? "%bx" : "%ebx");
-		    break;
-
-		case CL:
-		    db_printf("%%cl");
-		    break;
-
-		case DX:
-		    db_printf("%%dx");
-		    break;
-
-		case SI:
-		    if (seg)
-			db_printf("%s:", seg);
-		    db_printf("(%s)", short_addr ? "%si" : "%esi");
-		    break;
-
-		case DI:
-		    db_printf("%%es:(%s)", short_addr ? "%di" : "%edi");
-		    break;
-
-		case CR:
-		    db_printf("%%cr%d", f_reg(regmodrm));
-		    break;
-
-		case DR:
-		    db_printf("%%dr%d", f_reg(regmodrm));
-		    break;
-
-		case TR:
-		    db_printf("%%tr%d", f_reg(regmodrm));
-		    break;
-
-		case I:
-		    len = db_lengths[size];
-		    get_value_inc(imm, loc, len, FALSE);
-		    db_printf("$%#r", imm);
-		    break;
-
-		case Is:
-		    len = db_lengths[size];
-		    get_value_inc(imm, loc, len, FALSE);
-		    db_printf("$%+#r", imm);
-		    break;
-
-		case Ib:
-		    get_value_inc(imm, loc, 1, FALSE);
-		    db_printf("$%#r", imm);
-		    break;
-
-		case Iba:
-		    get_value_inc(imm, loc, 1, FALSE);
-		    if (imm != 0x0a)
-			db_printf("$%#r", imm);
-		    break;
-
-		case Ibs:
-		    get_value_inc(imm, loc, 1, TRUE);
-		    if (size == WORD)
-			imm &= 0xFFFF;
-		    db_printf("$%+#r", imm);
-		    break;
-
-		case Iw:
-		    get_value_inc(imm, loc, 2, FALSE);
-		    db_printf("$%#r", imm);
-		    break;
-
-		case O:
-		    len = (short_addr ? 2 : 4);
-		    get_value_inc(displ, loc, len, FALSE);
-		    if (seg)
-			db_printf("%s:%+#r",seg, displ);
-		    else
-			db_printsym((db_addr_t)displ, DB_STGY_ANY);
-		    break;
-
-		case Db:
-		    get_value_inc(displ, loc, 1, TRUE);
-		    displ += loc;
-		    if (size == WORD)
-			displ &= 0xFFFF;
-		    db_printsym((db_addr_t)displ, DB_STGY_XTRN);
-		    break;
-
-		case Dl:
-		    len = db_lengths[size];
-		    get_value_inc(displ, loc, len, FALSE);
-		    displ += loc;
-		    if (size == WORD)
-			displ &= 0xFFFF;
-		    db_printsym((db_addr_t)displ, DB_STGY_XTRN);
-		    break;
-
-		case o1:
-		    db_printf("$1");
-		    break;
-
-		case o3:
-		    db_printf("$3");
-		    break;
-
-		case OS:
-		    len = db_lengths[size];
-		    get_value_inc(imm, loc, len, FALSE);	/* offset */
-		    get_value_inc(imm2, loc, 2, FALSE);	/* segment */
-		    db_printf("$%#r,%#r", imm2, imm);
-		    break;
-	    }
-	}
-	db_printf("\n");
-	return (loc);
-}
diff --git a/sys/cpu/i386/misc/elf_machdep.c b/sys/cpu/i386/misc/elf_machdep.c
deleted file mode 100644
index bb3311e..0000000
--- a/sys/cpu/i386/misc/elf_machdep.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*-
- * Copyright 1996-1998 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/i386/i386/elf_machdep.c,v 1.8 1999/12/21 11:14:02 eivind Exp $
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/linker.h>
-#include <sys/sysent.h>
-#include <sys/imgact_elf.h>
-#include <sys/syscall.h>
-#include <sys/signalvar.h>
-#include <sys/vnode.h>
-#include <machine/elf.h>
-#include <machine/md_var.h>
-
-static struct sysentvec elf32_dragonfly_sysvec = {
-        .sv_size	= SYS_MAXSYSCALL,
-        .sv_table	= sysent,
-        .sv_mask	= -1,
-        .sv_sigsize	= 0,
-        .sv_sigtbl	= NULL,
-        .sv_errsize	= 0,
-        .sv_errtbl	= NULL,
-        .sv_transtrap	= NULL,
-        .sv_fixup	= __elfN(dragonfly_fixup),
-        .sv_sendsig	= sendsig,
-        .sv_sigcode	= sigcode,
-        .sv_szsigcode	= &szsigcode,
-        .sv_prepsyscall	= NULL,
-	.sv_name	= "DragonFly ELF32",
-	.sv_coredump	= __elfN(coredump),
-	.sv_imgact_try	= NULL,
-	.sv_minsigstksz	= MINSIGSTKSZ,
-};
-
-static Elf32_Brandinfo dragonfly_brand_info = {
-        .brand		= ELFOSABI_NONE,
-        .machine	= EM_386,
-        .compat_3_brand	= "DragonFly",
-        .emul_path	= NULL,
-        .interp_path	= "/libexec/ld-elf.so.2",
-        .sysvec		= &elf32_dragonfly_sysvec,
-        .interp_newpath	= NULL,
-        .flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE,
-        .brand_note	= &elf32_dragonfly_brandnote,
-};
-
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
-        (sysinit_cfunc_t) elf32_insert_brand_entry,
-        &dragonfly_brand_info);
-
-static Elf32_Brandinfo freebsd_brand_info = {
-        .brand		= ELFOSABI_FREEBSD,
-        .machine	= EM_386,
-        .compat_3_brand	= "FreeBSD",
-        .emul_path	= NULL,
-        .interp_path	= "/usr/libexec/ld-elf.so.1",
-        .sysvec		= &elf32_dragonfly_sysvec,
-        .interp_newpath	= NULL,
-        .flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE,
-        .brand_note	= &elf32_freebsd_brandnote,
-};
-
-SYSINIT(elf32_fbsd, SI_SUB_EXEC, SI_ORDER_ANY,
-        (sysinit_cfunc_t) elf32_insert_brand_entry,
-        &freebsd_brand_info);
-
-/* Process one elf relocation with addend. */
-static int
-elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
-    int type, int local, elf_lookup_fn lookup)
-{
-	Elf_Addr *where;
-	Elf_Addr addr;
-	Elf_Addr addend;
-	Elf_Word rtype, symidx;
-	const Elf_Rel *rel;
-	const Elf_Rela *rela;
-
-	switch (type) {
-	case ELF_RELOC_REL:
-		rel = (const Elf_Rel *)data;
-		where = (Elf_Addr *) (relocbase + rel->r_offset);
-		addend = *where;
-		rtype = ELF_R_TYPE(rel->r_info);
-		symidx = ELF_R_SYM(rel->r_info);
-		break;
-	case ELF_RELOC_RELA:
-		rela = (const Elf_Rela *)data;
-		where = (Elf_Addr *) (relocbase + rela->r_offset);
-		addend = rela->r_addend;
-		rtype = ELF_R_TYPE(rela->r_info);
-		symidx = ELF_R_SYM(rela->r_info);
-		break;
-	default:
-		panic("unknown reloc type %d", type);
-	}
-
-	if (local) {
-		if (rtype == R_386_RELATIVE) {	/* A + B */
-			addr = elf_relocaddr(lf, relocbase + addend);
-			if (*where != addr)
-				*where = addr;
-		}
-		return (0);
-	}
-
-	switch (rtype) {
-
-		case R_386_NONE:	/* none */
-			break;
-
-		case R_386_32:		/* S + A */
-			if (lookup(lf, symidx, 1, &addr))
-				return -1;
-			addr += addend;
-			if (*where != addr)
-				*where = addr;
-			break;
-
-		case R_386_PC32:	/* S + A - P */
-			if (lookup(lf, symidx, 1, &addr))
-				return -1;
-			addr += addend - (Elf_Addr)where;
-			if (*where != addr)
-				*where = addr;
-			break;
-
-		case R_386_COPY:	/* none */
-			/*
-			 * There shouldn't be copy relocations in kernel
-			 * objects.
-			 */
-			kprintf("kldload: unexpected R_COPY relocation\n");
-			return -1;
-			break;
-
-		case R_386_GLOB_DAT:	/* S */
-			if (lookup(lf, symidx, 1, &addr))
-				return -1;
-			if (*where != addr)
-				*where = addr;
-			break;
-
-		case R_386_RELATIVE:
-			break;
-
-		default:
-			kprintf("kldload: unexpected relocation type %d\n",
-			       rtype);
-			return -1;
-	}
-	return(0);
-}
-
-int
-elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type,
-    elf_lookup_fn lookup)
-{
-
-	return (elf_reloc_internal(lf, relocbase, data, type, 0, lookup));
-}
-
-int
-elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data,
-    int type, elf_lookup_fn lookup)
-{
-
-	return (elf_reloc_internal(lf, relocbase, data, type, 1, lookup));
-}
diff --git a/sys/cpu/i386/misc/i386-gdbstub.c b/sys/cpu/i386/misc/i386-gdbstub.c
deleted file mode 100644
index 0be084e..0000000
--- a/sys/cpu/i386/misc/i386-gdbstub.c
+++ /dev/null
@@ -1,612 +0,0 @@
-/****************************************************************************
-
-		THIS SOFTWARE IS NOT COPYRIGHTED
-
-   HP offers the following for use in the public domain.  HP makes no
-   warranty with regard to the software or its performance and the
-   user accepts the software "AS IS" with all faults.
-
-   HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
-   TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-****************************************************************************/
-
-/****************************************************************************
- *  Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
- *
- *  Module name: remcom.c $
- *  Revision: 1.34 $
- *  Date: 91/03/09 12:29:49 $
- *  Contributor:     Lake Stevens Instrument Division$
- *
- *  Description:     low level support for gdb debugger. $
- *
- *  Considerations:  only works on target hardware $
- *
- *  Written by:      Glenn Engel $
- *  ModuleState:     Experimental $
- *
- *  NOTES:           See Below $
- *
- *  Modified for FreeBSD by Stu Grossman.
- *
- *  To enable debugger support, two things need to happen.  One, a
- *  call to set_debug_traps() is necessary in order to allow any breakpoints
- *  or error conditions to be properly intercepted and reported to gdb.
- *  Two, a breakpoint needs to be generated to begin communication.  This
- *  is most easily accomplished by a call to breakpoint().  Breakpoint()
- *  simulates a breakpoint by executing a trap #1.
- *
- *  The external function exceptionHandler() is
- *  used to attach a specific handler to a specific 386 vector number.
- *  It should use the same privilege level it runs at.  It should
- *  install it as an interrupt gate so that interrupts are masked
- *  while the handler runs.
- *  Also, need to assign exceptionHook and oldExceptionHook.
- *
- *  Because gdb will sometimes write to the stack area to execute function
- *  calls, this program cannot rely on using the supervisor stack so it
- *  uses its own stack area reserved in the int array remcomStack.
- *
- *************
- *
- *    The following gdb commands are supported:
- *
- * command          function                               Return value
- *
- *    g             return the value of the CPU registers  hex data or ENN
- *    G             set the value of the CPU registers     OK or ENN
- *
- *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA      hex data or ENN
- *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA      OK or ENN
- *
- *    c             Resume at current address              SNN   ( signal NN)
- *    cAA..AA       Continue at address AA..AA             SNN
- *
- *    s             Step one instruction                   SNN
- *    sAA..AA       Step one instruction from AA..AA       SNN
- *
- *    k             kill
- *
- *    ?             What was the last sigval ?             SNN   (signal NN)
- *
- *    D             detach                                 OK
- *
- * All commands and responses are sent with a packet which includes a
- * checksum.  A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum>    :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer.  '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host:                  Reply:
- * $m0,10#2a               +$00010203040506070809101112131415#42
- *
- ****************************************************************************/
-/* $FreeBSD: src/sys/i386/i386/i386-gdbstub.c,v 1.13.2.1 2000/08/03 00:54:41 peter Exp $ */
-/* $DragonFly: src/sys/cpu/i386/misc/i386-gdbstub.c,v 1.7 2007/05/07 05:21:37 dillon Exp $ */
-
-#include "opt_ddb.h"
-
-#include <sys/param.h>
-#include <sys/reboot.h>
-#include <sys/systm.h>
-#include <sys/cons.h>
-
-#include <ddb/ddb.h>
-
-#include <setjmp.h>
-
-void		gdb_handle_exception (db_regs_t *, int, int);
-
-/************************************************************************/
-
-extern jmp_buf	db_jmpbuf;
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-/* Create private copies of common functions used by the stub.  This prevents
-   nasty interactions between app code and the stub (for instance if user steps
-   into strlen, etc..) */
-
-#define strlen	gdb_strlen
-#define strcpy	gdb_strcpy
-
-static int
-strlen (const char *s)
-{
-  const char *s1 = s;
-
-  while (*s1++ != '\000');
-
-  return s1 - s;
-}
-
-static char *
-strcpy (char *dst, const char *src)
-{
-  char *retval = dst;
-
-  while ((*dst++ = *src++) != '\000');
-
-  return retval;
-}
-
-static int
-putDebugChar (int c)		/* write a single character      */
-{
-  if (gdb_tab == NULL)
-	return 0;
-  gdb_tab->cn_putc(gdb_tab->cn_gdbprivate, c);
-  return 1;
-}
-
-static int
-getDebugChar (void)		/* read and return a single char */
-{
-  if (gdb_tab == NULL)
-	return -1;
-  return gdb_tab->cn_getc(gdb_tab->cn_gdbprivate);
-}
-
-static const char hexchars[]="0123456789abcdef";
-
-static int
-hex(char ch)
-{
-  if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
-  if ((ch >= '0') && (ch <= '9')) return (ch-'0');
-  if ((ch >= 'A') && (ch <= 'F')) return (ch-'A'+10);
-  return (-1);
-}
-
-/* scan for the sequence $<data>#<checksum>     */
-static void
-getpacket (char *buffer)
-{
-  unsigned char checksum;
-  unsigned char xmitcsum;
-  int i;
-  int count;
-  unsigned char ch;
-
-  do
-    {
-      /* wait around for the start character, ignore all other characters */
-
-      while ((ch = (getDebugChar () & 0x7f)) != '$');
-
-      checksum = 0;
-      xmitcsum = -1;
-
-      count = 0;
-
-      /* now, read until a # or end of buffer is found */
-
-      while (count < BUFMAX)
-	{
-	  ch = getDebugChar () & 0x7f;
-	  if (ch == '#')
-	    break;
-	  checksum = checksum + ch;
-	  buffer[count] = ch;
-	  count = count + 1;
-	}
-      buffer[count] = 0;
-
-      if (ch == '#')
-	{
-	  xmitcsum = hex (getDebugChar () & 0x7f) << 4;
-	  xmitcsum += hex (getDebugChar () & 0x7f);
-
-	  if (checksum != xmitcsum)
-	    putDebugChar ('-');  /* failed checksum */
-	  else
-	    {
-	      putDebugChar ('+'); /* successful transfer */
-	      /* if a sequence char is present, reply the sequence ID */
-	      if (buffer[2] == ':')
-		{
-		  putDebugChar (buffer[0]);
-		  putDebugChar (buffer[1]);
-
-		  /* remove sequence chars from buffer */
-
-		  count = strlen (buffer);
-		  for (i=3; i <= count; i++)
-		    buffer[i-3] = buffer[i];
-		}
-	    }
-	}
-    }
-  while (checksum != xmitcsum);
-}
-
-/* send the packet in buffer.  */
-
-static void
-putpacket (char *buffer)
-{
-  unsigned char checksum;
-  int count;
-  unsigned char ch;
-
-  /*  $<packet info>#<checksum>. */
-  do
-    {
-/*
- * This is a non-standard hack to allow use of the serial console for
- * operation as well as debugging.  Simply turn on 'remotechat' in gdb.
- *
- * This extension is not part of the Cygnus protocol, is kinda gross,
- * but gets the job done.
- */
-#ifdef GDB_REMOTE_CHAT
-      putDebugChar ('|');
-      putDebugChar ('|');
-      putDebugChar ('|');
-      putDebugChar ('|');
-#endif
-      putDebugChar ('$');
-      checksum = 0;
-      count = 0;
-
-      while ((ch=buffer[count]) != 0)
-	{
-	  putDebugChar (ch);
-	  checksum += ch;
-	  count += 1;
-	}
-
-      putDebugChar ('#');
-      putDebugChar (hexchars[checksum >> 4]);
-      putDebugChar (hexchars[checksum & 0xf]);
-    }
-  while ((getDebugChar () & 0x7f) != '+');
-}
-
-static char  remcomInBuffer[BUFMAX];
-static char  remcomOutBuffer[BUFMAX];
-
-static int
-get_char (vm_offset_t addr)
-{
-  char data;
-
-  if (setjmp (db_jmpbuf))
-    return -1;
-
-  db_read_bytes (addr, 1, &data);
-
-  return data & 0xff;
-}
-
-static int
-set_char (vm_offset_t addr, int val)
-{
-  char data;
-
-  if (setjmp (db_jmpbuf))
-    return -1;
-
-  data = val;
-
-  db_write_bytes (addr, 1, &data);
-  return 0;
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-
-static char *
-mem2hex (vm_offset_t mem, char *buf, int count)
-{
-      int i;
-      int ch;
-
-      for (i=0;i<count;i++) {
-          ch = get_char (mem++);
-	  if (ch == -1)
-	    return NULL;
-          *buf++ = hexchars[ch >> 4];
-          *buf++ = hexchars[ch % 16];
-      }
-      *buf = 0;
-      return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-static char *
-hex2mem (char *buf, vm_offset_t mem, int count)
-{
-      int i;
-      int ch;
-      int rv;
-
-      for (i=0;i<count;i++) {
-          ch = hex(*buf++) << 4;
-          ch = ch + hex(*buf++);
-          rv = set_char (mem++, ch);
-	  if (rv == -1)
-	    return NULL;
-      }
-      return(buf);
-}
-
-/* this function takes the 386 exception vector and attempts to
-   translate this number into a unix compatible signal value */
-static int
-computeSignal (int exceptionVector)
-{
-  int sigval;
-  switch (exceptionVector & ~T_USER)
-    {
-    case 0: sigval = 8; break; /* divide by zero */
-    case 1: sigval = 5; break; /* debug exception */
-    case 3: sigval = 5; break; /* breakpoint */
-    case 4: sigval = 16; break; /* into instruction (overflow) */
-    case 5: sigval = 16; break; /* bound instruction */
-    case 6: sigval = 4; break; /* Invalid opcode */
-    case 7: sigval = 8; break; /* coprocessor not available */
-    case 8: sigval = 7; break; /* double fault */
-    case 9: sigval = 11; break; /* coprocessor segment overrun */
-    case 10: sigval = 5; break; /* Invalid TSS (also single-step) */
-    case 11: sigval = 11; break; /* Segment not present */
-    case 12: sigval = 11; break; /* stack exception */
-    case 13: sigval = 11; break; /* general protection */
-    case 14: sigval = 11; break; /* page fault */
-    case 16: sigval = 7; break; /* coprocessor error */
-    default:
-      sigval = 7;         /* "software generated"*/
-    }
-  return (sigval);
-}
-
-/*
- * While we find nice hex chars, build an int.
- * Return number of chars processed.
- */
-
-static int
-hexToInt(char **ptr, int *intValue)
-{
-    int numChars = 0;
-    int hexValue;
-
-    *intValue = 0;
-
-    while (**ptr)
-    {
-        hexValue = hex(**ptr);
-        if (hexValue >=0)
-        {
-            *intValue = (*intValue <<4) | hexValue;
-            numChars ++;
-        }
-        else
-            break;
-
-        (*ptr)++;
-    }
-
-    return (numChars);
-}
-
-#define NUMREGBYTES (sizeof registers)
-#define PC 8
-#define SP 4
-#define FP 5
-#define NUM_REGS 14
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void
-gdb_handle_exception (db_regs_t *raw_regs, int type, int code)
-{
-  int    sigval;
-  int    addr, length;
-  char * ptr;
-  struct i386regs {
-    unsigned int eax;
-    unsigned int ecx;
-    unsigned int edx;
-    unsigned int ebx;
-    unsigned int esp;
-    unsigned int ebp;
-    unsigned int esi;
-    unsigned int edi;
-    unsigned int eip;
-    unsigned int eflags;
-    unsigned int cs;
-    unsigned int ss;
-    unsigned int ds;
-    unsigned int es;
-  };
-  struct i386regs registers;
-
-  registers.eax = raw_regs->tf_eax;
-  registers.ebx = raw_regs->tf_ebx;
-  registers.ecx = raw_regs->tf_ecx;
-  registers.edx = raw_regs->tf_edx;
-
-  registers.esp = raw_regs->tf_esp;
-  registers.ebp = raw_regs->tf_ebp;
-  registers.esi = raw_regs->tf_esi;
-  registers.edi = raw_regs->tf_edi;
-
-  registers.eip = raw_regs->tf_eip;
-  registers.eflags = raw_regs->tf_eflags;
-
-  registers.cs = raw_regs->tf_cs;
-  registers.ss = raw_regs->tf_ss;
-  registers.ds = raw_regs->tf_ds;
-  registers.es = raw_regs->tf_es;
-
-  /* reply to host that an exception has occurred */
-  sigval = computeSignal (type);
-  ptr = remcomOutBuffer;
-
-  *ptr++ = 'T';
-  *ptr++ = hexchars[sigval >> 4];
-  *ptr++ = hexchars[sigval & 0xf];
-
-  *ptr++ = hexchars[PC >> 4];
-  *ptr++ = hexchars[PC & 0xf];
-  *ptr++ = ':';
-  ptr = mem2hex ((vm_offset_t)&registers.eip, ptr, 4);
-  *ptr++ = ';';
-
-  *ptr++ = hexchars[FP >> 4];
-  *ptr++ = hexchars[FP & 0xf];
-  *ptr++ = ':';
-  ptr = mem2hex ((vm_offset_t)&registers.ebp, ptr, 4);
-  *ptr++ = ';';
-
-  *ptr++ = hexchars[SP >> 4];
-  *ptr++ = hexchars[SP & 0xf];
-  *ptr++ = ':';
-  ptr = mem2hex ((vm_offset_t)&registers.esp, ptr, 4);
-  *ptr++ = ';';
-
-  *ptr++ = 0;
-
-  putpacket (remcomOutBuffer);
-
-  while (1)
-    {
-      remcomOutBuffer[0] = 0;
-
-      getpacket (remcomInBuffer);
-      switch (remcomInBuffer[0]) 
-	{
-	case '?':
-	  remcomOutBuffer[0] = 'S';
-	  remcomOutBuffer[1] = hexchars[sigval >> 4];
-	  remcomOutBuffer[2] = hexchars[sigval % 16];
-	  remcomOutBuffer[3] = 0;
-	  break;
-
-	case 'D':		/* detach; say OK and turn off gdb */
-	  putpacket(remcomOutBuffer);
-	  boothowto &= ~RB_GDB;
-	  return;
-
-	case 'g':		/* return the value of the CPU registers */
-	  mem2hex ((vm_offset_t)&registers, remcomOutBuffer, NUMREGBYTES);
-	  break;
-
-	case 'G':		/* set the value of the CPU registers - return OK */
-	  hex2mem (&remcomInBuffer[1], (vm_offset_t)&registers, NUMREGBYTES);
-	  strcpy (remcomOutBuffer, "OK");
-	  break;
-
-	case 'P':		/* Set the value of one register */
-	  {
-	    int regno;
-
-	    ptr = &remcomInBuffer[1];
-
-	    if (hexToInt (&ptr, &regno)
-		&& *ptr++ == '='
-		&& regno < NUM_REGS)
-	      {
-		hex2mem (ptr, (vm_offset_t)&registers + regno * 4, 4);
-		strcpy(remcomOutBuffer,"OK");
-	      }
-	    else
-	      strcpy (remcomOutBuffer, "P01");
-	    break;
-	  }
-	case 'm':	/* mAA..AA,LLLL  Read LLLL bytes at address AA..AA */
-	  /* Try to read %x,%x.  */
-
-	  ptr = &remcomInBuffer[1];
-
-	  if (hexToInt (&ptr, &addr)
-	      && *(ptr++) == ','
-	      && hexToInt (&ptr, &length))
-	    {
-	      if (mem2hex((vm_offset_t) addr, remcomOutBuffer, length) == NULL)
-		strcpy (remcomOutBuffer, "E03");
-	      break;
-	    }
-	  else
-	    strcpy (remcomOutBuffer, "E01");
-	  break;
-
-	case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
-
-	  /* Try to read '%x,%x:'.  */
-
-	  ptr = &remcomInBuffer[1];
-
-	  if (hexToInt(&ptr,&addr)
-	      && *(ptr++) == ','
-	      && hexToInt(&ptr, &length)
-	      && *(ptr++) == ':')
-	    {
-	      if (hex2mem(ptr, (vm_offset_t) addr, length) == NULL)
-		strcpy (remcomOutBuffer, "E03");
-	      else
-		strcpy (remcomOutBuffer, "OK");
-	    }
-	  else
-	    strcpy (remcomOutBuffer, "E02");
-	  break;
-
-	  /* cAA..AA    Continue at address AA..AA(optional) */
-	  /* sAA..AA   Step one instruction from AA..AA(optional) */
-	case 'c' :
-	case 's' :
-	  /* try to read optional parameter, pc unchanged if no parm */
-
-	  ptr = &remcomInBuffer[1];
-	  if (hexToInt(&ptr,&addr))
-	    registers.eip = addr;
-
-
-	  /* set the trace bit if we're stepping */
-	  if (remcomInBuffer[0] == 's')
-	    registers.eflags |= PSL_T;
-	  else
-	    registers.eflags &= ~PSL_T;
-
-	  raw_regs->tf_eax = registers.eax;
-	  raw_regs->tf_ebx = registers.ebx;
-	  raw_regs->tf_ecx = registers.ecx;
-	  raw_regs->tf_edx = registers.edx;
-
-	  raw_regs->tf_esp = registers.esp;
-	  raw_regs->tf_ebp = registers.ebp;
-	  raw_regs->tf_esi = registers.esi;
-	  raw_regs->tf_edi = registers.edi;
-
-	  raw_regs->tf_eip = registers.eip;
-	  raw_regs->tf_eflags = registers.eflags;
-
-	  raw_regs->tf_cs = registers.cs;
-	  raw_regs->tf_ss = registers.ss;
-	  raw_regs->tf_ds = registers.ds;
-	  raw_regs->tf_es = registers.es;
-	  return;
-
-	} /* switch */
-
-      /* reply to the request */
-      putpacket (remcomOutBuffer);
-    }
-}
-
diff --git a/sys/cpu/i386/misc/in_cksum2.s b/sys/cpu/i386/misc/in_cksum2.s
deleted file mode 100644
index f850935..0000000
--- a/sys/cpu/i386/misc/in_cksum2.s
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2003,2004 The DragonFly Project.  All rights reserved.
- * 
- * This code is derived from software contributed to The DragonFly Project
- * by Matthew Dillon <dillon@backplane.com>
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * 
- * $DragonFly: src/sys/cpu/i386/misc/in_cksum2.s,v 1.5 2006/10/25 20:55:51 dillon Exp $
- */
-
-#include <machine/asmacros.h>		/* miscellaneous asm macros */
-
-#include "assym.s"
-
-	.text
-
-	/*
-	 * asm_ones32(32bitalignedbuffer, numberof32bitwords)
-	 *
-	 * Returns the 32 bit one complement partial checksum.  This is 
-	 * basically a 1's complement checksum without the inversion (~)
-	 * at the end.  A 32 bit value is returned.  If the caller is 
-	 * calculating a 16 bit 1's complement checksum the caller must
-	 * collapse the 32 bit return value via:
-	 *
-	 *	result = (result >> 16) + (result & 0xFFFF)
-	 *	if (result > 0xFFFF)
-	 *	    result -= 0xFFFF;	<<< same as (result + 1) & 0xFFFF
-	 *				    within the range of result.
-	 * Note that worst case 0xFFFFFFFF + 0xFFFFFFFF = 0xFFFFFFFE + CARRY,
-	 * so no double-carry ever occurs.
-	 */
-	.p2align 4
-ENTRY(asm_ones32)
-	movl	4(%esp),%edx	/* %edx = buffer pointer */
-	movl	8(%esp),%ecx	/* %ecx = counter */
-	subl	%eax,%eax	/* %eax = checksum */
-	cmpl	$5,%ecx
-	jl	2f
-1:
-	subl	$5,%ecx
-	addl	(%edx),%eax
-	adcl	4(%edx),%eax
-	adcl	8(%edx),%eax
-	adcl	12(%edx),%eax
-	adcl	16(%edx),%eax
-	adcl	$0,%eax
-	addl	$20,%edx
-	cmpl	$5,%ecx
-	jge	1b
-2:
-	testl	%ecx,%ecx
-	je	4f
-3:
-	addl	(%edx),%eax
-	adcl	$0,%eax
-	addl	$4,%edx
-	decl	%ecx
-	jnz	3b
-4:
-	ret
diff --git a/sys/cpu/i386/misc/ktr.c b/sys/cpu/i386/misc/ktr.c
deleted file mode 100644
index 69cfbb1..0000000
--- a/sys/cpu/i386/misc/ktr.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
- * 
- * This code is derived from software contributed to The DragonFly Project
- * by Matthew Dillon <dillon@backplane.com>
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/*
- * Kernel tracepoint facility.
- */
-
-#include "opt_ktr.h"
-
-#include <sys/param.h>
-#include <sys/cons.h>
-#include <sys/kernel.h>
-#include <sys/libkern.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-#include <sys/ktr.h>
-
-/*
- * This routine fills in the ktr_caller1 and ktr_caller2 fields by
- * tracing back through the kernel stack to locate the stack frames
- * and return addresses.
- *
- *
- *	[first argument]
- *	[retpc]
- *	[frameptr]		-> points to caller's frame pointer
- * sp ->[junk]
- */
-
-static __inline 
-void **
-FRAMEUP(void **frameptr)
-{
-    void **newframeptr;
-
-    newframeptr = (void **)frameptr[0];
-    if (((uintptr_t)newframeptr ^ (uintptr_t)frameptr) & ~16383)
-	newframeptr = frameptr;
-    return(newframeptr);
-}
-
-void
-cpu_ktr_caller(struct ktr_entry *_ktr)
-{
-    struct ktr_entry *ktr;
-    void **frameptr;
-
-    frameptr = (void **)&_ktr - 2;	/* frame, retpc to ktr_log */
-    ktr = _ktr;
-    frameptr = FRAMEUP(frameptr);	/* frame, retpc to traced function */
-    frameptr = FRAMEUP(frameptr);	/* frame, caller1 of traced function */
-    ktr->ktr_caller1 = frameptr[1];
-    frameptr = FRAMEUP(frameptr);	/* frame, caller2 of caller1 */
-    ktr->ktr_caller2 = frameptr[1];
-}
-
diff --git a/sys/cpu/i386/misc/lwbuf.c b/sys/cpu/i386/misc/lwbuf.c
deleted file mode 100644
index 904ea96..0000000
--- a/sys/cpu/i386/misc/lwbuf.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2010 by The DragonFly Project and Samuel J. Greear.
- * All rights reserved.
- *
- * This code is derived from software contributed to The DragonFly Project
- * by Samuel J. Greear <sjg@thesjg.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific, prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/kernel.h>
-#include <sys/objcache.h>
-#include <sys/sysctl.h>
-#include <sys/param.h>
-#include <sys/serialize.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_page.h>
-#include <cpu/lwbuf.h>
-#include <machine/globaldata.h>
-#include <machine/atomic.h>
-#include <machine/param.h>
-#include <sys/thread.h>
-
-static void lwbuf_init(void *);
-SYSINIT(sock_lwb, SI_BOOT2_MACHDEP, SI_ORDER_ANY, lwbuf_init, NULL);
-
-static struct objcache *lwbuf_cache;
-
-MALLOC_DEFINE(M_LWBUF, "lwbuf", "Lightweight buffers");
-struct objcache_malloc_args lwbuf_malloc_args =
-	    { sizeof(struct lwbuf), M_LWBUF };
-
-/* Number of pages of KVA to allocate at boot per cpu (1MB) */
-static int lwbuf_reserve_pages = 256;
-static int lwbuf_count;
-static int lwbuf_kva_bytes;
-
-SYSCTL_INT(_kern_ipc, OID_AUTO, lwbuf_reserve, CTLFLAG_RD,
-           &lwbuf_reserve_pages, 0,
-           "Number of pre-allocated lightweight buffers");
-SYSCTL_INT(_kern_ipc, OID_AUTO, lwbuf_count, CTLFLAG_RD,
-	   &lwbuf_count, 0,
-	   "Currently allocated lightweight buffers");
-SYSCTL_INT(_kern_ipc, OID_AUTO, lwbuf_kva_bytes, CTLFLAG_RD,
-	   &lwbuf_kva_bytes, 0,
-	   "Currently used KVA for lightweight buffers");
-
-static boolean_t
-lwbuf_cache_ctor(void *obj, void *pdata, int ocflags)
-{
-    struct lwbuf *lwb = (struct lwbuf *)obj;
-
-    lwb->m = NULL;
-    lwb->cpumask = 0;
-    lwb->kva = kmem_alloc_nofault(&kernel_map, PAGE_SIZE, PAGE_SIZE);
-    if (lwb->kva == 0)
-        return (FALSE);
-    atomic_add_int(&lwbuf_kva_bytes, PAGE_SIZE);
-
-    return (TRUE);
-}
-
-/*
- * Destructor for lwb.  Note that we must remove any pmap entries
- * created with pmap_kenter() to prevent them from being misinterpreted
- * as managed pages which would cause kernel_pmap.pm_stats.resident_count
- * to get out of whack.
- */
-static void
-lwbuf_cache_dtor(void *obj, void *pdata)
-{
-    struct lwbuf *lwb = (struct lwbuf *)obj;
-
-    KKASSERT(lwb->kva != 0);
-    pmap_kremove_quick(lwb->kva);
-    kmem_free(&kernel_map, lwb->kva, PAGE_SIZE);
-    lwb->kva = 0;
-    atomic_add_int(&lwbuf_kva_bytes, -PAGE_SIZE);
-}
-
-static void
-lwbuf_init(void *arg)
-{
-    lwbuf_cache = objcache_create("lwbuf", 0, 0,
-        lwbuf_cache_ctor, lwbuf_cache_dtor, NULL,
-        objcache_malloc_alloc, objcache_malloc_free,
-        &lwbuf_malloc_args);
-}
-
-struct lwbuf *
-lwbuf_alloc(vm_page_t m, struct lwbuf *lwb_dummy __unused)
-{
-    struct mdglobaldata *gd = mdcpu;
-    struct lwbuf *lwb;
-
-    lwb = objcache_get(lwbuf_cache, M_WAITOK);
-    KKASSERT(lwb->m == NULL);
-    lwb->m = m;
-    lwb->cpumask = gd->mi.gd_cpumask;
-    pmap_kenter_quick(lwb->kva, m->phys_addr);
-    atomic_add_int(&lwbuf_count, 1);
-
-    return (lwb);
-}
-
-void
-lwbuf_free(struct lwbuf *lwb)
-{
-    KKASSERT(lwb->m != NULL);
-    lwb->m = NULL;
-    lwb->cpumask = 0;
-    objcache_put(lwbuf_cache, lwb);
-    atomic_add_int(&lwbuf_count, -1);
-}
-
-void
-lwbuf_set_global(struct lwbuf *lwb)
-{
-    if (lwb->cpumask != (cpumask_t)-1) {
-	pmap_kenter_sync(lwb->kva);
-	lwb->cpumask = (cpumask_t)-1;
-    }
-}
-
-static vm_offset_t
-_lwbuf_kva(struct lwbuf *lwb, struct mdglobaldata *gd)
-{
-    pmap_kenter_sync_quick(lwb->kva);
-
-    ATOMIC_CPUMASK_ORBIT(lwb->cpumask, gd->mi.gd_cpuid);
-
-    return (lwb->kva);
-}
-
-__inline vm_offset_t
-lwbuf_kva(struct lwbuf *lwb)
-{
-    struct mdglobaldata *gd = mdcpu;
-
-    if (CPUMASK_TESTBIT(lwb->cpumask, gd->mi.gd_cpuid))
-        return (lwb->kva);
-
-    return (_lwbuf_kva(lwb, gd));
-}
diff --git a/sys/cpu/i386/misc/monitor.s b/sys/cpu/i386/misc/monitor.s
deleted file mode 100644
index 3682546..0000000
--- a/sys/cpu/i386/misc/monitor.s
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2010 The DragonFly Project. All rights reserved.
- * All rights reserved.
- *
- * This code is derived from software contributed to The DragonFly Project
- * by Venkatesh Srinivas <me@endeavour.zapto.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of The DragonFly Project nor the names of its
- *    contributors may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asmacros.h>
-#include <machine/cputypes.h>
-#include <machine/pmap.h>
-#include <machine/specialreg.h>
-
-#include "assym.s"
-
-	.text
-
-/*
- * void cpu_mmw_pause_int(int *addr, int oldval, int cstate, int intrbrk)
- * void cpu_mmw_pause_long(long *addr, long oldval, int cstate, int intrbrk)
- */
-ENTRY(cpu_mmw_pause_int)
-ENTRY(cpu_mmw_pause_long)
-	movl	4(%esp), %eax
-	movl	8(%esp), %ecx
-
-	cmpl	(%eax), %ecx
-	jne	1f
-
-	pushl	%ebx
-	movl	%ecx, %ebx
-	xorl	%ecx, %ecx
-	xorl	%edx, %edx
-	monitor
-	cmpl	(%eax), %ebx
-	jne	2f
-	movl	12(%esp), %eax
-	movl	16(%esp), %ecx
-	mwait
-2:
-	popl	%ebx
-1:
-	ret
-- 
2.5.3

