diff options
Diffstat (limited to 'util/x86emu/x86emu')
-rw-r--r-- | util/x86emu/x86emu/debug.c | 147 | ||||
-rw-r--r-- | util/x86emu/x86emu/debug.h | 41 | ||||
-rw-r--r-- | util/x86emu/x86emu/decode.c | 8 | ||||
-rw-r--r-- | util/x86emu/x86emu/fpu.c | 16 | ||||
-rw-r--r-- | util/x86emu/x86emu/ops.c | 6 | ||||
-rw-r--r-- | util/x86emu/x86emu/ops2.c | 6 | ||||
-rw-r--r-- | util/x86emu/x86emu/sys.c | 34 | ||||
-rw-r--r-- | util/x86emu/x86emu/x86emui.h | 2 |
8 files changed, 128 insertions, 132 deletions
diff --git a/util/x86emu/x86emu/debug.c b/util/x86emu/x86emu/debug.c index 026c03fddd..b3f4b6ebfb 100644 --- a/util/x86emu/x86emu/debug.c +++ b/util/x86emu/x86emu/debug.c @@ -38,7 +38,6 @@ ****************************************************************************/ #include "x86emui.h" -// #include <stdarg.h> /*----------------------------- Implementation ----------------------------*/ @@ -59,7 +58,7 @@ void X86EMU_trace_regs (void) } } if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) { - printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip); + printf("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip); print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip); print_decoded_instruction(); } @@ -78,7 +77,7 @@ void x86emu_just_disassemble (void) * This routine called if the flag DEBUG_DISASSEMBLE is set kind * of a hack! */ - printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip); + printf("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip); print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip); print_decoded_instruction(); } @@ -162,13 +161,13 @@ void x86emu_inc_decoded_inst_len (int x) M.x86.enc_pos += x; } -void x86emu_decode_printf (char *x) +void x86emu_decode_printf (const char *x) { sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x); M.x86.enc_str_pos += strlen(x); } -void x86emu_decode_printf2 (char *x, int y) +void x86emu_decode_printf2 (const char *x, int y) { char temp[100]; sprintf(temp,x,y); @@ -189,12 +188,12 @@ static void print_encoded_bytes (u16 s, u16 o) for (i=0; i< M.x86.enc_pos; i++) { sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i)); } - printk("%-20s ",buf1); + printf("%-20s ",buf1); } static void print_decoded_instruction (void) { - printk("%s", M.x86.decoded_buf); + printf("%s", M.x86.decoded_buf); } void x86emu_print_int_vect (u16 iv) @@ -204,7 +203,7 @@ void x86emu_print_int_vect (u16 iv) if (iv > 256) return; seg = fetch_data_word_abs(0,iv*4); off = fetch_data_word_abs(0,iv*4+2); - printk("%04x:%04x ", seg, off); + printf("%04x:%04x ", seg, off); } void X86EMU_dump_memory (u16 seg, u16 off, u32 amt) @@ -216,12 +215,12 @@ void X86EMU_dump_memory (u16 seg, u16 off, u32 amt) current = start; while (end <= off + amt) { - printk("%04x:%04x ", seg, start); + printf("%04x:%04x ", seg, start); for (i=start; i< off; i++) - printk(" "); + printf(" "); for ( ; i< end; i++) - printk("%02x ", fetch_data_byte_abs(seg,i)); - printk("\n"); + printf("%02x ", fetch_data_byte_abs(seg,i)); + printf("\n"); start = end; end = start + 16; } @@ -256,7 +255,7 @@ void x86emu_single_step (void) done=0; offset = M.x86.saved_ip; while (!done) { - printk("-"); + printf("-"); p = fgets(s, 1023, stdin); cmd = parse_line(s, ps, &ntok); switch(cmd) { @@ -310,7 +309,7 @@ void x86emu_single_step (void) return; case 'P': noDecode = (noDecode)?0:1; - printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE"); + printf("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE"); break; case 't': case 0: @@ -368,68 +367,68 @@ int parse_line (char *s, int *ps, int *n) void x86emu_dump_regs (void) { - printk("\tAX=%04x ", M.x86.R_AX ); - printk("BX=%04x ", M.x86.R_BX ); - printk("CX=%04x ", M.x86.R_CX ); - printk("DX=%04x ", M.x86.R_DX ); - printk("SP=%04x ", M.x86.R_SP ); - printk("BP=%04x ", M.x86.R_BP ); - printk("SI=%04x ", M.x86.R_SI ); - printk("DI=%04x\n", M.x86.R_DI ); - printk("\tDS=%04x ", M.x86.R_DS ); - printk("ES=%04x ", M.x86.R_ES ); - printk("SS=%04x ", M.x86.R_SS ); - printk("CS=%04x ", M.x86.R_CS ); - printk("IP=%04x ", M.x86.R_IP ); - if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */ - else printk("NV "); - if (ACCESS_FLAG(F_DF)) printk("DN "); - else printk("UP "); - if (ACCESS_FLAG(F_IF)) printk("EI "); - else printk("DI "); - if (ACCESS_FLAG(F_SF)) printk("NG "); - else printk("PL "); - if (ACCESS_FLAG(F_ZF)) printk("ZR "); - else printk("NZ "); - if (ACCESS_FLAG(F_AF)) printk("AC "); - else printk("NA "); - if (ACCESS_FLAG(F_PF)) printk("PE "); - else printk("PO "); - if (ACCESS_FLAG(F_CF)) printk("CY "); - else printk("NC "); - printk("\n"); + printf("\tAX=%04x ", M.x86.R_AX ); + printf("BX=%04x ", M.x86.R_BX ); + printf("CX=%04x ", M.x86.R_CX ); + printf("DX=%04x ", M.x86.R_DX ); + printf("SP=%04x ", M.x86.R_SP ); + printf("BP=%04x ", M.x86.R_BP ); + printf("SI=%04x ", M.x86.R_SI ); + printf("DI=%04x\n", M.x86.R_DI ); + printf("\tDS=%04x ", M.x86.R_DS ); + printf("ES=%04x ", M.x86.R_ES ); + printf("SS=%04x ", M.x86.R_SS ); + printf("CS=%04x ", M.x86.R_CS ); + printf("IP=%04x ", M.x86.R_IP ); + if (ACCESS_FLAG(F_OF)) printf("OV "); /* CHECKED... */ + else printf("NV "); + if (ACCESS_FLAG(F_DF)) printf("DN "); + else printf("UP "); + if (ACCESS_FLAG(F_IF)) printf("EI "); + else printf("DI "); + if (ACCESS_FLAG(F_SF)) printf("NG "); + else printf("PL "); + if (ACCESS_FLAG(F_ZF)) printf("ZR "); + else printf("NZ "); + if (ACCESS_FLAG(F_AF)) printf("AC "); + else printf("NA "); + if (ACCESS_FLAG(F_PF)) printf("PE "); + else printf("PO "); + if (ACCESS_FLAG(F_CF)) printf("CY "); + else printf("NC "); + printf("\n"); } void x86emu_dump_xregs (void) { - printk("\tEAX=%08x ", M.x86.R_EAX ); - printk("EBX=%08x ", M.x86.R_EBX ); - printk("ECX=%08x ", M.x86.R_ECX ); - printk("EDX=%08x \n", M.x86.R_EDX ); - printk("\tESP=%08x ", M.x86.R_ESP ); - printk("EBP=%08x ", M.x86.R_EBP ); - printk("ESI=%08x ", M.x86.R_ESI ); - printk("EDI=%08x\n", M.x86.R_EDI ); - printk("\tDS=%04x ", M.x86.R_DS ); - printk("ES=%04x ", M.x86.R_ES ); - printk("SS=%04x ", M.x86.R_SS ); - printk("CS=%04x ", M.x86.R_CS ); - printk("EIP=%08x\n\t", M.x86.R_EIP ); - if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */ - else printk("NV "); - if (ACCESS_FLAG(F_DF)) printk("DN "); - else printk("UP "); - if (ACCESS_FLAG(F_IF)) printk("EI "); - else printk("DI "); - if (ACCESS_FLAG(F_SF)) printk("NG "); - else printk("PL "); - if (ACCESS_FLAG(F_ZF)) printk("ZR "); - else printk("NZ "); - if (ACCESS_FLAG(F_AF)) printk("AC "); - else printk("NA "); - if (ACCESS_FLAG(F_PF)) printk("PE "); - else printk("PO "); - if (ACCESS_FLAG(F_CF)) printk("CY "); - else printk("NC "); - printk("\n"); + printf("\tEAX=%08x ", M.x86.R_EAX ); + printf("EBX=%08x ", M.x86.R_EBX ); + printf("ECX=%08x ", M.x86.R_ECX ); + printf("EDX=%08x \n", M.x86.R_EDX ); + printf("\tESP=%08x ", M.x86.R_ESP ); + printf("EBP=%08x ", M.x86.R_EBP ); + printf("ESI=%08x ", M.x86.R_ESI ); + printf("EDI=%08x\n", M.x86.R_EDI ); + printf("\tDS=%04x ", M.x86.R_DS ); + printf("ES=%04x ", M.x86.R_ES ); + printf("SS=%04x ", M.x86.R_SS ); + printf("CS=%04x ", M.x86.R_CS ); + printf("EIP=%08x\n\t", M.x86.R_EIP ); + if (ACCESS_FLAG(F_OF)) printf("OV "); /* CHECKED... */ + else printf("NV "); + if (ACCESS_FLAG(F_DF)) printf("DN "); + else printf("UP "); + if (ACCESS_FLAG(F_IF)) printf("EI "); + else printf("DI "); + if (ACCESS_FLAG(F_SF)) printf("NG "); + else printf("PL "); + if (ACCESS_FLAG(F_ZF)) printf("ZR "); + else printf("NZ "); + if (ACCESS_FLAG(F_AF)) printf("AC "); + else printf("NA "); + if (ACCESS_FLAG(F_PF)) printf("PE "); + else printf("PO "); + if (ACCESS_FLAG(F_CF)) printf("CY "); + else printf("NC "); + printf("\n"); } diff --git a/util/x86emu/x86emu/debug.h b/util/x86emu/x86emu/debug.h index f6bab3cf78..7aac995cc3 100644 --- a/util/x86emu/x86emu/debug.h +++ b/util/x86emu/x86emu/debug.h @@ -40,10 +40,11 @@ #ifndef __X86EMU_DEBUG_H #define __X86EMU_DEBUG_H -//#define DEBUG 0 -//#undef DEBUG /*---------------------- Macros and type definitions ----------------------*/ +/* printf is not available in coreboot... use printk */ +#define printf(x...) printk(BIOS_DEBUG, x) + /* checks to be enabled for "runtime" */ #define CHECK_IP_FETCH_F 0x1 @@ -172,17 +173,17 @@ if (DEBUG_TRACECALLREGS()) \ x86emu_dump_regs(); \ if (DEBUG_TRACECALL()) \ - printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x); + printf("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x); # define RETURN_TRACE(u,v,w,x,s) \ if (DEBUG_TRACECALLREGS()) \ x86emu_dump_regs(); \ if (DEBUG_TRACECALL()) \ - printk("%04x:%04x: RET %s %04x:%04x\n",u,v,s,w,x); + printf("%04x:%04x: RET %s %04x:%04x\n",u,v,s,w,x); # define JMP_TRACE(u,v,w,x,s) \ if (DEBUG_TRACEJMPREGS()) \ x86emu_dump_regs(); \ if (DEBUG_TRACEJMP()) \ - printk("%04x:%04x: JMP %s%04x:%04x\n", u , v, s, w, x); + printf("%04x:%04x: JMP %s%04x:%04x\n", u , v, s, w, x); #else # define CALL_TRACE(u,v,w,x,s) # define RETURN_TRACE(u,v,w,x,s) @@ -201,20 +202,22 @@ extern "C" { /* Use "C" linkage when in C++ mode */ #endif -extern void x86emu_inc_decoded_inst_len (int x); -extern void x86emu_decode_printf (char *x); -extern void x86emu_decode_printf2 (char *x, int y); -extern void x86emu_just_disassemble (void); -extern void x86emu_single_step (void); -extern void x86emu_end_instr (void); -extern void x86emu_dump_regs (void); -extern void x86emu_dump_xregs (void); -extern void x86emu_print_int_vect (u16 iv); -extern void x86emu_instrument_instruction (void); -extern void x86emu_check_ip_access (void); -extern void x86emu_check_sp_access (void); -extern void x86emu_check_mem_access (u32 p); -extern void x86emu_check_data_access (uint s, uint o); +void x86emu_inc_decoded_inst_len (int x); +void x86emu_decode_printf (const char *x); +void x86emu_decode_printf2 (const char *x, int y); +void x86emu_just_disassemble (void); +void x86emu_single_step (void); +void x86emu_end_instr (void); +void x86emu_dump_regs (void); +void x86emu_dump_xregs (void); +void x86emu_print_int_vect (u16 iv); +void x86emu_instrument_instruction (void); +void x86emu_check_ip_access (void); +void x86emu_check_sp_access (void); +void x86emu_check_mem_access (u32 p); +void x86emu_check_data_access (uint s, uint o); + +void disassemble_forward (u16 seg, u16 off, int n); #ifdef __cplusplus } /* End of "C" linkage for C++ */ diff --git a/util/x86emu/x86emu/decode.c b/util/x86emu/x86emu/decode.c index 2cd62348d7..3d2ba23566 100644 --- a/util/x86emu/x86emu/decode.c +++ b/util/x86emu/x86emu/decode.c @@ -77,7 +77,7 @@ next instruction. void x86emu_intr_raise( u8 intrnum) { - printk("%s, rasing execption %x\n", __func__, intrnum); + printf("%s, raising exeception %x\n", __func__, intrnum); x86emu_dump_regs(); M.x86.intno = intrnum; M.x86.intr |= INTR_SYNCH; @@ -105,12 +105,12 @@ DB( if (CHECK_IP_FETCH()) if (M.x86.intr) { if (M.x86.intr & INTR_HALTED) { DB( if (M.x86.R_SP != 0) { - printk("halted\n"); + printf("halted\n"); X86EMU_trace_regs(); } else { if (M.x86.debug) - printk("Service completed successfully\n"); + printf("Service completed successfully\n"); }) return; } @@ -286,7 +286,7 @@ _INLINE u32 get_data_segment(void) return M.x86.R_SS; default: #ifdef DEBUG - printk("error: should not happen: multiple overrides.\n"); + printf("error: should not happen: multiple overrides.\n"); #endif HALT_SYS(); return 0; diff --git a/util/x86emu/x86emu/fpu.c b/util/x86emu/x86emu/fpu.c index 85f55c8854..daa2ffa75a 100644 --- a/util/x86emu/x86emu/fpu.c +++ b/util/x86emu/x86emu/fpu.c @@ -52,7 +52,7 @@ void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -static char *x86emu_fpu_op_d9_tab[] = { +static const char *x86emu_fpu_op_d9_tab[] = { "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ", "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t", @@ -63,7 +63,7 @@ static char *x86emu_fpu_op_d9_tab[] = { "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t", }; -static char *x86emu_fpu_op_d9_tab1[] = { +static const char *x86emu_fpu_op_d9_tab1[] = { "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", @@ -296,7 +296,7 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -char *x86emu_fpu_op_da_tab[] = { +static const char *x86emu_fpu_op_da_tab[] = { "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ", "FICOMP\tDWORD PTR ", "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ", @@ -386,7 +386,7 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -char *x86emu_fpu_op_db_tab[] = { +static const char *x86emu_fpu_op_db_tab[] = { "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ", "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ", @@ -505,7 +505,7 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1)) } #ifdef DEBUG -char *x86emu_fpu_op_dc_tab[] = { +static const char *x86emu_fpu_op_dc_tab[] = { "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ", "FCOMP\tQWORD PTR ", "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ", @@ -620,7 +620,7 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -static char *x86emu_fpu_op_dd_tab[] = { +static const char *x86emu_fpu_op_dd_tab[] = { "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ", "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t", @@ -720,7 +720,7 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -static char *x86emu_fpu_op_de_tab[] = +static const char *x86emu_fpu_op_de_tab[] = { "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ", "FICOMP\tWORD PTR ", @@ -839,7 +839,7 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1)) #ifdef DEBUG -static char *x86emu_fpu_op_df_tab[] = { +static const char *x86emu_fpu_op_df_tab[] = { /* mod == 00 */ "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ", "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ", diff --git a/util/x86emu/x86emu/ops.c b/util/x86emu/x86emu/ops.c index fd7ad32d22..c66da95760 100644 --- a/util/x86emu/x86emu/ops.c +++ b/util/x86emu/x86emu/ops.c @@ -77,7 +77,7 @@ /* constant arrays to do several instructions in just one function */ #ifdef DEBUG -static char *x86emu_GenOpName[8] = { +static const char *x86emu_GenOpName[8] = { "ADD", "OR", "ADC", "SBB", "AND", "SUB", "XOR", "CMP"}; #endif @@ -159,7 +159,7 @@ static u32 (*opcD1_long_operation[])(u32 s, u8 d) = #ifdef DEBUG -static char *opF6_names[8] = +static const char *opF6_names[8] = { "TEST\t", "", "NOT\t", "NEG\t", "MUL\t", "IMUL\t", "DIV\t", "IDIV\t" }; #endif @@ -178,7 +178,7 @@ static void x86emuOp_illegal_op( if (M.x86.R_SP != 0) { DECODE_PRINTF("ILLEGAL X86 OPCODE\n"); TRACE_REGS(); - DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n", + DB( printf("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n", M.x86.R_CS, M.x86.R_IP-1,op1)); HALT_SYS(); } diff --git a/util/x86emu/x86emu/ops2.c b/util/x86emu/x86emu/ops2.c index a749b59525..f5cb6498b1 100644 --- a/util/x86emu/x86emu/ops2.c +++ b/util/x86emu/x86emu/ops2.c @@ -54,7 +54,7 @@ static void x86emuOp2_illegal_op(u8 op2) START_OF_INSTR(); DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n"); TRACE_REGS(); - printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n", + printf("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n", M.x86.R_CS, M.x86.R_IP-2, op2); HALT_SYS(); END_OF_INSTR(); @@ -105,7 +105,7 @@ static void x86emuOp2_opc_01(u8 op2) default: DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE IN 0F 01\n"); TRACE_REGS(); - printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n", + printf("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n", M.x86.R_CS, M.x86.R_IP-2, op2); HALT_SYS(); break; @@ -1272,7 +1272,7 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2)) default: DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n"); TRACE_REGS(); - printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n", + printf("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n", M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl); HALT_SYS(); } diff --git a/util/x86emu/x86emu/sys.c b/util/x86emu/x86emu/sys.c index b4bed43ba4..957e0ca63b 100644 --- a/util/x86emu/x86emu/sys.c +++ b/util/x86emu/x86emu/sys.c @@ -41,15 +41,11 @@ ****************************************************************************/ /* $XFree86: xc/extras/x86emu/src/x86emu/sys.c,v 1.5 2000/08/23 22:10:01 tsi Exp $ */ +#include <arch/io.h> #include <x86emu/x86emu.h> #include <x86emu/regs.h> #include "debug.h" #include "prim_ops.h" -#if 1 /* Coreboot needs to map prinkf to printk. */ -#include "arch/io.h" -#else -#include <sys/io.h> -#endif #ifdef IN_MODULE #include "xf86_ansic.h" @@ -69,11 +65,11 @@ static u8 *mem_ptr(u32 addr, int size) u8 *retaddr = 0; if (addr > M.mem_size - size) { - DB(printk("mem_ptr: address %#x out of range!\n", addr);) + DB(printf("mem_ptr: address %#x out of range!\n", addr);) HALT_SYS(); } if (addr < 0x200) { - //printk("%x:%x updating int vector 0x%x\n", + //printf("%x:%x updating int vector 0x%x\n", // M.x86.R_CS, M.x86.R_IP, addr >> 2); } retaddr = (u8 *) (M.mem_base + addr); @@ -100,7 +96,7 @@ u8 X86API rdb(u32 addr) val = *ptr; DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 1 -> %#x\n", addr, val);) + printf("%#08x 1 -> %#x\n", addr, val);) return val; } @@ -123,7 +119,7 @@ u16 X86API rdw(u32 addr) val = *(u16 *) (ptr); DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 2 -> %#x\n", addr, val);) + printf("%#08x 2 -> %#x\n", addr, val);) return val; } @@ -145,7 +141,7 @@ u32 X86API rdl(u32 addr) val = *(u32 *) (ptr); DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 4 -> %#x\n", addr, val);) + printf("%#08x 4 -> %#x\n", addr, val);) return val; } @@ -165,7 +161,7 @@ void X86API wrb(u32 addr, u8 val) *(u8 *) (ptr) = val; DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 1 <- %#x\n", addr, val);) + printf("%#08x 1 <- %#x\n", addr, val);) } /**************************************************************************** @@ -184,7 +180,7 @@ void X86API wrw(u32 addr, u16 val) *(u16 *) (ptr) = val; DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 2 <- %#x\n", addr, val);) + printf("%#08x 2 <- %#x\n", addr, val);) } /**************************************************************************** @@ -203,7 +199,7 @@ void X86API wrl(u32 addr, u32 val) *(u32 *) (ptr) = val; DB(if (DEBUG_MEM_TRACE()) - printk("%#08x 4 <- %#x\n", addr, val);) + printf("%#08x 4 <- %#x\n", addr, val);) } @@ -219,7 +215,7 @@ Default PIO byte read function. Doesn't perform real inb. static u8 X86API p_inb(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) - printk("inb %#04x \n", addr);) + printf("inb %#04x \n", addr);) return inb(addr); } @@ -234,7 +230,7 @@ Default PIO word read function. Doesn't perform real inw. static u16 X86API p_inw(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) - printk("inw %#04x \n", addr);) + printf("inw %#04x \n", addr);) return inw(addr); } @@ -249,7 +245,7 @@ Default PIO long read function. Doesn't perform real inl. static u32 X86API p_inl(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) - printk("inl %#04x \n", addr);) + printf("inl %#04x \n", addr);) return inl(addr); } @@ -263,7 +259,7 @@ Default PIO byte write function. Doesn't perform real outb. static void X86API p_outb(X86EMU_pioAddr addr, u8 val) { DB(if (DEBUG_IO_TRACE()) - printk("outb %#02x -> %#04x \n", val, addr);) + printf("outb %#02x -> %#04x \n", val, addr);) outb(val, addr); return; } @@ -278,7 +274,7 @@ Default PIO word write function. Doesn't perform real outw. static void X86API p_outw(X86EMU_pioAddr addr, u16 val) { DB(if (DEBUG_IO_TRACE()) - printk("outw %#04x -> %#04x \n", val, addr);) + printf("outw %#04x -> %#04x \n", val, addr);) outw(val, addr); return; } @@ -293,7 +289,7 @@ Default PIO ;ong write function. Doesn't perform real outl. static void X86API p_outl(X86EMU_pioAddr addr, u32 val) { DB(if (DEBUG_IO_TRACE()) - printk("outl %#08x -> %#04x \n", val, addr);) + printf("outl %#08x -> %#04x \n", val, addr);) outl(val, addr); return; diff --git a/util/x86emu/x86emu/x86emui.h b/util/x86emu/x86emu/x86emui.h index ff69d50565..d693e335f4 100644 --- a/util/x86emu/x86emu/x86emui.h +++ b/util/x86emu/x86emu/x86emui.h @@ -74,8 +74,6 @@ #ifdef IN_MODULE #include <xf86_ansic.h> #else -//#include <stdio.h> -//#include <stdlib.h> #include <string.h> #endif /*--------------------------- Inline Functions ----------------------------*/ |