ia64/xen-unstable

changeset 16098:f6a06b2eefc5

x86: Fix time-scale calculation to avoid #DE fault.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Thu Oct 11 19:23:40 2007 +0100 (2007-10-11)
parents d5531095d06b
children 4746c8c9372f
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Thu Oct 11 19:18:12 2007 +0100
     1.2 +++ b/xen/arch/x86/time.c	Thu Oct 11 19:23:40 2007 +0100
     1.3 @@ -214,6 +214,8 @@ static void set_time_scale(struct time_s
     1.4      u32 tps32;
     1.5      int shift = 0;
     1.6  
     1.7 +    ASSERT(tps64 != 0);
     1.8 +
     1.9      while ( tps64 > (MILLISECS(1000)*2) )
    1.10      {
    1.11          tps64 >>= 1;
    1.12 @@ -221,7 +223,7 @@ static void set_time_scale(struct time_s
    1.13      }
    1.14  
    1.15      tps32 = (u32)tps64;
    1.16 -    while ( tps32 < (u32)MILLISECS(1000) )
    1.17 +    while ( tps32 <= (u32)MILLISECS(1000) )
    1.18      {
    1.19          tps32 <<= 1;
    1.20          shift++;