diff options
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r-- | sys/kern/kern_tc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index b8d5833..1128c2e 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -24,7 +24,7 @@ * Number of timecounters used to implement stable storage */ #ifndef NTIMECOUNTER -#define NTIMECOUNTER 5 +#define NTIMECOUNTER 45 #endif static MALLOC_DEFINE(M_TIMECOUNTER, "timecounter", @@ -148,6 +148,13 @@ nanotime(struct timespec *ts) nnanotime++; tc = timecounter; +#ifdef KTR + if (tc == NULL) { /* called before initialization */ + ts->tv_sec = 0; + ts->tv_nsec = 0; + return; + } +#endif ts->tv_sec = tc->tc_offset_sec; count = tco_delta(tc); delta = tc->tc_offset_nano; |