Sean MacLennan wrote:
> Would cpu_relax be a good thing to put here?
>
> Something like:
>
> while (!(rc = (condition)) && (tb_ticks_since(__start) <= __loops)) \
> if (delay) \
> udelay(delay); \
> else \
> cpu_relax(); \
>
I had that at one point, but
On Mon, 27 Apr 2009 14:05:44 -0500
"Timur Tabi" wrote:
> +#define spin_event_timeout(condition, timeout, delay,
> rc) \
> +{ \
> + unsigned long __loops = tb_ticks_per_usec *
> timeout;
Kumar Gala wrote:
> I wouldn't call it spin_event_timeout as its a bit too generic of a
> name for something that is arch specific.
Well, I'm hoping it won't be arch-specific forever. I'd like to see
other architectures implement something like tb_ticks_per_usec. I'm
only tackling PowerPC for
Kumar Gala wrote:
I wouldn't call it spin_event_timeout as its a bit too generic of a name
for something that is arch specific.
The concept is not arch-specific -- ideally, other architectures could
add their own implementations (or it could be made
non-architecture-specific in the future).
On Apr 27, 2009, at 2:05 PM, Timur Tabi wrote:
The macro spin_event_timeout() takes a condition and timeout value
(in microseconds) as parameters. It spins until either the
condition is true
or the timeout expires. It returns the result of the condition when
the loop
was terminated.
Thi
On Mon, Apr 27, 2009 at 2:05 PM, Timur Tabi wrote:
> The macro spin_event_timeout() takes a condition and timeout value
> (in microseconds) as parameters. It spins until either the condition is true
> or the timeout expires. It returns the result of the condition when the loop
> was terminated.
The macro spin_event_timeout() takes a condition and timeout value
(in microseconds) as parameters. It spins until either the condition is true
or the timeout expires. It returns the result of the condition when the loop
was terminated.
This primary purpose of this macro is to poll on a hardware