Re: [PATCH] linux-2.5.54_delay-cleanup_A0

From: Pavel Machek (pavel@ucw.cz)
Date: Sun Jan 12 2003 - 09:27:40 EST


Hi!

> Linus, all,
> I've been busy with other things, so I've just been sitting on this for
> a while. Anyway, I figured it was about time to resend.
>
> This patch tries to cleanup the delay code by moving the timer-specific
> implementations into the timer_ops struct. Thus, rather then doing:
>
> if(x86_delay_tsc)
> __rdtsc_delay(loops);
> else if(x86_delay_cyclone)
> __cyclone_delay(loops);
> else if(whatever....
>
> we just simply do:
>
> if(timer)
> timer->delay(loops);
>
> diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
> --- a/arch/i386/kernel/timers/timer_pit.c Tue Jan 7 17:11:03 2003
> +++ b/arch/i386/kernel/timers/timer_pit.c Tue Jan 7 17:11:03 2003
> @@ -27,6 +27,19 @@
> /* nothing needed */
> }
>
> +static void delay_pit(unsigned long loops)
> +{
> + int d0;
> + __asm__ __volatile__(
> + "\tjmp 1f\n"
> + ".align 16\n"
> + "1:\tjmp 2f\n"
> + ".align 16\n"
> + "2:\tdecl %0\n\tjns 2b"
> + :"=&a" (d0)
> + :"0" (loops));
> +}
> +

But... this is not using pit to do the delay, right? It is sensitive
to CPU clock changes, pit-delay should not be.

                                                                Pavel

-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:17 EST