Changeset 5131


Ignore:
Timestamp:
Feb 19, 2010 8:08:11 PM (3 years ago)
Author:
myles
Message:
  1. Change CONFIG_DEBUG to DEBUG in util/x86emu/*
  2. Make DEBUG depend on CONFIG_YABEL_DEBUG_FLAGS being nonzero

Signed-off-by: Myles Watson <mylesgw@…>
Acked-by: Ronald G. Minnich <rminnich@…>

Location:
trunk
Files:
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/util/x86emu/biosemu.c

    r5040 r5131  
    9191 
    9292        val = inb(port); 
    93 #ifdef CONFIG_DEBUG 
     93#ifdef DEBUG 
    9494        if (port != 0x40) 
    9595            printk("inb(0x%04x) = 0x%02x\n", port, val); 
     
    105105        val = inw(port); 
    106106 
    107 #ifdef CONFIG_DEBUG 
     107#ifdef DEBUG 
    108108        printk("inw(0x%04x) = 0x%04x\n", port, val); 
    109109#endif 
     
    117117        val = inl(port); 
    118118 
    119 #ifdef CONFIG_DEBUG 
     119#ifdef DEBUG 
    120120        printk("inl(0x%04x) = 0x%08x\n", port, val); 
    121121#endif 
     
    125125static void biosemu_outb(u16 port, u8 val) 
    126126{ 
    127 #ifdef CONFIG_DEBUG 
     127#ifdef DEBUG 
    128128        if (port != 0x43) 
    129129                printk("outb(0x%02x, 0x%04x)\n", val, port); 
     
    134134static void biosemu_outw(u16 port, u16 val) 
    135135{ 
    136 #ifdef CONFIG_DEBUG 
     136#ifdef DEBUG 
    137137        printk("outw(0x%04x, 0x%04x)\n", val, port); 
    138138#endif 
     
    142142static void biosemu_outl(u16 port, u32 val) 
    143143{ 
    144 #ifdef CONFIG_DEBUG 
     144#ifdef DEBUG 
    145145        printk("outl(0x%08x, 0x%04x)\n", val, port); 
    146146#endif 
     
    557557        push_word(X86_SP + 2); 
    558558 
    559 #ifdef CONFIG_DEBUG 
     559#ifdef DEBUG 
    560560        //X86EMU_trace_on(); 
    561561#endif 
  • trunk/util/x86emu/include/x86emu/fpu_regs.h

    r4532 r5131  
    103103#endif /* X86_FPU_SUPPORT */ 
    104104 
    105 #ifdef CONFIG_DEBUG 
     105#ifdef DEBUG 
    106106# define DECODE_PRINTINSTR32(t,mod,rh,rl)       \ 
    107107        DECODE_PRINTF(t[(mod<<3)+(rh)]); 
  • trunk/util/x86emu/include/x86emu/regs.h

    r4532 r5131  
    280280    volatile int                intr;   /* mask of pending interrupts */ 
    281281    volatile int                         debug; 
    282 #ifdef CONFIG_DEBUG 
     282#ifdef DEBUG 
    283283    int                         check; 
    284284    u16                         saved_ip; 
  • trunk/util/x86emu/include/x86emu/x86emu.h

    r5040 r5131  
    4848#undef printk 
    4949#define printk(x...) do_printk(BIOS_DEBUG, x) 
    50 #if defined(CONFIG_DEBUG) && (CONFIG_DEBUG == 0) 
    51 #undef CONFIG_DEBUG 
     50#if defined(CONFIG_YABEL_DEBUG_FLAGS) && (CONFIG_YABEL_DEBUG_FLAGS != 0) 
     51#define DEBUG 
     52#else 
     53#undef DEBUG 
    5254#endif 
    5355 
     
    165167void    X86EMU_halt_sys(void); 
    166168 
    167 #ifdef  CONFIG_DEBUG 
     169#ifdef  DEBUG 
    168170#define HALT_SYS()      \ 
    169171        printk("halt_sys: in %s\n", __func__);  \ 
  • trunk/util/x86emu/x86_asm.S

    r4911 r5131  
    171171        .code16 /* 16 bit code from here on... */ 
    172172 
    173         // CONFIG_DEBUG 
     173        // DEBUG 
    174174        movb    $0xec, %al 
    175175        outb    %al, $0x80 
  • trunk/util/x86emu/x86emu/debug.c

    r4532 r5131  
    4343/*----------------------------- Implementation ----------------------------*/ 
    4444 
    45 #ifdef CONFIG_DEBUG 
     45#ifdef DEBUG 
    4646 
    4747static void     print_encoded_bytes (u16 s, u16 o); 
     
    9595     * of the register struct.  All the major opcodes, once fully 
    9696     * decoded, have the following two steps: TRACE_REGS(r,m); 
    97      * SINGLE_STEP(r,m); which disappear if CONFIG_DEBUG is not defined to 
     97     * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to 
    9898     * the preprocessor.  The TRACE_REGS macro expands to: 
    9999     * 
     
    365365} 
    366366 
    367 #endif /* CONFIG_DEBUG */ 
     367#endif /* DEBUG */ 
    368368 
    369369void x86emu_dump_regs (void) 
  • trunk/util/x86emu/x86emu/debug.h

    r4532 r5131  
    4141#define __X86EMU_DEBUG_H 
    4242 
    43 //#define CONFIG_DEBUG 0 
    44 //#undef CONFIG_DEBUG 
     43//#define DEBUG 0 
     44//#undef DEBUG 
    4545/*---------------------- Macros and type definitions ----------------------*/ 
    4646 
     
    5252#define CHECK_DATA_ACCESS_F             0x8 /*using segment:offset*/ 
    5353 
    54 #ifdef CONFIG_DEBUG 
     54#ifdef DEBUG 
    5555# define CHECK_IP_FETCH()               (M.x86.check & CHECK_IP_FETCH_F) 
    5656# define CHECK_SP_ACCESS()              (M.x86.check & CHECK_SP_ACCESS_F) 
     
    6464#endif 
    6565 
    66 #ifdef CONFIG_DEBUG 
     66#ifdef DEBUG 
    6767# define DEBUG_INSTRUMENT()     (M.x86.debug & DEBUG_INSTRUMENT_F) 
    6868# define DEBUG_DECODE()         (M.x86.debug & DEBUG_DECODE_F) 
     
    107107#endif 
    108108 
    109 #ifdef CONFIG_DEBUG 
     109#ifdef DEBUG 
    110110 
    111111# define DECODE_PRINTF(x)       if (DEBUG_DECODE()) \ 
     
    137137#endif 
    138138 
    139 #ifdef CONFIG_DEBUG 
     139#ifdef DEBUG 
    140140#define TRACE_REGS()                                            \ 
    141141        if (DEBUG_DISASSEMBLE()) {                                      \ 
     
    148148#endif 
    149149 
    150 #ifdef CONFIG_DEBUG 
     150#ifdef DEBUG 
    151151# define SINGLE_STEP()          if (DEBUG_STEP()) x86emu_single_step() 
    152152#else 
     
    158158        SINGLE_STEP() 
    159159 
    160 #ifdef CONFIG_DEBUG 
     160#ifdef DEBUG 
    161161# define START_OF_INSTR() 
    162162# define END_OF_INSTR()         EndOfTheInstructionProcedure: x86emu_end_instr(); 
     
    168168#endif 
    169169 
    170 #ifdef CONFIG_DEBUG 
     170#ifdef DEBUG 
    171171# define  CALL_TRACE(u,v,w,x,s)                                 \ 
    172172        if (DEBUG_TRACECALLREGS())                                                                      \ 
     
    190190#endif 
    191191 
    192 #ifdef CONFIG_DEBUG 
     192#ifdef DEBUG 
    193193#define DB(x)   x 
    194194#else 
  • trunk/util/x86emu/x86emu/decode.c

    r4906 r5131  
    286286        return  M.x86.R_SS; 
    287287      default: 
    288 #ifdef  CONFIG_DEBUG 
     288#ifdef  DEBUG 
    289289        printk("error: should not happen:  multiple overrides.\n"); 
    290290#endif 
     
    306306    uint offset) 
    307307{ 
    308 #ifdef CONFIG_DEBUG 
     308#ifdef DEBUG 
    309309    if (CHECK_DATA_ACCESS()) 
    310310        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    325325    uint offset) 
    326326{ 
    327 #ifdef CONFIG_DEBUG 
     327#ifdef DEBUG 
    328328    if (CHECK_DATA_ACCESS()) 
    329329        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    344344    uint offset) 
    345345{ 
    346 #ifdef CONFIG_DEBUG 
     346#ifdef DEBUG 
    347347    if (CHECK_DATA_ACCESS()) 
    348348        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    365365    uint offset) 
    366366{ 
    367 #ifdef CONFIG_DEBUG 
     367#ifdef DEBUG 
    368368    if (CHECK_DATA_ACCESS()) 
    369369        x86emu_check_data_access(segment, offset); 
     
    386386    uint offset) 
    387387{ 
    388 #ifdef CONFIG_DEBUG 
     388#ifdef DEBUG 
    389389    if (CHECK_DATA_ACCESS()) 
    390390        x86emu_check_data_access(segment, offset); 
     
    407407    uint offset) 
    408408{ 
    409 #ifdef CONFIG_DEBUG 
     409#ifdef DEBUG 
    410410    if (CHECK_DATA_ACCESS()) 
    411411        x86emu_check_data_access(segment, offset); 
     
    429429    u8 val) 
    430430{ 
    431 #ifdef CONFIG_DEBUG 
     431#ifdef DEBUG 
    432432    if (CHECK_DATA_ACCESS()) 
    433433        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    451451    u16 val) 
    452452{ 
    453 #ifdef CONFIG_DEBUG 
     453#ifdef DEBUG 
    454454    if (CHECK_DATA_ACCESS()) 
    455455        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    473473    u32 val) 
    474474{ 
    475 #ifdef CONFIG_DEBUG 
     475#ifdef DEBUG 
    476476    if (CHECK_DATA_ACCESS()) 
    477477        x86emu_check_data_access((u16)get_data_segment(), offset); 
     
    496496    u8 val) 
    497497{ 
    498 #ifdef CONFIG_DEBUG 
     498#ifdef DEBUG 
    499499    if (CHECK_DATA_ACCESS()) 
    500500        x86emu_check_data_access(segment, offset); 
     
    519519    u16 val) 
    520520{ 
    521 #ifdef CONFIG_DEBUG 
     521#ifdef DEBUG 
    522522    if (CHECK_DATA_ACCESS()) 
    523523        x86emu_check_data_access(segment, offset); 
     
    542542    u32 val) 
    543543{ 
    544 #ifdef CONFIG_DEBUG 
     544#ifdef DEBUG 
    545545    if (CHECK_DATA_ACCESS()) 
    546546        x86emu_check_data_access(segment, offset); 
  • trunk/util/x86emu/x86emu/fpu.c

    r4532 r5131  
    5151} 
    5252 
    53 #ifdef CONFIG_DEBUG 
     53#ifdef DEBUG 
    5454 
    5555static char *x86emu_fpu_op_d9_tab[] = { 
     
    9090}; 
    9191 
    92 #endif /* CONFIG_DEBUG */ 
     92#endif /* DEBUG */ 
    9393 
    9494/* opcode=0xd9 */ 
     
    101101    START_OF_INSTR(); 
    102102    FETCH_DECODE_MODRM(mod, rh, rl); 
    103 #ifdef CONFIG_DEBUG 
     103#ifdef DEBUG 
    104104    if (mod != 3) { 
    105105        DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl); 
     
    295295} 
    296296 
    297 #ifdef CONFIG_DEBUG 
     297#ifdef DEBUG 
    298298 
    299299char *x86emu_fpu_op_da_tab[] = { 
     
    317317}; 
    318318 
    319 #endif /* CONFIG_DEBUG */ 
     319#endif /* DEBUG */ 
    320320 
    321321/* opcode=0xda */ 
     
    385385} 
    386386 
    387 #ifdef CONFIG_DEBUG 
     387#ifdef DEBUG 
    388388 
    389389char *x86emu_fpu_op_db_tab[] = { 
     
    398398}; 
    399399 
    400 #endif /* CONFIG_DEBUG */ 
     400#endif /* DEBUG */ 
    401401 
    402402/* opcode=0xdb */ 
     
    408408    START_OF_INSTR(); 
    409409    FETCH_DECODE_MODRM(mod, rh, rl); 
    410 #ifdef CONFIG_DEBUG 
     410#ifdef DEBUG 
    411411    if (mod != 3) { 
    412412        DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl); 
     
    429429        DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl)); 
    430430    } 
    431 #endif /* CONFIG_DEBUG */ 
     431#endif /* DEBUG */ 
    432432    switch (mod) { 
    433433      case 0: 
     
    505505} 
    506506 
    507 #ifdef CONFIG_DEBUG 
     507#ifdef DEBUG 
    508508char *x86emu_fpu_op_dc_tab[] = { 
    509509    "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ", 
     
    525525    "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t", 
    526526}; 
    527 #endif /* CONFIG_DEBUG */ 
     527#endif /* DEBUG */ 
    528528 
    529529/* opcode=0xdc */ 
     
    619619} 
    620620 
    621 #ifdef CONFIG_DEBUG 
     621#ifdef DEBUG 
    622622 
    623623static char *x86emu_fpu_op_dd_tab[] = { 
     
    635635}; 
    636636 
    637 #endif /* CONFIG_DEBUG */ 
     637#endif /* DEBUG */ 
    638638 
    639639/* opcode=0xdd */ 
     
    719719} 
    720720 
    721 #ifdef CONFIG_DEBUG 
     721#ifdef DEBUG 
    722722 
    723723static char *x86emu_fpu_op_de_tab[] = 
     
    742742}; 
    743743 
    744 #endif /* CONFIG_DEBUG */ 
     744#endif /* DEBUG */ 
    745745 
    746746/* opcode=0xde */ 
     
    838838} 
    839839 
    840 #ifdef CONFIG_DEBUG 
     840#ifdef DEBUG 
    841841 
    842842static char *x86emu_fpu_op_df_tab[] = { 
     
    861861}; 
    862862 
    863 #endif /* CONFIG_DEBUG */ 
     863#endif /* DEBUG */ 
    864864 
    865865/* opcode=0xdf */ 
  • trunk/util/x86emu/x86emu/ops.c

    r4906 r5131  
    7777/* constant arrays to do several instructions in just one function */ 
    7878 
    79 #ifdef CONFIG_DEBUG 
     79#ifdef DEBUG 
    8080static char *x86emu_GenOpName[8] = { 
    8181    "ADD", "OR", "ADC", "SBB", "AND", "SUB", "XOR", "CMP"}; 
     
    158158}; 
    159159 
    160 #ifdef CONFIG_DEBUG 
     160#ifdef DEBUG 
    161161 
    162162static char *opF6_names[8] = 
     
    12861286    START_OF_INSTR(); 
    12871287    FETCH_DECODE_MODRM(mod, rh, rl); 
    1288 #ifdef CONFIG_DEBUG 
     1288#ifdef DEBUG 
    12891289    if (DEBUG_DECODE()) { 
    12901290        /* XXX DECODE_PRINTF may be changed to something more 
     
    13621362    START_OF_INSTR(); 
    13631363    FETCH_DECODE_MODRM(mod, rh, rl); 
    1364 #ifdef CONFIG_DEBUG 
     1364#ifdef DEBUG 
    13651365    if (DEBUG_DECODE()) { 
    13661366        /* XXX DECODE_PRINTF may be changed to something more 
     
    14721472    START_OF_INSTR(); 
    14731473    FETCH_DECODE_MODRM(mod, rh, rl); 
    1474 #ifdef CONFIG_DEBUG 
     1474#ifdef DEBUG 
    14751475    if (DEBUG_DECODE()) { 
    14761476        /* XXX DECODE_PRINTF may be changed to something more 
     
    15461546    START_OF_INSTR(); 
    15471547    FETCH_DECODE_MODRM(mod, rh, rl); 
    1548 #ifdef CONFIG_DEBUG 
     1548#ifdef DEBUG 
    15491549    if (DEBUG_DECODE()) { 
    15501550        /* XXX DECODE_PRINTF may be changed to something more 
     
    31283128    START_OF_INSTR(); 
    31293129    FETCH_DECODE_MODRM(mod, rh, rl); 
    3130 #ifdef CONFIG_DEBUG 
     3130#ifdef DEBUG 
    31313131    if (DEBUG_DECODE()) { 
    31323132        /* XXX DECODE_PRINTF may be changed to something more 
     
    32033203    START_OF_INSTR(); 
    32043204    FETCH_DECODE_MODRM(mod, rh, rl); 
    3205 #ifdef CONFIG_DEBUG 
     3205#ifdef DEBUG 
    32063206    if (DEBUG_DECODE()) { 
    32073207        /* XXX DECODE_PRINTF may be changed to something more 
     
    36803680    START_OF_INSTR(); 
    36813681    FETCH_DECODE_MODRM(mod, rh, rl); 
    3682 #ifdef CONFIG_DEBUG 
     3682#ifdef DEBUG 
    36833683    if (DEBUG_DECODE()) { 
    36843684        /* XXX DECODE_PRINTF may be changed to something more 
     
    37513751    START_OF_INSTR(); 
    37523752    FETCH_DECODE_MODRM(mod, rh, rl); 
    3753 #ifdef CONFIG_DEBUG 
     3753#ifdef DEBUG 
    37543754    if (DEBUG_DECODE()) { 
    37553755        /* XXX DECODE_PRINTF may be changed to something more 
     
    38533853    START_OF_INSTR(); 
    38543854    FETCH_DECODE_MODRM(mod, rh, rl); 
    3855 #ifdef CONFIG_DEBUG 
     3855#ifdef DEBUG 
    38563856    if (DEBUG_DECODE()) { 
    38573857        /* XXX DECODE_PRINTF may be changed to something more 
     
    39263926    START_OF_INSTR(); 
    39273927    FETCH_DECODE_MODRM(mod, rh, rl); 
    3928 #ifdef CONFIG_DEBUG 
     3928#ifdef DEBUG 
    39293929    if (DEBUG_DECODE()) { 
    39303930        /* XXX DECODE_PRINTF may be changed to something more 
     
    49294929    START_OF_INSTR(); 
    49304930    FETCH_DECODE_MODRM(mod, rh, rl); 
    4931 #ifdef CONFIG_DEBUG 
     4931#ifdef DEBUG 
    49324932    if (DEBUG_DECODE()) { 
    49334933        /* XXX DECODE_PRINTF may be changed to something more 
     
    49954995    START_OF_INSTR(); 
    49964996    FETCH_DECODE_MODRM(mod, rh, rl); 
    4997 #ifdef CONFIG_DEBUG 
     4997#ifdef DEBUG 
    49984998    if (DEBUG_DECODE()) { 
    49994999        /* XXX DECODE_PRINTF may be changed to something more 
  • trunk/util/x86emu/yabel/biosemu.c

    r5040 r5131  
    5858        u8 *rom_image; 
    5959        int i = 0; 
    60 #ifdef CONFIG_DEBUG 
     60#ifdef DEBUG 
    6161        debug_flags = 0;//DEBUG_PRINT_INT10 | DEBUG_PNP | DEBUG_INTR | DEBUG_CHECK_VMEM_ACCESS | DEBUG_MEM | DEBUG_IO; 
    6262                // | DEBUG_CHECK_VMEM_ACCESS | DEBUG_MEM | DEBUG_IO; 
     
    253253                X86EMU_trace_on(); 
    254254        } else { 
    255 #ifdef CONFIG_DEBUG 
     255#ifdef DEBUG 
    256256                M.x86.debug |= DEBUG_SAVE_IP_CS_F; 
    257257                M.x86.debug |= DEBUG_DECODE_F; 
     
    274274         */ 
    275275        DEBUG_PRINTF_CS_IP("Option ROM Exit Status: %04x\n", M.x86.R_AX); 
    276 #ifdef CONFIG_DEBUG 
     276#ifdef DEBUG 
    277277        DEBUG_PRINTF("Exit Status Decode:\n"); 
    278278        if (M.x86.R_AX & 0x100) {       // bit 8 
  • trunk/util/x86emu/yabel/debug.h

    r5040 r5131  
    7070#define DEBUG_JMP 0x2000 
    7171 
    72 //#define CONFIG_DEBUG 
    73 //#undef CONFIG_DEBUG 
    74 #ifdef CONFIG_DEBUG 
     72//#define DEBUG 
     73//#undef DEBUG 
     74#ifdef DEBUG 
    7575 
    7676#define CHECK_DBG(_flag) if (debug_flags & _flag) 
     
    104104#define DEBUG_PRINTF_PNP(_x...) 
    105105 
    106 #endif                          //CONFIG_DEBUG 
     106#endif                          //DEBUG 
    107107 
    108108void dump(u8 * addr, u32 len); 
  • trunk/util/x86emu/yabel/device.c

    r5041 r5131  
    113113        // store last entry index of translate_address_array 
    114114        taa_last_entry = taa_index - 1; 
    115 #ifdef CONFIG_DEBUG 
     115#ifdef DEBUG 
    116116        //dump translate_address_array 
    117117        printf("translate_address_array: \n"); 
     
    196196        // store last entry index of translate_address_array 
    197197        taa_last_entry = taa_index - 1; 
    198 #ifdef CONFIG_DEBUG 
     198#ifdef DEBUG 
    199199        //dump translate_address_array 
    200200        printf("translate_address_array: \n"); 
     
    335335                       sizeof(pci_ds)); 
    336336                clr_ci(); 
    337 #ifdef CONFIG_DEBUG 
     337#ifdef DEBUG 
    338338                DEBUG_PRINTF("PCI Data Structure @%lx:\n", 
    339339                             rom_base_addr + pci_ds_offset); 
  • trunk/util/x86emu/yabel/mem.c

    r5040 r5131  
    2020 
    2121// define a check for access to certain (virtual) memory regions (interrupt handlers, BIOS Data Area, ...) 
    22 #ifdef CONFIG_DEBUG 
     22#ifdef DEBUG 
    2323static u8 in_check = 0; // to avoid recursion... 
    2424u16 ebda_segment; 
Note: See TracChangeset for help on using the changeset viewer.