Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206135
b: refs/heads/master
c: 22b8f15
h: refs/heads/master
i:
  206133: ea598a0
  206131: a265fa9
  206127: e732535
v: v3
  • Loading branch information
Patrick Pannuto authored and Thomas Gleixner committed Jul 23, 2010
1 parent 4a592c9 commit 7010e7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 866e26115cba6b59cec669b6307599e3e4440491
refs/heads/master: 22b8f15c2f7130bb0386f548428df2ffd4e81903
6 changes: 6 additions & 0 deletions trunk/include/linux/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ extern unsigned long lpj_fine;
void calibrate_delay(void);
void msleep(unsigned int msecs);
unsigned long msleep_interruptible(unsigned int msecs);
void usleep_range(unsigned long min, unsigned long max);

static inline void usleep(unsigned long usecs)
{
usleep_range(usecs, usecs);
}

static inline void ssleep(unsigned int seconds)
{
Expand Down
22 changes: 22 additions & 0 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1755,3 +1755,25 @@ unsigned long msleep_interruptible(unsigned int msecs)
}

EXPORT_SYMBOL(msleep_interruptible);

static int __sched do_usleep_range(unsigned long min, unsigned long max)
{
ktime_t kmin;
unsigned long delta;

kmin = ktime_set(0, min * NSEC_PER_USEC);
delta = max - min;
return schedule_hrtimeout_range(&kmin, delta, HRTIMER_MODE_REL);
}

/**
* usleep_range - Drop in replacement for udelay where wakeup is flexible
* @min: Minimum time in usecs to sleep
* @max: Maximum time in usecs to sleep
*/
void usleep_range(unsigned long min, unsigned long max)
{
__set_current_state(TASK_UNINTERRUPTIBLE);
do_usleep_range(min, max);
}
EXPORT_SYMBOL(usleep_range);

0 comments on commit 7010e7c

Please sign in to comment.