Source-Changes-HG archive

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

[src/trunk]: src/sys/kern When cold, manually update timecounters before call...



details:   https://anonhg.NetBSD.org/src/rev/11aa8d0192ce
branches:  trunk
changeset: 991164:11aa8d0192ce
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jun 30 17:15:01 2018 +0000

description:
When cold, manually update timecounters before calling getnanouptime. Now
kernel printf timestamps are updated properly before interrupts are
enabled.

diffstat:

 sys/kern/subr_prf.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r a0bc7f331d79 -r 11aa8d0192ce sys/kern/subr_prf.c
--- a/sys/kern/subr_prf.c       Sat Jun 30 16:48:49 2018 +0000
+++ b/sys/kern/subr_prf.c       Sat Jun 30 17:15:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $  */
+/*     $NetBSD: subr_prf.c,v 1.172 2018/06/30 17:15:01 jmcneill Exp $  */
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.172 2018/06/30 17:15:01 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -68,6 +68,7 @@
 #include <sys/cpu.h>
 #include <sys/sha2.h>
 #include <sys/rndsource.h>
+#include <sys/timetc.h>
 
 #include <dev/cons.h>
 
@@ -503,6 +504,9 @@
                log_ts_prec = prec;
        }
 
+       if (cold)
+               tc_ticktock();
+
        getnanouptime(&ts);
 
        for (n = prec, fsec = ts.tv_nsec; n < 8; n++)



Home | Main Index | Thread Index | Old Index