]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.187.73 (41c84bfcHrB3tsqtfHhmJsD8FvwR_Q)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 21 Dec 2004 16:14:52 +0000 (16:14 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 21 Dec 2004 16:14:52 +0000 (16:14 +0000)
Fix gettimeofday and settimeofday to account system time that has
not yet been processed by the timer ISR.

linux-2.4.28-xen-sparse/arch/xen/kernel/time.c

index 0a04c6c3b62a5961e7e8266d999d529cb176f970..04ceb5e0d431f29eae27c6b513ec7f0c99846ea3 100644 (file)
@@ -266,6 +266,9 @@ void do_gettimeofday(struct timeval *tv)
     _tv.tv_sec   = xtime.tv_sec;
     _tv.tv_usec += xtime.tv_usec;
 
+    _tv.tv_usec += 
+        (unsigned long)(shadow_system_time - processed_system_time) / 1000UL;
+
     if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
     {
         /*
@@ -315,6 +318,8 @@ void do_settimeofday(struct timeval *tv)
      */
  again:
     usec = tv->tv_usec - __get_time_delta_usecs();
+    usec -= 
+        (unsigned long)(shadow_system_time - processed_system_time) / 1000UL;
     if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
     {
         __get_time_values_from_xen();