summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-04-04 13:26:20 +0000
committerphk <phk@FreeBSD.org>1998-04-04 13:26:20 +0000
commit5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4 (patch)
tree76909c92c472744745de10e5dacc307ea5f7af45 /sys/kern/init_main.c
parentddcbf85eb29fd2d50ce1afa0243be370d4893370 (diff)
downloadFreeBSD-src-5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4.zip
FreeBSD-src-5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4.tar.gz
Time changes mark 2:
* Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 2372c26..d4bb6d1 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.84 1998/02/15 04:16:57 dyson Exp $
+ * $Id: init_main.c,v 1.85 1998/03/30 09:49:52 phk Exp $
*/
#include "opt_devfs.h"
@@ -104,10 +104,6 @@ static int shutdowntimeout = 120;
SYSCTL_INT(_kern, OID_AUTO, shutdown_timeout,
CTLFLAG_RW, &shutdowntimeout, 0, "");
-#ifndef SMP /* per-cpu on smp */
-struct timeval runtime;
-#endif
-
/*
* Promiscuous argument pass for start_init()
*
@@ -441,21 +437,21 @@ 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.
*/
- getmicrotime(&boottime);
- proc0.p_stats->p_start = runtime = mono_time = boottime;
+ proc0.p_stats->p_start = boottime;
proc0.p_rtime.tv_sec = proc0.p_rtime.tv_usec = 0;
/*
* Give the ``random'' number generator a thump.
*/
- microtime(&tv);
- srandom(tv.tv_sec ^ tv.tv_usec);
+ nanotime(&ts);
+ srandom(ts.tv_sec ^ ts.tv_nsec);
/* Initialize signal state for process 0. */
siginit(&proc0);
OpenPOWER on IntegriCloud