static void rtc_periodic_cb(struct vcpu *v, void *opaque)
{
RTCState *s = opaque;
+
spin_lock(&s->lock);
- s->hw.cmos_data[RTC_REG_C] |= 0xc0;
+ s->hw.cmos_data[RTC_REG_C] |= RTC_PF | RTC_IRQF;
spin_unlock(&s->lock);
}
static inline int to_bcd(RTCState *s, int a)
{
- if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+ if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
return a;
else
return ((a / 10) << 4) | (a % 10);
static inline int from_bcd(RTCState *s, int a)
{
- if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+ if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
return a;
else
return ((a >> 4) * 10) + (a & 0x0f);