Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jan 2001 05:48:14 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alexander Langer <alex@big.endian.de>
Cc:        arch@FreeBSD.ORG
Subject:   Re: (fwd) getnanouptime() patch
Message-ID:  <Pine.BSF.4.21.0101020544220.10677-100000@besplex.bde.org>
In-Reply-To: <20010101135955.A4625@cichlids.cichlids.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Jan 2001, Alexander Langer wrote:

> Thus spake Bruce Evans (bde@zeta.org.au):
> 
> > Actually, timecounters are statically initialized to a dummy timecounter,
> > so the lock-up is probably caused by some other bug, possibly an
> > uninitialized event handler.
> > So the patch has no effect except to slow down nanotime().
> 
> Oh.  That is not good.
> 
> But I'm curious:  Isn't the nanotime() function wrong, too, in this
> case?
> ...
> void
> nanotime(struct timespec *ts)
> {
>         unsigned count;
>         u_int64_t delta;
>         struct timecounter *tc;
> 
>         nnanotime++;
>         tc = timecounter;
> #ifdef KTR
>         if (tc == NULL) {               /* called before initialization */
>                 ts->tv_sec = 0;
>                 ts->tv_nsec = 0;
>                 return;
>         }
> #endif

This is bogus at best.  `timecounter' is never NULL unless there is a bug
switching it.

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101020544220.10677-100000>