Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/delay.h
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | usleep_range(unsigned long min, unsigned long max) | ||||
/* guard against invalid values */ | /* guard against invalid values */ | ||||
if (min == 0) | if (min == 0) | ||||
min = 1; | min = 1; | ||||
pause_sbt("lnxsleep", ustosbt(min), 0, C_HARDCLOCK); | pause_sbt("lnxsleep", ustosbt(min), 0, C_HARDCLOCK); | ||||
} | } | ||||
extern unsigned int linux_msleep_interruptible(unsigned int ms); | extern unsigned int linux_msleep_interruptible(unsigned int ms); | ||||
static inline void | |||||
fsleep(unsigned long us) | |||||
{ | |||||
if (us < 10) | |||||
emaste: IMO the scaling by hz deserves a comment | |||||
Done Inline Actionswill do if it'll survive the update triggered by @hselasky (see below). bz: will do if it'll survive the update triggered by @hselasky (see below). | |||||
udelay(us); | |||||
Done Inline ActionsDo you have to use DELAY() ? Else use pause_sbt! hselasky: Do you have to use DELAY() ? Else use pause_sbt! | |||||
Done Inline ActionsI think the idea is to have a busy loop if the timeouts are small enough; now you asking make me notice that the code from this file had changed under my branch. I'll update and make this more fine grained after all. bz: I think the idea is to have a busy loop if the timeouts are small enough; now you asking make… | |||||
else | |||||
usleep_range(us, us); | |||||
} | |||||
#endif /* _LINUX_DELAY_H_ */ | #endif /* _LINUX_DELAY_H_ */ |
IMO the scaling by hz deserves a comment