diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-27 10:14:45 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-27 10:14:45 +0000 |
commit | e61c814cd6092530474bebda3c66133146525ba5 (patch) | |
tree | 80356d1dfe0beae9024c6919f70fab320717f9a3 /xen/arch/x86/hvm/rtc.c | |
parent | d81e62bebd4b283460026f4ef69110bac32b2eac (diff) | |
download | xen-e61c814cd6092530474bebda3c66133146525ba5.tar.gz xen-e61c814cd6092530474bebda3c66133146525ba5.tar.bz2 xen-e61c814cd6092530474bebda3c66133146525ba5.zip |
[HVM] Fix bugs in RTC alarm code.
- comparing bcd with binary data
- comparing min with mon
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Diffstat (limited to 'xen/arch/x86/hvm/rtc.c')
-rw-r--r-- | xen/arch/x86/hvm/rtc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index ea7f0ce9df..1f26dc9252 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -282,11 +282,14 @@ static void rtc_update_second2(void *opaque) if ( s->cmos_data[RTC_REG_B] & RTC_AIE ) { if ( ((s->cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_SECONDS_ALARM] == s->current_tm.tm_sec) && + from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) == + s->current_tm.tm_sec) && ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_MINUTES_ALARM] == s->current_tm.tm_mon) && + from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) == + s->current_tm.tm_min) && ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_HOURS_ALARM] == s->current_tm.tm_hour) ) + from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) == + s->current_tm.tm_hour) ) { s->cmos_data[RTC_REG_C] |= 0xa0; hvm_isa_irq_deassert(s->vcpu->domain, s->irq); |