Revision d12d51d5 vl.c

b/vl.c
154 154
//#define DEBUG_NET
155 155
//#define DEBUG_SLIRP
156 156

  
157

  
158
#ifdef DEBUG_IOPORT
159
#  define LOG_IOPORT(...) do {           \
160
     if (loglevel & CPU_LOG_IOPORT)      \
161
       fprintf(logfile, ## __VA_ARGS__); \
162
   } while (0)
163
#else
164
#  define LOG_IOPORT(...) do { } while (0)
165
#endif
166

  
157 167
#ifdef TARGET_PPC
158 168
#define DEFAULT_RAM_SIZE 144
159 169
#else
......
409 419

  
410 420
void cpu_outb(CPUState *env, int addr, int val)
411 421
{
412
#ifdef DEBUG_IOPORT
413
    if (loglevel & CPU_LOG_IOPORT)
414
        fprintf(logfile, "outb: %04x %02x\n", addr, val);
415
#endif
422
    LOG_IOPORT("outb: %04x %02x\n", addr, val);
416 423
    ioport_write(0, addr, val);
417 424
#ifdef USE_KQEMU
418 425
    if (env)
......
422 429

  
423 430
void cpu_outw(CPUState *env, int addr, int val)
424 431
{
425
#ifdef DEBUG_IOPORT
426
    if (loglevel & CPU_LOG_IOPORT)
427
        fprintf(logfile, "outw: %04x %04x\n", addr, val);
428
#endif
432
    LOG_IOPORT("outw: %04x %04x\n", addr, val);
429 433
    ioport_write(1, addr, val);
430 434
#ifdef USE_KQEMU
431 435
    if (env)
......
435 439

  
436 440
void cpu_outl(CPUState *env, int addr, int val)
437 441
{
438
#ifdef DEBUG_IOPORT
439
    if (loglevel & CPU_LOG_IOPORT)
440
        fprintf(logfile, "outl: %04x %08x\n", addr, val);
441
#endif
442
    LOG_IOPORT("outl: %04x %08x\n", addr, val);
442 443
    ioport_write(2, addr, val);
443 444
#ifdef USE_KQEMU
444 445
    if (env)
......
450 451
{
451 452
    int val;
452 453
    val = ioport_read(0, addr);
453
#ifdef DEBUG_IOPORT
454
    if (loglevel & CPU_LOG_IOPORT)
455
        fprintf(logfile, "inb : %04x %02x\n", addr, val);
456
#endif
454
    LOG_IOPORT("inb : %04x %02x\n", addr, val);
457 455
#ifdef USE_KQEMU
458 456
    if (env)
459 457
        env->last_io_time = cpu_get_time_fast();
......
465 463
{
466 464
    int val;
467 465
    val = ioport_read(1, addr);
468
#ifdef DEBUG_IOPORT
469
    if (loglevel & CPU_LOG_IOPORT)
470
        fprintf(logfile, "inw : %04x %04x\n", addr, val);
471
#endif
466
    LOG_IOPORT("inw : %04x %04x\n", addr, val);
472 467
#ifdef USE_KQEMU
473 468
    if (env)
474 469
        env->last_io_time = cpu_get_time_fast();
......
480 475
{
481 476
    int val;
482 477
    val = ioport_read(2, addr);
483
#ifdef DEBUG_IOPORT
484
    if (loglevel & CPU_LOG_IOPORT)
485
        fprintf(logfile, "inl : %04x %08x\n", addr, val);
486
#endif
478
    LOG_IOPORT("inl : %04x %08x\n", addr, val);
487 479
#ifdef USE_KQEMU
488 480
    if (env)
489 481
        env->last_io_time = cpu_get_time_fast();

Also available in: Unified diff