[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V10 25/27] acpi_piix4: remove #ifdef DEBUG.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V10 25/27] acpi_piix4: remove #ifdef DEBUG. |
Date: |
Thu, 24 Dec 2009 17:09:18 +0900 |
removed #ifdef DEBUG by using macro.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/acpi_piix4.c | 54 ++++++++++++++++++------------------------------------
1 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 59a4d0f..aa63f0e 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -29,6 +29,12 @@
//#define DEBUG
+#ifdef DEBUG
+# define PIIX4_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define PIIX4_DPRINTF(format, ...) do { } while (0)
+#endif
+
#define ACPI_DBG_IO_ADDR 0xb044
#define GPE_BASE 0xafe0
@@ -170,9 +176,7 @@ static void pm_ioport_writew(void *opaque, uint32_t addr,
uint32_t val)
default:
break;
}
-#ifdef DEBUG
- printf("PM writew port=0x%04x val=0x%04x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
}
static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
@@ -195,9 +199,7 @@ static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
val = 0;
break;
}
-#ifdef DEBUG
- printf("PM readw port=0x%04x val=0x%04x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
return val;
}
@@ -205,9 +207,7 @@ static void pm_ioport_writel(void *opaque, uint32_t addr,
uint32_t val)
{
// PIIX4PMState *s = opaque;
addr &= 0x3f;
-#ifdef DEBUG
- printf("PM writel port=0x%04x val=0x%08x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("PM writel port=0x%04x val=0x%08x\n", addr, val);
}
static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
@@ -224,9 +224,7 @@ static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
val = 0;
break;
}
-#ifdef DEBUG
- printf("PM readl port=0x%04x val=0x%08x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("PM readl port=0x%04x val=0x%08x\n", addr, val);
return val;
}
@@ -248,9 +246,7 @@ static void apm_ctrl_changed(uint32_t val, void *arg)
static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
{
-#if defined(DEBUG)
- printf("ACPI: DBG: 0x%08x\n", val);
-#endif
+ PIIX4_DPRINTF("ACPI: DBG: 0x%08x\n", val);
}
static void pm_io_space_update(PIIX4PMState *s)
@@ -262,9 +258,7 @@ static void pm_io_space_update(PIIX4PMState *s)
pm_io_base &= 0xffc0;
/* XXX: need to improve memory and ioport allocation */
-#if defined(DEBUG)
- printf("PM: mapping to 0x%x\n", pm_io_base);
-#endif
+ PIIX4_DPRINTF("PM: mapping to 0x%x\n", pm_io_base);
register_ioport_write(pm_io_base, 64, 2, pm_ioport_writew, s);
register_ioport_read(pm_io_base, 64, 2, pm_ioport_readw, s);
register_ioport_write(pm_io_base, 64, 4, pm_ioport_writel, s);
@@ -450,9 +444,7 @@ static uint32_t gpe_readb(void *opaque, uint32_t addr)
break;
}
-#if defined(DEBUG)
- printf("gpe read %x == %x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("gpe read %x == %x\n", addr, val);
return val;
}
@@ -492,9 +484,7 @@ static void gpe_writeb(void *opaque, uint32_t addr,
uint32_t val)
break;
}
-#if defined(DEBUG)
- printf("gpe write %x <== %d\n", addr, val);
-#endif
+ PIIX4_DPRINTF("gpe write %x <== %d\n", addr, val);
}
static uint32_t pcihotplug_read(void *opaque, uint32_t addr)
@@ -512,9 +502,7 @@ static uint32_t pcihotplug_read(void *opaque, uint32_t addr)
break;
}
-#if defined(DEBUG)
- printf("pcihotplug read %x == %x\n", addr, val);
-#endif
+ PIIX4_DPRINTF("pcihotplug read %x == %x\n", addr, val);
return val;
}
@@ -530,16 +518,12 @@ static void pcihotplug_write(void *opaque, uint32_t addr,
uint32_t val)
break;
}
-#if defined(DEBUG)
- printf("pcihotplug write %x <== %d\n", addr, val);
-#endif
+ PIIX4_DPRINTF("pcihotplug write %x <== %d\n", addr, val);
}
static uint32_t pciej_read(void *opaque, uint32_t addr)
{
-#if defined(DEBUG)
- printf("pciej read %x\n", addr);
-#endif
+ PIIX4_DPRINTF("pciej read %x\n", addr);
return 0;
}
@@ -558,9 +542,7 @@ static void pciej_write(void *opaque, uint32_t addr,
uint32_t val)
}
-#if defined(DEBUG)
- printf("pciej write %x <== %d\n", addr, val);
-#endif
+ PIIX4_DPRINTF("pciej write %x <== %d\n", addr, val);
}
static int piix4_device_hotplug(void *opaque, PCIDevice *dev, int state);
--
1.6.5.4
- [Qemu-devel] [PATCH V10 21/27] acpi_piix4: qdevfy., (continued)
- [Qemu-devel] [PATCH V10 21/27] acpi_piix4: qdevfy., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 04/27] acpi: split acpi.c into the common part and the piix4 part., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 22/27] pci hotplug: add argument to pci hot plug callback., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 09/27] pc: remove a global variable, floppy_controller., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 20/27] rtc: make rtc_xxx accept/return ISADevice instead of RTCState., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 15/27] pc: split out vga initialization from pc_init1() into pc_vga_init()., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 11/27] pc: introduce a function to allocate cpu irq., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 23/27] pci hotadd, acpi_piix4: remove global variables., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 01/27] acpi: split out pc smbus routines from acpi.c into pc_smbus.c, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 08/27] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 25/27] acpi_piix4: remove #ifdef DEBUG.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH V10 13/27] pc: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 24/27] pc_smbus: remove #ifdef DEBUG., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 26/27] pc_apm: remove #ifdef DEBUG., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 07/27] pc, i440fx: Make smm enable/disable function i440fx independent., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 02/27] acpi: split out apm register emulation from acpi.c, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 10/27] pc: remove global variable rtc_state by using qemu_irq., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 06/27] pc: initialize ioapic before use., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 14/27] pc: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 16/27] pc: split out basic device init from pc_init1() into pc_basic_device_init(), Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 18/27] pc: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2009/12/24