浏览代码

Add CONFIG_BIOSEMU define to guard all the bios emulator code

Signed-off-by: Jason Jin <Jason.jin@freescale.com>

This patch fix the compile issue on the board that did not enable the bios emulator
Jason Jin 17 年之前
父节点
当前提交
ce981dc857

+ 2 - 0
drivers/bios_emulator/besys.c

@@ -49,6 +49,7 @@
 
 
 #include "biosemui.h"
 #include "biosemui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
 /*------------------------- Global Variables ------------------------------*/
 /*------------------------- Global Variables ------------------------------*/
 
 
 #ifndef __i386__
 #ifndef __i386__
@@ -717,3 +718,4 @@ void X86API BE_outl(X86EMU_pioAddr port, u32 val)
 #endif
 #endif
 		LOG_outpd(port, val);
 		LOG_outpd(port, val);
 }
 }
+#endif

+ 2 - 0
drivers/bios_emulator/bios.c

@@ -43,6 +43,7 @@
 
 
 #include "biosemui.h"
 #include "biosemui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
 /*----------------------------- Implementation ----------------------------*/
 /*----------------------------- Implementation ----------------------------*/
 
 
 /****************************************************************************
 /****************************************************************************
@@ -319,3 +320,4 @@ void _BE_bios_init(u32 * intrTab)
 	bios_intr_tab[0x6D] = int10;
 	bios_intr_tab[0x6D] = int10;
 	X86EMU_setupIntrFuncs(bios_intr_tab);
 	X86EMU_setupIntrFuncs(bios_intr_tab);
 }
 }
+#endif

+ 3 - 0
drivers/bios_emulator/biosemu.c

@@ -48,6 +48,8 @@
 #include "biosemui.h"
 #include "biosemui.h"
 #include <malloc.h>
 #include <malloc.h>
 
 
+#if defined(CONFIG_BIOSEMU)
+
 BE_sysEnv _BE_env = {{0}};
 BE_sysEnv _BE_env = {{0}};
 static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
 static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
 	BE_rdb,
 	BE_rdb,
@@ -368,3 +370,4 @@ int X86API BE_int86x(int intno, RMREGS * in, RMREGS * out, RMSREGS * sregs)
 	sregs->gs = M.x86.R_GS;
 	sregs->gs = M.x86.R_GS;
 	return out->x.ax;
 	return out->x.ax;
 }
 }
+#endif

+ 4 - 0
drivers/bios_emulator/x86emu/debug.c

@@ -40,6 +40,8 @@
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
 #include <stdarg.h>
 #include <stdarg.h>
 
 
+#if defined(CONFIG_BIOSEMU)
+
 /*----------------------------- Implementation ----------------------------*/
 /*----------------------------- Implementation ----------------------------*/
 
 
 #ifdef DEBUG
 #ifdef DEBUG
@@ -459,3 +461,5 @@ void x86emu_dump_xregs(void)
 		printk("NC ");
 		printk("NC ");
 	printk("\n");
 	printk("\n");
 }
 }
+
+#endif

+ 4 - 0
drivers/bios_emulator/x86emu/decode.c

@@ -39,6 +39,8 @@
 
 
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
+
 /*----------------------------- Implementation ----------------------------*/
 /*----------------------------- Implementation ----------------------------*/
 
 
 /****************************************************************************
 /****************************************************************************
@@ -1142,3 +1144,5 @@ unsigned decode_rmXX_address(int mod, int rm)
     return decode_rm01_address(rm);
     return decode_rm01_address(rm);
   return decode_rm10_address(rm);
   return decode_rm10_address(rm);
 }
 }
+
+#endif

+ 5 - 0
drivers/bios_emulator/x86emu/ops.c

@@ -76,6 +76,9 @@
 ****************************************************************************/
 ****************************************************************************/
 
 
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
+
+#if defined(CONFIG_BIOSEMU)
+
 /*----------------------------- Implementation ----------------------------*/
 /*----------------------------- Implementation ----------------------------*/
 
 
 /* constant arrays to do several instructions in just one function */
 /* constant arrays to do several instructions in just one function */
@@ -5429,3 +5432,5 @@ void (*x86emu_optab[256])(u8) __attribute__ ((section(".got2"))) =
 /*  0xfe */ x86emuOp_opcFE_byte_RM,
 /*  0xfe */ x86emuOp_opcFE_byte_RM,
 /*  0xff */ x86emuOp_opcFF_word_RM,
 /*  0xff */ x86emuOp_opcFF_word_RM,
 };
 };
+
+#endif

+ 4 - 0
drivers/bios_emulator/x86emu/ops2.c

@@ -46,6 +46,8 @@
 
 
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
+
 /*----------------------------- Implementation ----------------------------*/
 /*----------------------------- Implementation ----------------------------*/
 
 
 /****************************************************************************
 /****************************************************************************
@@ -1768,3 +1770,5 @@ void (*x86emu_optab2[256])(u8) __attribute__((section(".got2"))) =
 /*  0xfe */ x86emuOp2_illegal_op,
 /*  0xfe */ x86emuOp2_illegal_op,
 /*  0xff */ x86emuOp2_illegal_op,
 /*  0xff */ x86emuOp2_illegal_op,
 };
 };
+
+#endif

+ 4 - 0
drivers/bios_emulator/x86emu/prim_ops.c

@@ -100,6 +100,8 @@
 #define PRIM_OPS_NO_REDEFINE_ASM
 #define PRIM_OPS_NO_REDEFINE_ASM
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
+
 /*------------------------- Global Variables ------------------------------*/
 /*------------------------- Global Variables ------------------------------*/
 
 
 static u32 x86emu_parity_tab[8] =
 static u32 x86emu_parity_tab[8] =
@@ -2443,3 +2445,5 @@ DB( if (CHECK_SP_ACCESS())
     M.x86.R_SP += 4;
     M.x86.R_SP += 4;
     return res;
     return res;
 }
 }
+
+#endif

+ 4 - 0
drivers/bios_emulator/x86emu/sys.c

@@ -41,6 +41,8 @@
 
 
 #include "x86emu/x86emui.h"
 #include "x86emu/x86emui.h"
 
 
+#if defined(CONFIG_BIOSEMU)
+
 /*------------------------- Global Variables ------------------------------*/
 /*------------------------- Global Variables ------------------------------*/
 
 
 X86EMU_sysEnv _X86EMU_env;	/* Global emulator machine state */
 X86EMU_sysEnv _X86EMU_env;	/* Global emulator machine state */
@@ -320,3 +322,5 @@ void X86EMU_prepareForInt(int num)
 	M.x86.R_IP = mem_access_word(num * 4);
 	M.x86.R_IP = mem_access_word(num * 4);
 	M.x86.intr = 0;
 	M.x86.intr = 0;
 }
 }
+
+#endif