#include "mips.h"
#include "console.h"
#include "pixel_ops.h"
-
-//#define DEBUG_G364
-
-#ifdef DEBUG_G364
-#define DPRINTF(fmt, ...) \
-do { printf("g364: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0)
+#include "trace.h"
typedef struct G364State {
/* hardware */
w = 4;
break;
default:
- BADF("unknown host depth %d\n", ds_get_bits_per_pixel(s->ds));
+ hw_error("g364: unknown host depth %d",
+ ds_get_bits_per_pixel(s->ds));
return;
}
} else if (s->depth == 8) {
g364fb_draw_graphic8(s);
} else {
- BADF("unknown guest depth %d\n", s->depth);
+ error_report("g364: unknown guest depth %d", s->depth);
}
qemu_irq_raise(s->irq);
FILE *f;
if (s->depth != 8) {
- BADF("unknown guest depth %d\n", s->depth);
+ error_report("g364: unknown guest depth %d", s->depth);
return;
}
break;
default:
{
- BADF("invalid read at [" TARGET_FMT_plx "]\n", addr);
+ error_report("g364: invalid read at [" TARGET_FMT_plx "]",
+ addr);
val = 0;
break;
}
}
}
- DPRINTF("read 0x%08x at [" TARGET_FMT_plx "]\n", val, addr);
+ trace_g364fb_read(addr, val);
return val;
}
{
G364State *s = opaque;
- DPRINTF("write 0x%08x at [" TARGET_FMT_plx "]\n", val, addr);
+ trace_g364fb_write(addr, val);
if (addr >= REG_CLR_PAL && addr < REG_CLR_PAL + 0x800) {
/* color palette */
g364fb_reset(s);
break;
default:
- BADF("invalid write of 0x%08x at [" TARGET_FMT_plx "]\n", val, addr);
+ error_report("g364: invalid write of 0x%" PRIx64
+ " at [" TARGET_FMT_plx "]", val, addr);
break;
}
}
disable qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
disable qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
+# hw/g364fb.c
+disable g364fb_read(uint64_t addr, uint32_t val) "read addr=0x%"PRIx64": 0x%x"
+disable g364fb_write(uint64_t addr, uint32_t new) "write addr=0x%"PRIx64": 0x%x"
+
# hw/grlib_gptimer.c
disable grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x and run"
disable grlib_gptimer_disabled(int id, uint32_t config) "timer:%d Timer disable config 0x%x"