diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-24 09:38:16 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-24 09:38:16 +0000 |
commit | ea026b2fc32bdddad6df22f7ab952761a29d9e6b (patch) | |
tree | 9662eb1daba7272ed35cecfc128c75632ee887b0 /hw/mac_nvram.c | |
parent | 4017190e2d75882a0e9dbc40f403e584e0ab46c4 (diff) | |
download | qemu-ea026b2fc32bdddad6df22f7ab952761a29d9e6b.zip |
Improve PPC device debugging
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6126 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mac_nvram.c')
-rw-r--r-- | hw/mac_nvram.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/hw/mac_nvram.c b/hw/mac_nvram.c index f608ace71d..3787f54d65 100644 --- a/hw/mac_nvram.c +++ b/hw/mac_nvram.c @@ -25,6 +25,16 @@ #include "hw.h" #include "ppc_mac.h" +/* debug NVR */ +//#define DEBUG_NVR + +#ifdef DEBUG_NVR +#define NVR_DPRINTF(fmt, args...) \ +do { printf("NVR: " fmt , ##args); } while (0) +#else +#define NVR_DPRINTF(fmt, args...) +#endif + struct MacIONVRAMState { target_phys_addr_t size; int mem_index; @@ -37,11 +47,11 @@ uint32_t macio_nvram_read (void *opaque, uint32_t addr) MacIONVRAMState *s = opaque; uint32_t ret; - // printf("%s: %p addr %04x\n", __func__, s, addr); if (addr < 0x2000) ret = s->data[addr]; else ret = -1; + NVR_DPRINTF("read addr %04x val %x\n", addr, ret); return ret; } @@ -50,7 +60,7 @@ void macio_nvram_write (void *opaque, uint32_t addr, uint32_t val) { MacIONVRAMState *s = opaque; - // printf("%s: %p addr %04x val %02x\n", __func__, s, addr, val); + NVR_DPRINTF("write addr %04x val %x\n", addr, val); if (addr < 0x2000) s->data[addr] = val; } @@ -63,7 +73,7 @@ static void macio_nvram_writeb (void *opaque, addr = (addr >> 4) & 0x1fff; s->data[addr] = value; - // printf("macio_nvram_writeb %04x = %02x\n", addr, value); + NVR_DPRINTF("writeb addr %04x val %x\n", (int)addr, value); } static uint32_t macio_nvram_readb (void *opaque, target_phys_addr_t addr) @@ -73,7 +83,7 @@ static uint32_t macio_nvram_readb (void *opaque, target_phys_addr_t addr) addr = (addr >> 4) & 0x1fff; value = s->data[addr]; - // printf("macio_nvram_readb %04x = %02x\n", addr, value); + NVR_DPRINTF("readb addr %04x val %x\n", (int)addr, value); return value; } |