Revision 9af9b330 hw/ioapic.c

b/hw/ioapic.c
28 28

  
29 29
//#define DEBUG_IOAPIC
30 30

  
31
#ifdef DEBUG_IOAPIC
32
#define DPRINTF(fmt, ...)                                       \
33
    do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
34
#else
35
#define DPRINTF(fmt, ...)
36
#endif
37

  
31 38
#define IOAPIC_NUM_PINS			0x18
32 39
#define IOAPIC_LVT_MASKED 		(1<<16)
33 40

  
......
95 102
     * to GSI 2.  GSI maps to ioapic 1-1.  This is not
96 103
     * the cleanest way of doing it but it should work. */
97 104

  
105
    DPRINTF("%s: %s vec %x\n", __func__, level? "raise" : "lower", vector);
98 106
    if (vector == 0)
99 107
        vector = 2;
100 108

  
......
149 157
                        val = s->ioredtbl[index] & 0xffffffff;
150 158
                }
151 159
        }
152
#ifdef DEBUG_IOAPIC
153
        printf("I/O APIC read: %08x = %08x\n", s->ioregsel, val);
154
#endif
160
        DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
155 161
    }
156 162
    return val;
157 163
}
......
166 172
        s->ioregsel = val;
167 173
        return;
168 174
    } else if (addr == 0x10) {
169
#ifdef DEBUG_IOAPIC
170
        printf("I/O APIC write: %08x = %08x\n", s->ioregsel, val);
171
#endif
175
        DPRINTF("write: %08x = %08x\n", s->ioregsel, val);
172 176
        switch (s->ioregsel) {
173 177
            case 0x00:
174 178
                s->id = (val >> 24) & 0xff;

Also available in: Unified diff