Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206139
b: refs/heads/master
c: 5e7f5a1
h: refs/heads/master
i:
  206137: 0b4c803
  206135: 7010e7c
v: v3
  • Loading branch information
Patrick Pannuto authored and Thomas Gleixner committed Aug 4, 2010
1 parent f8e1ac9 commit bcc44f1
Show file tree
Hide file tree
Showing 3 changed files with 24 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: e1b004c3ef9c59db5f013528628b51c8653155ec
refs/heads/master: 5e7f5a178bba45c5aca3448fddecabd4e28f1f6b
1 change: 1 addition & 0 deletions trunk/include/linux/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ 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 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) * NSEC_PER_USEC;
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 bcc44f1

Please sign in to comment.