Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Fix time calculation when:



details:   https://anonhg.NetBSD.org/src/rev/f8d2a176f6a4
branches:  trunk
changeset: 574796:f8d2a176f6a4
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Mar 12 16:33:45 2005 +0000

description:
Fix time calculation when:
    p->p_rtime.tv_usec + tv.tv_usec < spc->spc_runtime.tv_usec

diffstat:

 sys/arch/i386/i386/svr4_machdep.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 67b333b268d5 -r f8d2a176f6a4 sys/arch/i386/i386/svr4_machdep.c
--- a/sys/arch/i386/i386/svr4_machdep.c Sat Mar 12 16:29:59 2005 +0000
+++ b/sys/arch/i386/i386/svr4_machdep.c Sat Mar 12 16:33:45 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_machdep.c,v 1.74 2005/03/12 16:02:02 dsl Exp $     */
+/*     $NetBSD: svr4_machdep.c,v 1.75 2005/03/12 16:33:45 dsl Exp $     */
 
 /*-
  * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.74 2005/03/12 16:02:02 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.75 2005/03/12 16:33:45 dsl Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vm86.h"
@@ -577,8 +577,8 @@
 
                tm = (p->p_rtime.tv_sec + tv.tv_sec -
                    spc->spc_runtime.tv_sec) * 1000000ull;
-               tm += p->p_rtime.tv_usec + tv.tv_usec -
-                   spc->spc_runtime.tv_usec;
+               tm += p->p_rtime.tv_usec + tv.tv_usec;
+               tm -= spc->spc_runtime.tv_usec;
                tm *= 1000u;
                /* XXX: dsl - I would have expected the msb in %edx */
                frame.tf_edx = tm & 0xffffffffu;



Home | Main Index | Thread Index | Old Index