PERFORCE change 87405 for review
John Baldwin
jhb at freebsd.org
Tue Nov 29 05:26:16 GMT 2005
On Monday 28 November 2005 08:18 pm, Peter Wemm wrote:
> http://perforce.freebsd.org/chv.cgi?CH=87405
>
> Change 87405 by peter at 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 at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the p4-projects
mailing list