diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1998-04-08 09:01:53 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1998-04-08 09:01:53 +0000 |
| commit | 5f88ec3625e308d0686b23e2d6571ff3c2d42b45 (patch) | |
| tree | 12ff6b4e6e4c03541fa84faa8e05c95107767c6f /sys | |
| parent | b317bce8433de5e318d5dd4ed312790611831f1b (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/init_main.c | 12 | ||||
| -rw-r--r-- | sys/kern/kern_clock.c | 6 | ||||
| -rw-r--r-- | sys/kern/kern_tc.c | 6 |
3 files changed, 13 insertions, 11 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index e9f061024d94..572eff1de04e 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.86 1998/04/04 13:25:08 phk Exp $ + * $Id: init_main.c,v 1.87 1998/04/06 15:51:22 peter Exp $ */ #include "opt_devfs.h" @@ -422,19 +422,21 @@ static void proc0_post(dummy) void *dummy; { - struct timeval tv; struct timespec ts; /* * Now can look at time, having had a chance to verify the time * from the file system. Reset p->p_rtime as it may have been - * munched in mi_switch() after the time got set. + * munched in mi_switch() after the time got set. Set + * p->p_runtime to be consistent with this unmunching. */ - proc0.p_stats->p_start = boottime; - proc0.p_rtime.tv_sec = proc0.p_rtime.tv_usec = 0; + microtime(&proc0.p_stats->p_start); + timevalclear(&proc0.p_rtime); + microruntime(&proc0.p_runtime); /* * Give the ``random'' number generator a thump. + * XXX: Does read_random() contain enough bits to be used here ? */ nanotime(&ts); srandom(ts.tv_sec ^ ts.tv_nsec); diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 13195c3cd869..a70ab9dbe534 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -39,7 +39,7 @@ static volatile int print_tci = 1; * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.65 1998/04/05 11:49:34 phk Exp $ + * $Id: kern_clock.c,v 1.66 1998/04/06 08:26:03 phk Exp $ */ #include <sys/param.h> @@ -756,7 +756,7 @@ tco_forward(void) timedelta -= tickdelta; } - if (tc->offset_nano >= 1000000000ULL << 32) { + while (tc->offset_nano >= 1000000000ULL << 32) { tc->offset_nano -= 1000000000ULL << 32; tc->offset_sec++; tc->frequency = tc->tweak->frequency; @@ -771,7 +771,7 @@ tco_forward(void) tc->nanotime.tv_sec = tc->offset_sec + boottime.tv_sec; tc->nanotime.tv_nsec = (tc->offset_nano >> 32) + boottime.tv_usec * 1000; tc->microtime.tv_usec = tc->offset_micro + boottime.tv_usec; - if (tc->nanotime.tv_nsec > 1000000000) { + if (tc->nanotime.tv_nsec >= 1000000000) { tc->nanotime.tv_nsec -= 1000000000; tc->microtime.tv_usec -= 1000000; tc->nanotime.tv_sec++; diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 13195c3cd869..a70ab9dbe534 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -39,7 +39,7 @@ static volatile int print_tci = 1; * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.65 1998/04/05 11:49:34 phk Exp $ + * $Id: kern_clock.c,v 1.66 1998/04/06 08:26:03 phk Exp $ */ #include <sys/param.h> @@ -756,7 +756,7 @@ tco_forward(void) timedelta -= tickdelta; } - if (tc->offset_nano >= 1000000000ULL << 32) { + while (tc->offset_nano >= 1000000000ULL << 32) { tc->offset_nano -= 1000000000ULL << 32; tc->offset_sec++; tc->frequency = tc->tweak->frequency; @@ -771,7 +771,7 @@ tco_forward(void) tc->nanotime.tv_sec = tc->offset_sec + boottime.tv_sec; tc->nanotime.tv_nsec = (tc->offset_nano >> 32) + boottime.tv_usec * 1000; tc->microtime.tv_usec = tc->offset_micro + boottime.tv_usec; - if (tc->nanotime.tv_nsec > 1000000000) { + if (tc->nanotime.tv_nsec >= 1000000000) { tc->nanotime.tv_nsec -= 1000000000; tc->microtime.tv_usec -= 1000000; tc->nanotime.tv_sec++; |
