Minor adjustments to the timecounting and proc0.
Mostly Submitted by: bde
This commit is contained in:
parent
4bc4bc7c1a
commit
c641c2b9ee
@ -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);
|
||||
|
@ -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++;
|
||||
|
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user