summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2009-11-10 20:17:15 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2009-11-10 20:18:05 +0200
commitc2d64f84c2babb287552965efe39a759075d22c2 (patch)
tree535e7b2e27b75852fa75aa65c80ca46a72916b82
parent2faaaf64da47d301f3e7247c47be2bd854c497ca (diff)
lot of clean up
- remove lot of unused code - add debug mode to autoconf - minor clean ups Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--.gitignore6
-rw-r--r--configure.ac22
-rw-r--r--include/libx86.h (renamed from src/libx86.h)0
-rw-r--r--src/Makefile37
-rw-r--r--src/Makefile.am6
-rw-r--r--src/thunk.c87
-rw-r--r--src/x86-common.h13
-rw-r--r--src/x86emu/include/fpu_regs.h112
-rw-r--r--src/x86emu/include/regs.h330
-rw-r--r--src/x86emu/include/types.h107
-rw-r--r--src/x86emu/include/x86emu.h194
-rw-r--r--src/x86emu/include/xf86int10.h213
-rw-r--r--src/x86emu/include/xf86x86emu.h51
-rw-r--r--src/x86emu/makefile63
-rw-r--r--src/x86emu/makefile.linux63
15 files changed, 79 insertions, 1225 deletions
diff --git a/.gitignore b/.gitignore
index ff80d2f..2b1030a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,7 @@ x86emu/sys.o
Makefile
Makefile.in
aclocal.m4
-autom4te.cache/
+autom4te.cache
config.guess
config.h
config.h.in
@@ -26,8 +26,8 @@ install-sh
libtool
ltmain.sh
missing
-src/.deps/
-src/.libs/
+src/.deps
+src/.libs
src/Makefile.in
src/libx86.la
src/lrmi.lo
diff --git a/configure.ac b/configure.ac
index 582105d..0089702 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@ AC_PROG_CC
AC_PROG_LIBTOOL
-AC_ARG_ENABLE(x86emu, AS_HELP_STRING([--with-x86emu], [Build with x86emu (default: disabled)]), [X86EMU=$enableval], [X86EMU=no])
+AC_ARG_ENABLE(x86emu, AS_HELP_STRING([--enable-x86emu], [Build with x86emu (default: disabled)]), [X86EMU=$enableval], [X86EMU=no])
AM_CONDITIONAL(X86EMU, [test "x$X86EMU" = xyes])
if test "x$X86EMU" = xyes; then
@@ -42,14 +42,13 @@ if test "x$X86EMU" = xyes; then
AC_SUBST(X86EMU)
fi
-#AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Build with debug messages
-#(default: disabled)]), [DEBUG=$enableval], [DEBUG=no])
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Build with debug message (default: disabled)]), [DEBUG=$enableval], [DEBUG=no])
-#AM_CONDITIONAL(DEBUG, [test "x$DEBUG" = xyes])
-#if test "x$DEBUG" = xyes; then
-# AC_DEFINE(DEBUG, 1, [Build stub functions])
-# AC_SUBST(DEBUG)
-#fi
+AM_CONDITIONAL(DEBUG, [test "x$DEBUG" = xyes])
+if test "x$DEBUG" = xyes; then
+ AC_DEFINE(DEBUG, 1, [Build stub functions])
+ AC_SUBST(DEBUG)
+fi
AC_OUTPUT([Makefile
@@ -62,12 +61,9 @@ echo ""
echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
echo ""
echo " Configuration"
-echo " x86emu support......: ${have_x86emu}"
-echo ""
-echo " Used CFLAGS:"
-echo " CPPFLAGS............: ${CPPFLAGS}"
+echo " x86emu support......: ${X86EMU}"
+echo " DEBUG...............: ${DEBUG}"
echo " CFLAGS..............: ${CFLAGS}"
-echo " Warning CFLAGS......: ${CWARNFLAGS}"
echo ""
echo " Installation:"
echo " Prefix..............: ${prefix}"
diff --git a/src/libx86.h b/include/libx86.h
index 182864f..182864f 100644
--- a/src/libx86.h
+++ b/include/libx86.h
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 27426eb..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-OBJECTS = x86-common.o
-CFLAGS = -O2 -Wall -DDEBUG -g
-
-ifeq ($(BACKEND), x86emu)
- OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
- x86emu/ops.o x86emu/ops2.o x86emu/prim_ops.o x86emu/sys.o
-else
- OBJECTS += lrmi.o
-endif
-
-ifeq ($(LIBRARY), shared)
- CFLAGS += -fPIC
-endif
-
-default:
- $(MAKE) LIBRARY=static static
- $(MAKE) objclean
- $(MAKE) LIBRARY=shared shared
-
-static: $(OBJECTS)
- $(AR) cru libx86.a $(OBJECTS)
-
-shared: $(OBJECTS)
- $(CC) $(CFLAGS) -o libx86.so.1 -shared -Wl,-soname,libx86.so.1 $(OBJECTS)
-
-objclean:
- $(MAKE) -C x86emu clean
- rm -f *.o *~
-
-clean: objclean
- rm -f *.so.1 *.a
-
-install: libx86.so.1
- install -D libx86.so.1 $(DESTDIR)/usr/lib/libx86.so.1
- install -D libx86.a $(DESTDIR)/usr/lib/libx86.a
- ln -sf /usr/lib/libx86.so.1 $(DESTDIR)/usr/lib/libx86.so
- install -D lrmi.h $(DESTDIR)/usr/include/libx86.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 6bbef23..ea1d8b9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,12 @@
lib_LTLIBRARIES = libx86.la
+if X86EMU
+libx86_la_SOURCES = x86-common.c thunk.c x86emu/decode.c x86emu/debug.c \
+ x86emu/fpu.c x86emu/ops.c x86emu/ops2.c \
+ x86emu/prim_ops.c x86emu/sys.c
+else
libx86_la_SOURCES = x86-common.c lrmi.c
+endif
INCLUDES = -I$(top_srcdir)/include
diff --git a/src/thunk.c b/src/thunk.c
index 9999e4a..b2b365f 100644
--- a/src/thunk.c
+++ b/src/thunk.c
@@ -1,34 +1,69 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/io.h>
+#include <stdio.h>
#include <string.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-#define SHMERRORPTR (pointer)(-1)
-
-#define _INT10_PRIVATE
-#include "x86emu/include/xf86int10.h"
-#include "x86emu/include/x86emu.h"
-#include "x86emu/include/xf86x86emu.h"
+#include "x86emu/x86emu/x86emu.h"
#include "libx86.h"
#include "x86-common.h"
-#define DEBUG
-#define ALLOC_ENTRIES(x) (V_RAM - 1)
-#define TRUE 1
-#define FALSE 0
+#define M _X86EMU_env
+
+#define X86_EAX _X86EMU_env.x86.R_EAX
+#define X86_EBX _X86EMU_env.x86.R_EBX
+#define X86_ECX _X86EMU_env.x86.R_ECX
+#define X86_EDX _X86EMU_env.x86.R_EDX
+#define X86_ESI _X86EMU_env.x86.R_ESI
+#define X86_EDI _X86EMU_env.x86.R_EDI
+#define X86_EBP _X86EMU_env.x86.R_EBP
+#define X86_EIP _X86EMU_env.x86.R_EIP
+#define X86_ESP _X86EMU_env.x86.R_ESP
+#define X86_EFLAGS _X86EMU_env.x86.R_EFLG
+
+#define X86_FLAGS _X86EMU_env.x86.R_FLG
+#define X86_AX _X86EMU_env.x86.R_AX
+#define X86_BX _X86EMU_env.x86.R_BX
+#define X86_CX _X86EMU_env.x86.R_CX
+#define X86_DX _X86EMU_env.x86.R_DX
+#define X86_SI _X86EMU_env.x86.R_SI
+#define X86_DI _X86EMU_env.x86.R_DI
+#define X86_BP _X86EMU_env.x86.R_BP
+#define X86_IP _X86EMU_env.x86.R_IP
+#define X86_SP _X86EMU_env.x86.R_SP
+#define X86_CS _X86EMU_env.x86.R_CS
+#define X86_DS _X86EMU_env.x86.R_DS
+#define X86_ES _X86EMU_env.x86.R_ES
+#define X86_SS _X86EMU_env.x86.R_SS
+#define X86_FS _X86EMU_env.x86.R_FS
+#define X86_GS _X86EMU_env.x86.R_GS
+
+#define X86_AL _X86EMU_env.x86.R_AL
+#define X86_BL _X86EMU_env.x86.R_BL
+#define X86_CL _X86EMU_env.x86.R_CL
+#define X86_DL _X86EMU_env.x86.R_DL
+
+#define X86_AH _X86EMU_env.x86.R_AH
+#define X86_BH _X86EMU_env.x86.R_BH
+#define X86_CH _X86EMU_env.x86.R_CH
+#define X86_DH _X86EMU_env.x86.R_DH
+
+
+#define CARD8 unsigned char
+#define CARD16 unsigned short
+#define CARD32 unsigned long
+#define pointer void *
+#define IOADDRESS void *
+#define Bool int
+
+#define X86_TF_MASK 0x00000100
+#define X86_IF_MASK 0x00000200
+#define X86_IOPL_MASK 0x00003000
+#define X86_NT_MASK 0x00004000
+#define X86_VM_MASK 0x00020000
+#define X86_AC_MASK 0x00040000
+#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
+#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
+#define X86_ID_MASK 0x00200000
+
+#define SHMERRORPTR (pointer)(-1)
#define __BUILDIO(bwl,bw,type) \
static inline void out##bwl##_local(unsigned long port, unsigned type value) { __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
diff --git a/src/x86-common.h b/src/x86-common.h
index 90e21f6..99bf883 100644
--- a/src/x86-common.h
+++ b/src/x86-common.h
@@ -24,19 +24,6 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include "libx86.h"
-
-#define REAL_MEM_BASE ((void *)0x10000)
-#define REAL_MEM_SIZE 0x40000
-#define REAL_MEM_BLOCKS 0x100
void *LRMI_alloc_real(int size);
void LRMI_free_real(void *m);
diff --git a/src/x86emu/include/fpu_regs.h b/src/x86emu/include/fpu_regs.h
deleted file mode 100644
index a125075..0000000
--- a/src/x86emu/include/fpu_regs.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for FPU register definitions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/fpu_regs.h,v 1.2 2003/10/22 20:03:05 tsi Exp $ */
-
-#ifndef __X86EMU_FPU_REGS_H
-#define __X86EMU_FPU_REGS_H
-
-#ifdef X86_FPU_SUPPORT
-
-/* Basic 8087 register can hold any of the following values: */
-
-union x86_fpu_reg_u {
- s8 tenbytes[10];
- double dval;
- float fval;
- s16 sval;
- s32 lval;
- };
-
-struct x86_fpu_reg {
- union x86_fpu_reg_u reg;
- char tag;
- };
-
-/*
- * Since we are not going to worry about the problems of aliasing
- * registers, every time a register is modified, its result type is
- * set in the tag fields for that register. If some operation
- * attempts to access the type in a way inconsistent with its current
- * storage format, then we flag the operation. If common, we'll
- * attempt the conversion.
- */
-
-#define X86_FPU_VALID 0x80
-#define X86_FPU_REGTYP(r) ((r) & 0x7F)
-
-#define X86_FPU_WORD 0x0
-#define X86_FPU_SHORT 0x1
-#define X86_FPU_LONG 0x2
-#define X86_FPU_FLOAT 0x3
-#define X86_FPU_DOUBLE 0x4
-#define X86_FPU_LDBL 0x5
-#define X86_FPU_BSD 0x6
-
-#define X86_FPU_STKTOP 0
-
-struct x86_fpu_registers {
- struct x86_fpu_reg x86_fpu_stack[8];
- int x86_fpu_flags;
- int x86_fpu_config; /* rounding modes, etc. */
- short x86_fpu_tos, x86_fpu_bos;
- };
-
-/*
- * There are two versions of the following macro.
- *
- * One version is for opcode D9, for which there are more than 32
- * instructions encoded in the second byte of the opcode.
- *
- * The other version, deals with all the other 7 i87 opcodes, for
- * which there are only 32 strings needed to describe the
- * instructions.
- */
-
-#endif /* X86_FPU_SUPPORT */
-
-#ifdef DEBUG
-# define DECODE_PRINTINSTR32(t,mod,rh,rl) \
- DECODE_PRINTF(t[(mod<<3)+(rh)]);
-# define DECODE_PRINTINSTR256(t,mod,rh,rl) \
- DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
-#else
-# define DECODE_PRINTINSTR32(t,mod,rh,rl)
-# define DECODE_PRINTINSTR256(t,mod,rh,rl)
-#endif
-
-#endif /* __X86EMU_FPU_REGS_H */
diff --git a/src/x86emu/include/regs.h b/src/x86emu/include/regs.h
deleted file mode 100644
index fba2991..0000000
--- a/src/x86emu/include/regs.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for x86 register definitions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.5 2003/10/22 20:03:05 tsi Exp $ */
-
-#ifndef __X86EMU_REGS_H
-#define __X86EMU_REGS_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/*
- * General EAX, EBX, ECX, EDX type registers. Note that for
- * portability, and speed, the issue of byte swapping is not addressed
- * in the registers. All registers are stored in the default format
- * available on the host machine. The only critical issue is that the
- * registers should line up EXACTLY in the same manner as they do in
- * the 386. That is:
- *
- * EAX & 0xff === AL
- * EAX & 0xffff == AX
- *
- * etc. The result is that alot of the calculations can then be
- * done using the native instruction set fully.
- */
-
-#ifdef __BIG_ENDIAN__
-
-typedef struct {
- u32 e_reg;
- } I32_reg_t;
-
-typedef struct {
- u16 filler0, x_reg;
- } I16_reg_t;
-
-typedef struct {
- u8 filler0, filler1, h_reg, l_reg;
- } I8_reg_t;
-
-#else /* !__BIG_ENDIAN__ */
-
-typedef struct {
- u32 e_reg;
- } I32_reg_t;
-
-typedef struct {
- u16 x_reg;
- } I16_reg_t;
-
-typedef struct {
- u8 l_reg, h_reg;
- } I8_reg_t;
-
-#endif /* BIG_ENDIAN */
-
-typedef union {
- I32_reg_t I32_reg;
- I16_reg_t I16_reg;
- I8_reg_t I8_reg;
- } i386_general_register;
-
-struct i386_general_regs {
- i386_general_register A, B, C, D;
- };
-
-typedef struct i386_general_regs Gen_reg_t;
-
-struct i386_special_regs {
- i386_general_register SP, BP, SI, DI, IP;
- u32 FLAGS;
- };
-
-/*
- * Segment registers here represent the 16 bit quantities
- * CS, DS, ES, SS.
- */
-
-struct i386_segment_regs {
- u16 CS, DS, SS, ES, FS, GS;
- };
-
-/* 8 bit registers */
-#define R_AH gen.A.I8_reg.h_reg
-#define R_AL gen.A.I8_reg.l_reg
-#define R_BH gen.B.I8_reg.h_reg
-#define R_BL gen.B.I8_reg.l_reg
-#define R_CH gen.C.I8_reg.h_reg
-#define R_CL gen.C.I8_reg.l_reg
-#define R_DH gen.D.I8_reg.h_reg
-#define R_DL gen.D.I8_reg.l_reg
-
-/* 16 bit registers */
-#define R_AX gen.A.I16_reg.x_reg
-#define R_BX gen.B.I16_reg.x_reg
-#define R_CX gen.C.I16_reg.x_reg
-#define R_DX gen.D.I16_reg.x_reg
-
-/* 32 bit extended registers */
-#define R_EAX gen.A.I32_reg.e_reg
-#define R_EBX gen.B.I32_reg.e_reg
-#define R_ECX gen.C.I32_reg.e_reg
-#define R_EDX gen.D.I32_reg.e_reg
-
-/* special registers */
-#define R_SP spc.SP.I16_reg.x_reg
-#define R_BP spc.BP.I16_reg.x_reg
-#define R_SI spc.SI.I16_reg.x_reg
-#define R_DI spc.DI.I16_reg.x_reg
-#define R_IP spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_SP spc.SP.I16_reg.x_reg
-#define R_BP spc.BP.I16_reg.x_reg
-#define R_SI spc.SI.I16_reg.x_reg
-#define R_DI spc.DI.I16_reg.x_reg
-#define R_IP spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_ESP spc.SP.I32_reg.e_reg
-#define R_EBP spc.BP.I32_reg.e_reg
-#define R_ESI spc.SI.I32_reg.e_reg
-#define R_EDI spc.DI.I32_reg.e_reg
-#define R_EIP spc.IP.I32_reg.e_reg
-#define R_EFLG spc.FLAGS
-
-/* segment registers */
-#define R_CS seg.CS
-#define R_DS seg.DS
-#define R_SS seg.SS
-#define R_ES seg.ES
-#define R_FS seg.FS
-#define R_GS seg.GS
-
-/* flag conditions */
-#define FB_CF 0x0001 /* CARRY flag */
-#define FB_PF 0x0004 /* PARITY flag */
-#define FB_AF 0x0010 /* AUX flag */
-#define FB_ZF 0x0040 /* ZERO flag */
-#define FB_SF 0x0080 /* SIGN flag */
-#define FB_TF 0x0100 /* TRAP flag */
-#define FB_IF 0x0200 /* INTERRUPT ENABLE flag */
-#define FB_DF 0x0400 /* DIR flag */
-#define FB_OF 0x0800 /* OVERFLOW flag */
-
-/* 80286 and above always have bit#1 set */
-#define F_ALWAYS_ON (0x0002) /* flag bits always on */
-
-/*
- * Define a mask for only those flag bits we will ever pass back
- * (via PUSHF)
- */
-#define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF)
-
-/* following bits masked in to a 16bit quantity */
-
-#define F_CF 0x0001 /* CARRY flag */
-#define F_PF 0x0004 /* PARITY flag */
-#define F_AF 0x0010 /* AUX flag */
-#define F_ZF 0x0040 /* ZERO flag */
-#define F_SF 0x0080 /* SIGN flag */
-#define F_TF 0x0100 /* TRAP flag */
-#define F_IF 0x0200 /* INTERRUPT ENABLE flag */
-#define F_DF 0x0400 /* DIR flag */
-#define F_OF 0x0800 /* OVERFLOW flag */
-
-#define TOGGLE_FLAG(flag) (M.x86.R_FLG ^= (flag))
-#define SET_FLAG(flag) (M.x86.R_FLG |= (flag))
-#define CLEAR_FLAG(flag) (M.x86.R_FLG &= ~(flag))
-#define ACCESS_FLAG(flag) (M.x86.R_FLG & (flag))
-#define CLEARALL_FLAG(m) (M.x86.R_FLG = 0)
-
-#define CONDITIONAL_SET_FLAG(COND,FLAG) \
- if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG)
-
-#define F_PF_CALC 0x010000 /* PARITY flag has been calced */
-#define F_ZF_CALC 0x020000 /* ZERO flag has been calced */
-#define F_SF_CALC 0x040000 /* SIGN flag has been calced */
-
-#define F_ALL_CALC 0xff0000 /* All have been calced */
-
-/*
- * Emulator machine state.
- * Segment usage control.
- */
-#define SYSMODE_SEG_DS_SS 0x00000001
-#define SYSMODE_SEGOVR_CS 0x00000002
-#define SYSMODE_SEGOVR_DS 0x00000004
-#define SYSMODE_SEGOVR_ES 0x00000008
-#define SYSMODE_SEGOVR_FS 0x00000010
-#define SYSMODE_SEGOVR_GS 0x00000020
-#define SYSMODE_SEGOVR_SS 0x00000040
-#define SYSMODE_PREFIX_REPE 0x00000080
-#define SYSMODE_PREFIX_REPNE 0x00000100
-#define SYSMODE_PREFIX_DATA 0x00000200
-#define SYSMODE_PREFIX_ADDR 0x00000400
-#define SYSMODE_INTR_PENDING 0x10000000
-#define SYSMODE_EXTRN_INTR 0x20000000
-#define SYSMODE_HALTED 0x40000000
-
-#define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS | \
- SYSMODE_SEGOVR_CS | \
- SYSMODE_SEGOVR_DS | \
- SYSMODE_SEGOVR_ES | \
- SYSMODE_SEGOVR_FS | \
- SYSMODE_SEGOVR_GS | \
- SYSMODE_SEGOVR_SS)
-#define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS | \
- SYSMODE_SEGOVR_CS | \
- SYSMODE_SEGOVR_DS | \
- SYSMODE_SEGOVR_ES | \
- SYSMODE_SEGOVR_FS | \
- SYSMODE_SEGOVR_GS | \
- SYSMODE_SEGOVR_SS | \
- SYSMODE_PREFIX_DATA | \
- SYSMODE_PREFIX_ADDR)
-
-#define INTR_SYNCH 0x1
-#define INTR_ASYNCH 0x2
-#define INTR_HALTED 0x4
-
-typedef struct {
- struct i386_general_regs gen;
- struct i386_special_regs spc;
- struct i386_segment_regs seg;
- /*
- * MODE contains information on:
- * REPE prefix 2 bits repe,repne
- * SEGMENT overrides 5 bits normal,DS,SS,CS,ES
- * Delayed flag set 3 bits (zero, signed, parity)
- * reserved 6 bits
- * interrupt # 8 bits instruction raised interrupt
- * BIOS video segregs 4 bits
- * Interrupt Pending 1 bits
- * Extern interrupt 1 bits
- * Halted 1 bits
- */
- u32 mode;
- volatile int intr; /* mask of pending interrupts */
- int debug;
-#ifdef DEBUG
- int check;
- u16 saved_ip;
- u16 saved_cs;
- int enc_pos;
- int enc_str_pos;
- char decode_buf[32]; /* encoded byte stream */
- char decoded_buf[256]; /* disassembled strings */
-#endif
- u8 intno;
- u8 __pad[3];
- } X86EMU_regs;
-
-/****************************************************************************
-REMARKS:
-Structure maintaining the emulator machine state.
-
-MEMBERS:
-mem_base - Base real mode memory for the emulator
-mem_size - Size of the real mode memory block for the emulator
-private - private data pointer
-x86 - X86 registers
-****************************************************************************/
-typedef struct {
- unsigned long mem_base;
- unsigned long mem_size;
- void* private;
- X86EMU_regs x86;
- } X86EMU_sysEnv;
-
-/*----------------------------- Global Variables --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Global emulator machine state.
- *
- * We keep it global to avoid pointer dereferences in the code for speed.
- */
-
-extern X86EMU_sysEnv _X86EMU_env;
-#define M _X86EMU_env
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-/* Function to log information at runtime */
-
-void printk(const char *fmt, ...);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_REGS_H */
diff --git a/src/x86emu/include/types.h b/src/x86emu/include/types.h
deleted file mode 100644
index 5232d10..0000000
--- a/src/x86emu/include/types.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for x86 emulator type definitions.
-*
-****************************************************************************/
-
-/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.6 2003/06/12 14:12:26 eich Exp $ */
-
-#ifndef __X86EMU_TYPES_H
-#define __X86EMU_TYPES_H
-
-#ifndef IN_MODULE
-#include <sys/types.h>
-#endif
-
-/*
- * The following kludge is an attempt to work around typedef conflicts with
- * <sys/types.h>.
- */
-#define u8 x86emuu8
-#define u16 x86emuu16
-#define u32 x86emuu32
-#define u64 x86emuu64
-#define s8 x86emus8
-#define s16 x86emus16
-#define s32 x86emus32
-#define s64 x86emus64
-#define uint x86emuuint
-#define sint x86emusint
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* Currently only for Linux/32bit */
-#undef __HAS_LONG_LONG__
-#if defined(__GNUC__) && !defined(NO_LONG_LONG)
-#define __HAS_LONG_LONG__
-#endif
-
-/* Taken from Xmd.h */
-#undef NUM32
-#if defined (_LP64) || \
- defined(__alpha) || defined(__alpha__) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- (defined(__hppa__) && defined(__LP64)) || \
- defined(__amd64__) || defined(amd64) || \
- (defined(__sgi) && (_MIPS_SZLONG == 64))
-#define NUM32 int
-#else
-#define NUM32 long
-#endif
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned NUM32 u32;
-#ifdef __HAS_LONG_LONG__
-typedef unsigned long long u64;
-#endif
-
-typedef char s8;
-typedef short s16;
-typedef NUM32 s32;
-#ifdef __HAS_LONG_LONG__
-typedef long long s64;
-#endif
-
-typedef unsigned int uint;
-typedef int sint;
-
-typedef u16 X86EMU_pioAddr;
-
-#undef NUM32
-
-#endif /* __X86EMU_TYPES_H */
diff --git a/src/x86emu/include/x86emu.h b/src/x86emu/include/x86emu.h
deleted file mode 100644
index d484eec..0000000
--- a/src/x86emu/include/x86emu.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for public specific functions.
-* Any application linking against us should only
-* include this header
-*
-****************************************************************************/
-/* $XFree86$ */
-
-#ifndef __X86EMU_X86EMU_H
-#define __X86EMU_X86EMU_H
-
-#ifdef SCITECH
-#include "scitech.h"
-#define X86API _ASMAPI
-#define X86APIP _ASMAPIP
-typedef int X86EMU_pioAddr;
-#else
-#include "types.h"
-#define X86API
-#define X86APIP *
-#endif
-#include "regs.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* #pragma pack(1) */ /* Don't pack structs with function pointers! */
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to programmed I/O functions used by the
-emulator. This is used so that the user program can hook all programmed
-I/O for the emulator to handled as necessary by the user program. By
-default the emulator contains simple functions that do not do access the
-hardware in any way. To allow the emualtor access the hardware, you will
-need to override the programmed I/O functions using the X86EMU_setupPioFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-inb - Function to read a byte from an I/O port
-inw - Function to read a word from an I/O port
-inl - Function to read a dword from an I/O port
-outb - Function to write a byte to an I/O port
-outw - Function to write a word to an I/O port
-outl - Function to write a dword to an I/O port
-****************************************************************************/
-typedef struct {
- u8 (X86APIP inb)(X86EMU_pioAddr addr);
- u16 (X86APIP inw)(X86EMU_pioAddr addr);
- u32 (X86APIP inl)(X86EMU_pioAddr addr);
- void (X86APIP outb)(X86EMU_pioAddr addr, u8 val);
- void (X86APIP outw)(X86EMU_pioAddr addr, u16 val);
- void (X86APIP outl)(X86EMU_pioAddr addr, u32 val);
- } X86EMU_pioFuncs;
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to memory access functions used by the
-emulator. This is used so that the user program can hook all memory
-access functions as necessary for the emulator. By default the emulator
-contains simple functions that only access the internal memory of the
-emulator. If you need specialised functions to handle access to different
-types of memory (ie: hardware framebuffer accesses and BIOS memory access
-etc), you will need to override this using the X86EMU_setupMemFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-rdb - Function to read a byte from an address
-rdw - Function to read a word from an address
-rdl - Function to read a dword from an address
-wrb - Function to write a byte to an address
-wrw - Function to write a word to an address
-wrl - Function to write a dword to an address
-****************************************************************************/
-typedef struct {
- u8 (X86APIP rdb)(u32 addr);
- u16 (X86APIP rdw)(u32 addr);
- u32 (X86APIP rdl)(u32 addr);
- void (X86APIP wrb)(u32 addr, u8 val);
- void (X86APIP wrw)(u32 addr, u16 val);
- void (X86APIP wrl)(u32 addr, u32 val);
- } X86EMU_memFuncs;
-
-/****************************************************************************
- Here are the default memory read and write
- function in case they are needed as fallbacks.
-***************************************************************************/
-extern u8 X86API rdb(u32 addr);
-extern u16 X86API rdw(u32 addr);
-extern u32 X86API rdl(u32 addr);
-extern void X86API wrb(u32 addr, u8 val);
-extern void X86API wrw(u32 addr, u16 val);
-extern void X86API wrl(u32 addr, u32 val);
-
-/* #pragma pack() */
-
-/*--------------------- type definitions -----------------------------------*/
-
-typedef void (X86APIP X86EMU_intrFuncs)(int num);
-extern X86EMU_intrFuncs _X86EMU_intrTab[256];
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-void X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
-void X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
-void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
-void X86EMU_prepareForInt(int num);
-
-/* decode.c */
-
-void X86EMU_exec(void);
-void X86EMU_halt_sys(void);
-
-#ifdef DEBUG
-#define HALT_SYS() \
- printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
- X86EMU_halt_sys()
-#else
-#define HALT_SYS() X86EMU_halt_sys()
-#endif
-
-/* Debug options */
-
-#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
-#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
-#define DEBUG_STEP_F 0x000004
-#define DEBUG_DISASSEMBLE_F 0x000008
-#define DEBUG_BREAK_F 0x000010
-#define DEBUG_SVC_F 0x000020
-#define DEBUG_FS_F 0x000080
-#define DEBUG_PROC_F 0x000100
-#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
-#define DEBUG_TRACECALL_F 0x000400
-#define DEBUG_INSTRUMENT_F 0x000800
-#define DEBUG_MEM_TRACE_F 0x001000
-#define DEBUG_IO_TRACE_F 0x002000
-#define DEBUG_TRACECALL_REGS_F 0x004000
-#define DEBUG_DECODE_NOPRINT_F 0x008000
-#define DEBUG_SAVE_IP_CS_F 0x010000
-#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
-
-void X86EMU_trace_regs(void);
-void X86EMU_trace_xregs(void);
-void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
-int X86EMU_trace_on(void);
-int X86EMU_trace_off(void);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_X86EMU_H */
diff --git a/src/x86emu/include/xf86int10.h b/src/x86emu/include/xf86int10.h
deleted file mode 100644
index 9c131dd..0000000
--- a/src/x86emu/include/xf86int10.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.23 2002/04/04 14:05:51 eich Exp $ */
-
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-
-#ifndef _XF86INT10_H
-#define _XF86INT10_H
-
-
-#define SEG_ADDR(x) (((x) >> 4) & 0x00F000)
-#define SEG_OFF(x) ((x) & 0x0FFFF)
-
-#define SET_BIOS_SCRATCH 0x1
-#define RESTORE_BIOS_SCRATCH 0x2
-
-#define CARD8 unsigned char
-#define CARD16 unsigned short
-#define CARD32 unsigned long
-#define pointer void *
-#define IOADDRESS void *
-#define Bool int
-
-#define X86_TF_MASK 0x00000100
-#define X86_IF_MASK 0x00000200
-#define X86_IOPL_MASK 0x00003000
-#define X86_NT_MASK 0x00004000
-#define X86_VM_MASK 0x00020000
-#define X86_AC_MASK 0x00040000
-#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
-#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
-#define X86_ID_MASK 0x00200000
-
-
-/* int10 info structure */
-typedef struct {
- int entityIndex;
- int scrnIndex;
- pointer cpuRegs;
- CARD16 BIOSseg;
- CARD16 inb40time;
- char * BIOSScratch;
- int Flags;
- pointer private;
- struct _int10Mem* mem;
- int num;
- int ax;
- int bx;
- int cx;
- int dx;
- int si;
- int di;
- int es;
- int bp;
- int flags;
- int stackseg;
- //PCITAG Tag;
- IOADDRESS ioBase;
-} xf86Int10InfoRec, *xf86Int10InfoPtr;
-
-typedef struct _int10Mem {
- CARD8(*rb)(xf86Int10InfoPtr, int);
- CARD16(*rw)(xf86Int10InfoPtr, int);
- CARD32(*rl)(xf86Int10InfoPtr, int);
- void(*wb)(xf86Int10InfoPtr, int, CARD8);
- void(*ww)(xf86Int10InfoPtr, int, CARD16);
- void(*wl)(xf86Int10InfoPtr, int, CARD32);
-} int10MemRec, *int10MemPtr;
-
-typedef struct {
- CARD8 save_msr;
- CARD8 save_pos102;
- CARD8 save_vse;
- CARD8 save_46e8;
-} legacyVGARec, *legacyVGAPtr;
-
-//typedef struct {
- //BusType bus;
- //union {
- //struct {
- //int bus;
- //int dev;
- //int func;
- ////} pci;
- //int legacy;
- //} location;
-////} xf86int10BiosLocation, *xf86int10BiosLocationPtr;
-
-/* OS dependent functions */
-xf86Int10InfoPtr xf86InitInt10(int entityIndex);
-xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags);
-void xf86FreeInt10(xf86Int10InfoPtr pInt);
-void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off);
-void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
-pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
-
-/* x86 executor related functions */
-void xf86ExecX86int10(xf86Int10InfoPtr pInt);
-
-#ifdef _INT10_PRIVATE
-
-#define I_S_DEFAULT_INT_VECT 0xFF065
-#define SYS_SIZE 0x100000
-#define SYS_BIOS 0xF0000
-#if 1
-#define BIOS_SIZE 0x10000
-#else /* a bug in DGUX requires this - let's try it */
-#define BIOS_SIZE (0x10000 - 1)
-#endif
-#define LOW_PAGE_SIZE 0x600
-#define V_RAM 0xA0000
-#define VRAM_SIZE 0x20000
-#define V_BIOS_SIZE 0x10000
-#define V_BIOS 0xC0000
-#define BIOS_SCRATCH_OFF 0x449
-#define BIOS_SCRATCH_END 0x466
-#define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1)
-#define HIGH_MEM V_BIOS
-#define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM)
-#define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg))
-#define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg))
-
-#define X86_TF_MASK 0x00000100
-#define X86_IF_MASK 0x00000200
-#define X86_IOPL_MASK 0x00003000
-#define X86_NT_MASK 0x00004000
-#define X86_VM_MASK 0x00020000
-#define X86_AC_MASK 0x00040000
-#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
-#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
-#define X86_ID_MASK 0x00200000
-
-#define MEM_RB(name, addr) (*name->mem->rb)(name, addr)
-#define MEM_RW(name, addr) (*name->mem->rw)(name, addr)
-#define MEM_RL(name, addr) (*name->mem->rl)(name, addr)
-#define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val)
-#define MEM_WW(addr, val) wrw(addr, val)
-#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
-
-/* OS dependent functions */
-Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
-/* x86 executor related functions */
-Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
-
-/* int.c */
-extern xf86Int10InfoPtr Int10Current;
-int int_handler(xf86Int10InfoPtr pInt);
-
-/* helper_exec.c */
-int setup_int(xf86Int10InfoPtr pInt);
-void finish_int(xf86Int10InfoPtr, int sig);
-CARD32 getIntVect(xf86Int10InfoPtr pInt, int num);
-void pushw(CARD16 val);
-int run_bios_int(int num, xf86Int10InfoPtr pInt);
-void dump_code(xf86Int10InfoPtr pInt);
-void dump_registers(xf86Int10InfoPtr pInt);
-void stack_trace(xf86Int10InfoPtr pInt);
-xf86Int10InfoPtr getInt10Rec(int entityIndex);
-CARD8 bios_checksum(CARD8 *start, int size);
-void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
-void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
-#if defined (_PC)
-void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
-#endif
-int port_rep_inb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_inw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_inl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-
-CARD8 x_inb(CARD16 port);
-CARD16 x_inw(CARD16 port);
-void x_outb(CARD16 port, CARD8 val);
-void x_outw(CARD16 port, CARD16 val);
-CARD32 x_inl(CARD16 port);
-void x_outl(CARD16 port, CARD32 val);
-
-CARD8 Mem_rb(CARD32 addr);
-CARD16 Mem_rw(CARD32 addr);
-CARD32 Mem_rl(CARD32 addr);
-void Mem_wb(CARD32 addr, CARD8 val);
-void Mem_ww(CARD32 addr, CARD16 val);
-void Mem_wl(CARD32 addr, CARD32 val);
-
-/* helper_mem.c */
-void setup_int_vect(xf86Int10InfoPtr pInt);
-int setup_system_bios(void *base_addr);
-void reset_int_vect(xf86Int10InfoPtr pInt);
-void set_return_trap(xf86Int10InfoPtr pInt);
-//void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
-Bool int10skip(void* options);
-Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem);
-Bool initPrimary(void* options);
-//void xf86int10ParseBiosLocation(void* options,
- //xf86int10BiosLocationPtr bios);
-#ifdef DEBUG
-void dprint(unsigned long start, unsigned long size);
-#endif
-
-/* pci.c */
-int mapPciRom(char *filename, unsigned char *address);
-
-#endif /* _INT10_PRIVATE */
-#endif /* _XF86INT10_H */
diff --git a/src/x86emu/include/xf86x86emu.h b/src/x86emu/include/xf86x86emu.h
deleted file mode 100644
index c4d86b8..0000000
--- a/src/x86emu/include/xf86x86emu.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.h,v 1.1 2000/01/23 04:44:35 dawes Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#ifndef XF86X86EMU_H_
-#define XF86X86EMU_H_
-#include "x86emu.h"
-
-#define M _X86EMU_env
-
-#define X86_EAX M.x86.R_EAX
-#define X86_EBX M.x86.R_EBX
-#define X86_ECX M.x86.R_ECX
-#define X86_EDX M.x86.R_EDX
-#define X86_ESI M.x86.R_ESI
-#define X86_EDI M.x86.R_EDI
-#define X86_EBP M.x86.R_EBP
-#define X86_EIP M.x86.R_EIP
-#define X86_ESP M.x86.R_ESP
-#define X86_EFLAGS M.x86.R_EFLG
-
-#define X86_FLAGS M.x86.R_FLG
-#define X86_AX M.x86.R_AX
-#define X86_BX M.x86.R_BX
-#define X86_CX M.x86.R_CX
-#define X86_DX M.x86.R_DX
-#define X86_SI M.x86.R_SI
-#define X86_DI M.x86.R_DI
-#define X86_BP M.x86.R_BP
-#define X86_IP M.x86.R_IP
-#define X86_SP M.x86.R_SP
-#define X86_CS M.x86.R_CS
-#define X86_DS M.x86.R_DS
-#define X86_ES M.x86.R_ES
-#define X86_SS M.x86.R_SS
-#define X86_FS M.x86.R_FS
-#define X86_GS M.x86.R_GS
-
-#define X86_AL M.x86.R_AL
-#define X86_BL M.x86.R_BL
-#define X86_CL M.x86.R_CL
-#define X86_DL M.x86.R_DL
-
-#define X86_AH M.x86.R_AH
-#define X86_BH M.x86.R_BH
-#define X86_CH M.x86.R_CH
-#define X86_DH M.x86.R_DH
-
-#endif
diff --git a/src/x86emu/makefile b/src/x86emu/makefile
deleted file mode 100644
index 9e42eb8..0000000
--- a/src/x86emu/makefile
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################################################################
-#
-# Realmode X86 Emulator Library
-#
-# Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-# ========================================================================
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of the authors not be used
-# in advertising or publicity pertaining to distribution of the software
-# without specific, written prior permission. The authors makes no
-# representations about the suitability of this software for any purpose.
-# It is provided "as is" without express or implied warranty.
-#
-# THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-# EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-#
-# ========================================================================
-#
-# Descripton: Linux specific makefile for the x86emu library.
-#
-#############################################################################
-
-TARGETLIB = libx86emu.a
-
-OBJS=\
-debug.o \
-decode.o \
-fpu.o \
-ops.o \
-ops2.o \
-prim_ops.o \
-sys.o
-
-all: $(TARGETLIB)
-
-$(TARGETLIB): $(OBJS)
- ar rv $(TARGETLIB) $(OBJS)
-
-INCS = -I. -Ix86emu -I../../include -I../x86emu_include
-CFLAGS = -fPIC -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -DDEBUG
-
-.c.o:
- gcc -g -O -Wall -c $(CFLAGS) $(INCS) $*.c
-
-.cpp.o:
- gcc -c $(CFLAGS) $(INCS) $*.cpp
-
-distclean: clean
-
-clean:
- rm -f *.a *.o *~
-
-install:
diff --git a/src/x86emu/makefile.linux b/src/x86emu/makefile.linux
deleted file mode 100644
index 7bafbca..0000000
--- a/src/x86emu/makefile.linux
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################################################################
-#
-# Realmode X86 Emulator Library
-#
-# Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-# ========================================================================
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of the authors not be used
-# in advertising or publicity pertaining to distribution of the software
-# without specific, written prior permission. The authors makes no
-# representations about the suitability of this software for any purpose.
-# It is provided "as is" without express or implied warranty.
-#
-# THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-# EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-#
-# ========================================================================
-#
-# Descripton: Linux specific makefile for the x86emu library.
-#
-#############################################################################
-
-TARGETLIB = libx86emu.a
-
-OBJS=\
-debug.o \
-decode.o \
-fpu.o \
-ops.o \
-ops2.o \
-prim_ops.o \
-sys.o
-
-all: $(TARGETLIB)
-
-$(TARGETLIB): $(OBJS)
- ar rv $(TARGETLIB) $(OBJS)
-
-INCS = -I. -Ix86emu -I../../include -I../x86emu_include
-CFLAGS = -fPIC -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -DDEBUG
-
-.c.o:
- gcc -g -O -Wall -c $(CFLAGS) $(INCS) $*.c
-
-.cpp.o:
- gcc -c $(CFLAGS) $(INCS) $*.cpp
-
-distclean: clean
-
-clean:
- rm -f *.a *.o
-
-install: