aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-12-21 16:14:52 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-12-21 16:14:52 +0000
commitfb5cad1dc38a5b62432a937645397e7fe7ed860e (patch)
treec0da26c543d0196ecd518250a754af623bd17d32
parent24e3e9fbb586808252e59a3f9a22f31db035f5cb (diff)
downloadxen-fb5cad1dc38a5b62432a937645397e7fe7ed860e.tar.gz
xen-fb5cad1dc38a5b62432a937645397e7fe7ed860e.tar.bz2
xen-fb5cad1dc38a5b62432a937645397e7fe7ed860e.zip
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.
-rw-r--r--linux-2.4.28-xen-sparse/arch/xen/kernel/time.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c b/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c
index 0a04c6c3b6..04ceb5e0d4 100644
--- a/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c
+++ b/linux-2.4.28-xen-sparse/arch/xen/kernel/time.c
@@ -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();