diff options
-rw-r--r-- | sys/amd64/amd64/exception.S | 6 | ||||
-rw-r--r-- | sys/amd64/amd64/exception.s | 6 | ||||
-rw-r--r-- | sys/i386/i386/exception.s | 6 | ||||
-rw-r--r-- | sys/kern/init_main.c | 9 | ||||
-rw-r--r-- | sys/kern/kern_resource.c | 5 |
5 files changed, 19 insertions, 13 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 60856e23053f..1b4663cd78c2 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $ + * $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $ */ #include "npx.h" @@ -317,10 +317,12 @@ ENTRY(fork_trampoline) movl _switchtime,%ecx testl %ecx,%ecx jne 1f - /* XXX unreachable? */ + /* XXX unreachable except in the SMP case? */ pushl %eax call _microuptime popl %eax + movl _ticks,%eax + movl %eax,_switchticks jmp 2f 1: movl %ecx,(%eax) diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s index 60856e23053f..1b4663cd78c2 100644 --- a/sys/amd64/amd64/exception.s +++ b/sys/amd64/amd64/exception.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $ + * $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $ */ #include "npx.h" @@ -317,10 +317,12 @@ ENTRY(fork_trampoline) movl _switchtime,%ecx testl %ecx,%ecx jne 1f - /* XXX unreachable? */ + /* XXX unreachable except in the SMP case? */ pushl %eax call _microuptime popl %eax + movl _ticks,%eax + movl %eax,_switchticks jmp 2f 1: movl %ecx,(%eax) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 60856e23053f..1b4663cd78c2 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $ + * $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $ */ #include "npx.h" @@ -317,10 +317,12 @@ ENTRY(fork_trampoline) movl _switchtime,%ecx testl %ecx,%ecx jne 1f - /* XXX unreachable? */ + /* XXX unreachable except in the SMP case? */ pushl %eax call _microuptime popl %eax + movl _ticks,%eax + movl %eax,_switchticks jmp 2f 1: movl %ecx,(%eax) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index d8e5ef6fc9bf..26901129f1e9 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.108 1999/02/17 21:03:14 luoqi Exp $ + * $Id: init_main.c,v 1.109 1999/02/19 14:25:34 luoqi Exp $ */ #include "opt_devfs.h" @@ -490,14 +490,13 @@ proc0_post(dummy) struct timespec ts; /* - * Now can look at time, having had a chance to verify the time - * from the file system. Reset p->p_runtime as it may have been - * munched in mi_switch() after the time got set. Set - * p->p_switchtime to be consistent with this unmunching. + * Now we can look at the time, having had a chance to verify the + * time from the file system. Pretend that proc0 started now. */ microtime(&proc0.p_stats->p_start); proc0.p_runtime = 0; microuptime(&proc0.p_switchtime); + switchticks = ticks; /* * Give the ``random'' number generator a thump. diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index a6347c165ff3..7ab0eccfac73 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.39 1999/01/30 06:25:00 newton Exp $ + * $Id: kern_resource.c,v 1.40 1999/01/31 03:15:13 newton Exp $ */ #include "opt_compat.h" @@ -532,9 +532,10 @@ calcru(p, up, sp, ip) * mi_switch(), so `switchtime' doesn't get set in the normal * way. We set it here instead of more cleanly in exit1() * to avoid losing track of the time between the calls to - * microuptime(). + * microuptime(). Similarly for `switchticks'. */ switchtime = tv; + switchticks = ticks; } if (totusec < 0) { /* XXX no %qd in kernel. Truncate. */ |