ia64/xen-unstable

changeset 12582:8795be1653c9

[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>
author kfraser@localhost.localdomain
date Mon Nov 27 10:14:45 2006 +0000 (2006-11-27)
parents f711b87ba951
children d9c8a18624fb
files xen/arch/x86/hvm/rtc.c
line diff
     1.1 --- a/xen/arch/x86/hvm/rtc.c	Mon Nov 27 10:09:19 2006 +0000
     1.2 +++ b/xen/arch/x86/hvm/rtc.c	Mon Nov 27 10:14:45 2006 +0000
     1.3 @@ -282,11 +282,14 @@ static void rtc_update_second2(void *opa
     1.4      if ( s->cmos_data[RTC_REG_B] & RTC_AIE )
     1.5      {
     1.6          if ( ((s->cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 ||
     1.7 -              s->cmos_data[RTC_SECONDS_ALARM] == s->current_tm.tm_sec) &&
     1.8 +              from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) ==
     1.9 +              s->current_tm.tm_sec) &&
    1.10               ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 ||
    1.11 -              s->cmos_data[RTC_MINUTES_ALARM] == s->current_tm.tm_mon) &&
    1.12 +              from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) ==
    1.13 +              s->current_tm.tm_min) &&
    1.14               ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 ||
    1.15 -              s->cmos_data[RTC_HOURS_ALARM] == s->current_tm.tm_hour) )
    1.16 +              from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) ==
    1.17 +              s->current_tm.tm_hour) )
    1.18          {
    1.19              s->cmos_data[RTC_REG_C] |= 0xa0; 
    1.20              hvm_isa_irq_deassert(s->vcpu->domain, s->irq);