Re: [RFC] countdown timer driver

george anzinger (george@mvista.com)
Tue, 10 Dec 2002 16:19:19 -0800


Dan Kegel wrote:
>
> > Questions:
> > 1. Is there already a standard kernel interface to this type of timer?
>
> The Posix high-res timer stuff, I think. Have you tried expressing
> what you want user programs to do in terms of Posix high-res timers yet?
>
> > 2. Is there any reason to interface/integrate this type of device with the
> > high-res timer stuff currently under development for the 2.5 kernel?
>
> Yes; perhaps you could create a service provider interface
> for the posix high-res timer stuff, then use that SPI
> to plug your hardware in?
>
> I may be way off base here, but it does seem like it's due dilligence
> to verify that you're not reinventing an interface here.
> - Dan
>
Let me help out here if I may. First, not to rain on your
parade but, when I did high-res timers on another system,
far away and long ago, we dropped support for the hardware
timers. I.e. I would submit that the POSIX timers interface
to a common system timer does all you need and more. You
MAY want to consider using your hardware as the system clock
underlying jiffies and all the system timers, but that is
another issue.

You also may want to define a new CLOCK for the POSIX
timers. Most of this capability is in place in the current
patch. I did notice, however, that I took a short cut on
the clock_nanosleep code and assumed that it was a standard
clock. This is easy to change... The new CLOCK(s) would
then talk to your hardware. The problem you will encounter,
and which the high-res-patch solves, is making the timers
available to all comers, i.e. there is no reservation system
or busy counter, etc. Just a nice set timer and give me a
signal when it is done.

You can code a blocking interface using the sigwait and
friends calls which will also cut down of the timer delivery
overhead by eliminating the signal.

So what more could you ask for?

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml
-
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/