Revision 50d8ff8b

b/hw/acpi_piix4.c
27 27

  
28 28
//#define DEBUG
29 29

  
30
#ifdef DEBUG
31
# define PIIX4_DPRINTF(format, ...)     printf(format, ## __VA_ARGS__)
32
#else
33
# define PIIX4_DPRINTF(format, ...)     do { } while (0)
34
#endif
35

  
30 36
#define ACPI_DBG_IO_ADDR  0xb044
31 37

  
32 38
#define GPE_BASE 0xafe0
......
172 178
    default:
173 179
        break;
174 180
    }
175
#ifdef DEBUG
176
    printf("PM writew port=0x%04x val=0x%04x\n", addr, val);
177
#endif
181
    PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
178 182
}
179 183

  
180 184
static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
......
197 201
        val = 0;
198 202
        break;
199 203
    }
200
#ifdef DEBUG
201
    printf("PM readw port=0x%04x val=0x%04x\n", addr, val);
202
#endif
204
    PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
203 205
    return val;
204 206
}
205 207

  
206 208
static void pm_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
207 209
{
208 210
    //    PIIX4PMState *s = opaque;
209
#ifdef DEBUG
210
    addr &= 0x3f;
211
    printf("PM writel port=0x%04x val=0x%08x\n", addr, val);
212
#endif
211
    PIIX4_DPRINTF("PM writel port=0x%04x val=0x%08x\n", addr & 0x3f, val);
213 212
}
214 213

  
215 214
static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
......
226 225
        val = 0;
227 226
        break;
228 227
    }
229
#ifdef DEBUG
230
    printf("PM readl port=0x%04x val=0x%08x\n", addr, val);
231
#endif
228
    PIIX4_DPRINTF("PM readl port=0x%04x val=0x%08x\n", addr, val);
232 229
    return val;
233 230
}
234 231

  
......
252 249

  
253 250
static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
254 251
{
255
#if defined(DEBUG)
256
    printf("ACPI: DBG: 0x%08x\n", val);
257
#endif
252
    PIIX4_DPRINTF("ACPI: DBG: 0x%08x\n", val);
258 253
}
259 254

  
260 255
static void pm_io_space_update(PIIX4PMState *s)
......
266 261
        pm_io_base &= 0xffc0;
267 262

  
268 263
        /* XXX: need to improve memory and ioport allocation */
269
#if defined(DEBUG)
270
        printf("PM: mapping to 0x%x\n", pm_io_base);
271
#endif
264
        PIIX4_DPRINTF("PM: mapping to 0x%x\n", pm_io_base);
272 265
        register_ioport_write(pm_io_base, 64, 2, pm_ioport_writew, s);
273 266
        register_ioport_read(pm_io_base, 64, 2, pm_ioport_readw, s);
274 267
        register_ioport_write(pm_io_base, 64, 4, pm_ioport_writel, s);
......
456 449
            break;
457 450
    }
458 451

  
459
#if defined(DEBUG)
460
    printf("gpe read %x == %x\n", addr, val);
461
#endif
452
    PIIX4_DPRINTF("gpe read %x == %x\n", addr, val);
462 453
    return val;
463 454
}
464 455

  
......
498 489
            break;
499 490
   }
500 491

  
501
#if defined(DEBUG)
502
    printf("gpe write %x <== %d\n", addr, val);
503
#endif
492
    PIIX4_DPRINTF("gpe write %x <== %d\n", addr, val);
504 493
}
505 494

  
506 495
static uint32_t pcihotplug_read(void *opaque, uint32_t addr)
......
518 507
            break;
519 508
    }
520 509

  
521
#if defined(DEBUG)
522
    printf("pcihotplug read %x == %x\n", addr, val);
523
#endif
510
    PIIX4_DPRINTF("pcihotplug read %x == %x\n", addr, val);
524 511
    return val;
525 512
}
526 513

  
......
536 523
            break;
537 524
   }
538 525

  
539
#if defined(DEBUG)
540
    printf("pcihotplug write %x <== %d\n", addr, val);
541
#endif
526
    PIIX4_DPRINTF("pcihotplug write %x <== %d\n", addr, val);
542 527
}
543 528

  
544 529
static uint32_t pciej_read(void *opaque, uint32_t addr)
545 530
{
546
#if defined(DEBUG)
547
    printf("pciej read %x\n", addr);
548
#endif
531
    PIIX4_DPRINTF("pciej read %x\n", addr);
549 532
    return 0;
550 533
}
551 534

  
......
564 547
    }
565 548

  
566 549

  
567
#if defined(DEBUG)
568
    printf("pciej write %x <== %d\n", addr, val);
569
#endif
550
    PIIX4_DPRINTF("pciej write %x <== %d\n", addr, val);
570 551
}
571 552

  
572 553
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state);

Also available in: Unified diff