lkml.org 
[lkml]   [2009]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] introduce macro spin_event_timeout()
Grant Likely wrote:

> #define spin_until_timeout(condition, timeout, rc) \
> for (unsigned long __timeout = jiffies + (timeout); \
> (!(rc = (condition)) && time_after(jiffies, __timeout)); )

Ooo, that's good.

I'm still not crazy about using jiffies, since it doesn't get
incremented when interrupts are disabled, and I'd like this function to
work in those cases. How about get_cycles()? I know it's not supported
on all platforms, but I'm willing to live with that.

The other problem with get_cycles() is that there doesn't appear to be a
num_cycles_per_usec() function, so there's no way for me to scale the
count to a fixed time period.

--
Timur Tabi
Linux kernel developer at Freescale


\
 
 \ /
  Last update: 2009-03-12 17:25    [W:0.085 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site