Revision ec51e364 hw/mc146818rtc.c

b/hw/mc146818rtc.c
32 32

  
33 33
//#define DEBUG_CMOS
34 34

  
35
#ifdef DEBUG_CMOS
36
# define CMOS_DPRINTF(format, ...)      printf(format, ## __VA_ARGS__)
37
#else
38
# define CMOS_DPRINTF(format, ...)      do { } while (0)
39
#endif
40

  
35 41
#define RTC_REINJECT_ON_ACK_COUNT 20
36 42

  
37 43
#define RTC_SECONDS             0
......
211 217
    if ((addr & 1) == 0) {
212 218
        s->cmos_index = data & 0x7f;
213 219
    } else {
214
#ifdef DEBUG_CMOS
215
        printf("cmos: write index=0x%02x val=0x%02x\n",
216
               s->cmos_index, data);
217
#endif
220
        CMOS_DPRINTF("cmos: write index=0x%02x val=0x%02x\n",
221
                     s->cmos_index, data);
218 222
        switch(s->cmos_index) {
219 223
        case RTC_SECONDS_ALARM:
220 224
        case RTC_MINUTES_ALARM:
......
485 489
            ret = s->cmos_data[s->cmos_index];
486 490
            break;
487 491
        }
488
#ifdef DEBUG_CMOS
489
        printf("cmos: read index=0x%02x val=0x%02x\n",
490
               s->cmos_index, ret);
491
#endif
492
        CMOS_DPRINTF("cmos: read index=0x%02x val=0x%02x\n",
493
                     s->cmos_index, ret);
492 494
        return ret;
493 495
    }
494 496
}

Also available in: Unified diff