From ea026b2fc32bdddad6df22f7ab952761a29d9e6b Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Wed, 24 Dec 2008 09:38:16 +0000 Subject: Improve PPC device debugging git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6126 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/grackle_pci.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'hw/grackle_pci.c') diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c index c6aee94822..c11b9ef733 100644 --- a/hw/grackle_pci.c +++ b/hw/grackle_pci.c @@ -27,6 +27,16 @@ #include "ppc_mac.h" #include "pci.h" +/* debug Grackle */ +//#define DEBUG_GRACKLE + +#ifdef DEBUG_GRACKLE +#define GRACKLE_DPRINTF(fmt, args...) \ +do { printf("GRACKLE: " fmt , ##args); } while (0) +#else +#define GRACKLE_DPRINTF(fmt, args...) +#endif + typedef target_phys_addr_t pci_addr_t; #include "pci_host.h" @@ -36,6 +46,9 @@ static void pci_grackle_config_writel (void *opaque, target_phys_addr_t addr, uint32_t val) { GrackleState *s = opaque; + + GRACKLE_DPRINTF("config_writel addr " TARGET_FMT_plx " val %x\n", addr, + val); #ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); #endif @@ -51,6 +64,8 @@ static uint32_t pci_grackle_config_readl (void *opaque, target_phys_addr_t addr) #ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); #endif + GRACKLE_DPRINTF("config_readl addr " TARGET_FMT_plx " val %x\n", addr, + val); return val; } @@ -86,6 +101,7 @@ static int pci_grackle_map_irq(PCIDevice *pci_dev, int irq_num) static void pci_grackle_set_irq(qemu_irq *pic, int irq_num, int level) { + GRACKLE_DPRINTF("set_irq num %d level %d\n", irq_num, level); qemu_set_irq(pic[irq_num + 0x15], level); } -- cgit v1.2.3