Cx fix - Add wrap-back calculation for 24b PM timer ticks.
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 24 May 2008 08:23:40 +0000 (09:23 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 24 May 2008 08:23:40 +0000 (09:23 +0100)
Signed-off-by: Wei Gang <gang.wei@intel.com>
xen/arch/x86/acpi/cpu_idle.c

index 0d471d9a7da6e292d541c3d3bd944e21d9fe4e8e..bf81d6398433ee084128f5238082e4682e0164f9 100644 (file)
@@ -173,6 +173,8 @@ static inline u32 ticks_elapsed(u32 t1, u32 t2)
 {
     if ( t2 >= t1 )
         return (t2 - t1);
+    else if ( !(acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER) )
+        return (((0x00FFFFFF - t1) + t2) & 0x00FFFFFF);
     else
         return ((0xFFFFFFFF - t1) + t2);
 }