aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/rtc.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-01-23 14:17:10 +0100
committerJan Beulich <jbeulich@suse.com>2013-01-23 14:17:10 +0100
commit2fe82ac11fd078485388fe7c5e8bc3b6ac9185b0 (patch)
treef71f1cc4b54b1a7dd50cae05a6350214cbbcac77 /xen/arch/x86/hvm/rtc.c
parentadc5afbf1c70ef55c260fb93e4b8ce5ccb918706 (diff)
downloadxen-2fe82ac11fd078485388fe7c5e8bc3b6ac9185b0.tar.gz
xen-2fe82ac11fd078485388fe7c5e8bc3b6ac9185b0.tar.bz2
xen-2fe82ac11fd078485388fe7c5e8bc3b6ac9185b0.zip
x86/HVM: use RTC_* names instead of literal numbers
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/rtc.c')
-rw-r--r--xen/arch/x86/hvm/rtc.c7
1 files 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);