aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-05-29 20:23:49 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-05-29 20:23:49 +0000
commit471fd34221dcda9b271a3016f95e1ad12842c5ff (patch)
tree26a5ea4273dce5c48da33091867b035c5279bd36 /hw/pc.c
parent0a3c59216673e71ca53daef6f05fade33f41e83b (diff)
downloadqemu-471fd34221dcda9b271a3016f95e1ad12842c5ff.zip
qemu-471fd34221dcda9b271a3016f95e1ad12842c5ff.tar.gz
qemu-471fd34221dcda9b271a3016f95e1ad12842c5ff.tar.bz2
pc: improve debugging
Add a DPRINTF macro and use it for ISA and PIC interrupts. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index e7f31d3..9b85c42 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -39,6 +39,16 @@
/* output Bochs bios info messages */
//#define DEBUG_BIOS
+/* debug PC/ISA interrupts */
+//#define DEBUG_IRQ
+
+#ifdef DEBUG_IRQ
+#define DPRINTF(fmt, ...) \
+ do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...)
+#endif
+
#define BIOS_FILENAME "bios.bin"
#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
@@ -70,6 +80,7 @@ void isa_irq_handler(void *opaque, int n, int level)
{
IsaIrqState *isa = (IsaIrqState *)opaque;
+ DPRINTF("isa_irqs: %s irq %d\n", level? "raise" : "lower", n);
if (n < 16) {
qemu_set_irq(isa->i8259[n], level);
}
@@ -150,6 +161,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
{
CPUState *env = first_cpu;
+ DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq);
if (env->apic_state) {
while (env) {
if (apic_accept_pic_intr(env))