Date: Tue, 29 Nov 2005 00:22:24 -0500 From: John Baldwin <jhb@freebsd.org> To: Peter Wemm <peter@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 87405 for review Message-ID: <200511290022.25288.jhb@freebsd.org> In-Reply-To: <200511290118.jAT1I5wD042291@repoman.freebsd.org>
index | next in thread | previous in thread | raw e-mail
On Monday 28 November 2005 08:18 pm, Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=87405 > > Change 87405 by peter@peter_daintree on 2005/11/29 01:17:18 > > So, there was no need to turn to use 3 files when 1 would do. > > Affected files ... > > .. //depot/projects/hammer/sys/amd64/amd64/tsc.c#13 edit > .. //depot/projects/hammer/sys/amd64/include/clock.h#18 edit > .. //depot/projects/hammer/sys/amd64/isa/clock.c#51 edit > > Differences ... > > ==== //depot/projects/hammer/sys/amd64/amd64/tsc.c#13 (text+ko) ==== > > @@ -128,15 +128,3 @@ > { > return (rdtsc()); > } > - > -void > -tsc_DELAY(int n) > -{ > - uint64_t start, end, now; > - > - start = rdtsc(); > - end = start + (tsc_freq * n) / 1000000; > - do { > - now = rdtsc(); > - } while (now < end || (now > start && end < start)); > -} > > ==== //depot/projects/hammer/sys/amd64/include/clock.h#18 (text+ko) ==== > > @@ -37,7 +37,6 @@ > int sysbeep(int pitch, int period); > void init_TSC(void); > void init_TSC_tc(void); > -void tsc_DELAY(int); > > #endif /* _KERNEL */ > > > ==== //depot/projects/hammer/sys/amd64/isa/clock.c#51 (text+ko) ==== > > @@ -272,7 +272,13 @@ > #endif > > if (tsc_freq != 0 && !tsc_is_broken) { > - tsc_DELAY(n); > + uint64_t start, end, now; > + > + start = rdtsc(); > + end = start + (tsc_freq * n) / 1000000; > + do { > + now = rdtsc(); > + } while (now < end || (now > start && end < start)); > return; > } > #ifdef DELAYDEBUG What happens when you are preempted and migrate to another CPU? Currently DELAY() doesn't mandate that callers hold a critical section while calling it. You could do a critical_enter/exit pair here perhaps (note that critical_enter/exit doesn't block interrupts, just ithread preemptions). -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.orghome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511290022.25288.jhb>
