ia64/xen-unstable

changeset 3310:52a19a143c6b

bitkeeper revision 1.1159.187.73 (41c84bfcHrB3tsqtfHhmJsD8FvwR_Q)

Fix gettimeofday and settimeofday to account system time that has
not yet been processed by the timer ISR.
author kaf24@scramble.cl.cam.ac.uk
date Tue Dec 21 16:14:52 2004 +0000 (2004-12-21)
parents dc2f08429f17
children c55cd4b21325 391b2a76a749
files linux-2.4.28-xen-sparse/arch/xen/kernel/time.c
line diff
     1.1 --- a/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c	Tue Dec 21 14:20:49 2004 +0000
     1.2 +++ b/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c	Tue Dec 21 16:14:52 2004 +0000
     1.3 @@ -266,6 +266,9 @@ void do_gettimeofday(struct timeval *tv)
     1.4      _tv.tv_sec   = xtime.tv_sec;
     1.5      _tv.tv_usec += xtime.tv_usec;
     1.6  
     1.7 +    _tv.tv_usec += 
     1.8 +        (unsigned long)(shadow_system_time - processed_system_time) / 1000UL;
     1.9 +
    1.10      if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
    1.11      {
    1.12          /*
    1.13 @@ -315,6 +318,8 @@ void do_settimeofday(struct timeval *tv)
    1.14       */
    1.15   again:
    1.16      usec = tv->tv_usec - __get_time_delta_usecs();
    1.17 +    usec -= 
    1.18 +        (unsigned long)(shadow_system_time - processed_system_time) / 1000UL;
    1.19      if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
    1.20      {
    1.21          __get_time_values_from_xen();