From 2fe82ac11fd078485388fe7c5e8bc3b6ac9185b0 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 23 Jan 2013 14:17:10 +0100 Subject: [PATCH] x86/HVM: use RTC_* names instead of literal numbers Signed-off-by: Jan Beulich Acked-by: Keir Fraser --- xen/arch/x86/hvm/rtc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index b994e99ad9..1aac5b5273 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -53,8 +53,9 @@ static inline int convert_hour(RTCState *s, int hour); 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); } @@ -463,7 +464,7 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) 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); @@ -471,7 +472,7 @@ static inline int to_bcd(RTCState *s, int a) 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); -- 2.39.5