summaryrefslogtreecommitdiff
path: root/drivers/bios_emulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bios_emulator')
-rw-r--r--drivers/bios_emulator/Makefile25
-rw-r--r--drivers/bios_emulator/besys.c5
-rw-r--r--drivers/bios_emulator/bios.c5
-rw-r--r--drivers/bios_emulator/biosemu.c7
-rw-r--r--drivers/bios_emulator/x86emu/debug.c8
-rw-r--r--drivers/bios_emulator/x86emu/decode.c5
-rw-r--r--drivers/bios_emulator/x86emu/ops.c7
-rw-r--r--drivers/bios_emulator/x86emu/ops2.c6
-rw-r--r--drivers/bios_emulator/x86emu/prim_ops.c7
-rw-r--r--drivers/bios_emulator/x86emu/sys.c6
10 files changed, 70 insertions, 11 deletions
diff --git a/drivers/bios_emulator/Makefile b/drivers/bios_emulator/Makefile
index ba7d43673f..90c64dad60 100644
--- a/drivers/bios_emulator/Makefile
+++ b/drivers/bios_emulator/Makefile
@@ -1,10 +1,12 @@
include $(TOPDIR)/config.mk
-LIB := libatibiosemu.a
+LIB := $(obj)libatibiosemu.a
-X86DIR = ./x86emu
+X86DIR = x86emu
-OBJS = atibios.o biosemu.o besys.o bios.o \
+$(shell mkdir -p $(obj)$(X86DIR))
+
+COBJS = atibios.o biosemu.o besys.o bios.o \
$(X86DIR)/decode.o \
$(X86DIR)/ops2.o \
$(X86DIR)/ops.o \
@@ -12,19 +14,24 @@ OBJS = atibios.o biosemu.o besys.o bios.o \
$(X86DIR)/sys.o \
$(X86DIR)/debug.o
-CFLAGS += -I. -I./include -I$(X86DIR) -I$(TOPDIR)/include \
+SRCS := $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+
+EXTRA_CFLAGS += -I. -I./include -I$(TOPDIR)/include \
-D__PPC__ -D__BIG_ENDIAN__
+CFLAGS += $(EXTRA_CFLAGS)
+HOST_CFLAGS += $(EXTRA_CFLAGS)
+
all: $(LIB)
-$(LIB): $(OBJS)
- $(AR) crv $@ $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
#########################################################################
-.depend: Makefile $(OBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c
index 2a8e1a01c1..8f1d8b29d5 100644
--- a/drivers/bios_emulator/besys.c
+++ b/drivers/bios_emulator/besys.c
@@ -47,6 +47,10 @@
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
#include "biosemui.h"
/*------------------------- Global Variables ------------------------------*/
@@ -717,3 +721,4 @@ void X86API BE_outl(X86EMU_pioAddr port, u32 val)
#endif
LOG_outpd(port, val);
}
+#endif
diff --git a/drivers/bios_emulator/bios.c b/drivers/bios_emulator/bios.c
index ed5437eec9..70e9ce143b 100644
--- a/drivers/bios_emulator/bios.c
+++ b/drivers/bios_emulator/bios.c
@@ -41,6 +41,10 @@
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
#include "biosemui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -319,3 +323,4 @@ void _BE_bios_init(u32 * intrTab)
bios_intr_tab[0x6D] = int10;
X86EMU_setupIntrFuncs(bios_intr_tab);
}
+#endif
diff --git a/drivers/bios_emulator/biosemu.c b/drivers/bios_emulator/biosemu.c
index 06d4ad380f..ccfc872f78 100644
--- a/drivers/bios_emulator/biosemu.c
+++ b/drivers/bios_emulator/biosemu.c
@@ -45,8 +45,12 @@
*
****************************************************************************/
-#include "biosemui.h"
#include <malloc.h>
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
+#include "biosemui.h"
BE_sysEnv _BE_env = {{0}};
static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
@@ -368,3 +372,4 @@ int X86API BE_int86x(int intno, RMREGS * in, RMREGS * out, RMSREGS * sregs)
sregs->gs = M.x86.R_GS;
return out->x.ax;
}
+#endif
diff --git a/drivers/bios_emulator/x86emu/debug.c b/drivers/bios_emulator/x86emu/debug.c
index 0f58a6963f..5cbcc95018 100644
--- a/drivers/bios_emulator/x86emu/debug.c
+++ b/drivers/bios_emulator/x86emu/debug.c
@@ -37,8 +37,12 @@
*
****************************************************************************/
-#include "x86emu/x86emui.h"
#include <stdarg.h>
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
+#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -459,3 +463,5 @@ void x86emu_dump_xregs(void)
printk("NC ");
printk("\n");
}
+
+#endif
diff --git a/drivers/bios_emulator/x86emu/decode.c b/drivers/bios_emulator/x86emu/decode.c
index 1e2dcfe4b2..7a9a1ddbff 100644
--- a/drivers/bios_emulator/x86emu/decode.c
+++ b/drivers/bios_emulator/x86emu/decode.c
@@ -36,6 +36,9 @@
* instruction decoding and accessess of immediate data via IP. etc.
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
#include "x86emu/x86emui.h"
@@ -1142,3 +1145,5 @@ unsigned decode_rmXX_address(int mod, int rm)
return decode_rm01_address(rm);
return decode_rm10_address(rm);
}
+
+#endif
diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c
index d1380ceec0..a77bd9b492 100644
--- a/drivers/bios_emulator/x86emu/ops.c
+++ b/drivers/bios_emulator/x86emu/ops.c
@@ -75,7 +75,12 @@
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
#include "x86emu/x86emui.h"
+
/*----------------------------- Implementation ----------------------------*/
/* constant arrays to do several instructions in just one function */
@@ -5429,3 +5434,5 @@ void (*x86emu_optab[256])(u8) __attribute__ ((section(".got2"))) =
/* 0xfe */ x86emuOp_opcFE_byte_RM,
/* 0xff */ x86emuOp_opcFF_word_RM,
};
+
+#endif
diff --git a/drivers/bios_emulator/x86emu/ops2.c b/drivers/bios_emulator/x86emu/ops2.c
index 631a340ed2..d6a210c973 100644
--- a/drivers/bios_emulator/x86emu/ops2.c
+++ b/drivers/bios_emulator/x86emu/ops2.c
@@ -44,6 +44,10 @@
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -1768,3 +1772,5 @@ void (*x86emu_optab2[256])(u8) __attribute__((section(".got2"))) =
/* 0xfe */ x86emuOp2_illegal_op,
/* 0xff */ x86emuOp2_illegal_op,
};
+
+#endif
diff --git a/drivers/bios_emulator/x86emu/prim_ops.c b/drivers/bios_emulator/x86emu/prim_ops.c
index e0827d7478..2a254a4e67 100644
--- a/drivers/bios_emulator/x86emu/prim_ops.c
+++ b/drivers/bios_emulator/x86emu/prim_ops.c
@@ -97,7 +97,12 @@
*
****************************************************************************/
+#include <common.h>
+
#define PRIM_OPS_NO_REDEFINE_ASM
+
+#if defined(CONFIG_BIOSEMU)
+
#include "x86emu/x86emui.h"
/*------------------------- Global Variables ------------------------------*/
@@ -2443,3 +2448,5 @@ DB( if (CHECK_SP_ACCESS())
M.x86.R_SP += 4;
return res;
}
+
+#endif
diff --git a/drivers/bios_emulator/x86emu/sys.c b/drivers/bios_emulator/x86emu/sys.c
index bb7fcd93a9..dd44ff1e73 100644
--- a/drivers/bios_emulator/x86emu/sys.c
+++ b/drivers/bios_emulator/x86emu/sys.c
@@ -39,6 +39,10 @@
*
****************************************************************************/
+#include <common.h>
+
+#if defined(CONFIG_BIOSEMU)
+
#include "x86emu/x86emui.h"
/*------------------------- Global Variables ------------------------------*/
@@ -320,3 +324,5 @@ void X86EMU_prepareForInt(int num)
M.x86.R_IP = mem_access_word(num * 4);
M.x86.intr = 0;
}
+
+#endif