Deleted Added
full compact
1c1
< /* $FreeBSD: head/sys/dev/usb/usb_util.c 193045 2009-05-29 18:46:57Z thompsa $ */
---
> /* $FreeBSD: head/sys/dev/usb/usb_util.c 194227 2009-06-15 00:33:18Z thompsa $ */
41,43d40
< /* function prototypes */
< #if (USB_HAVE_CONDVAR == 0)
< static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, int timo);
45,46d41
< #endif
<
236,333d230
<
< #if (USB_HAVE_CONDVAR == 0)
<
< /*------------------------------------------------------------------------*
< * usb2_cv_init - wrapper function
< *------------------------------------------------------------------------*/
< void
< usb2_cv_init(struct cv *cv, const char *desc)
< {
< cv_init(cv, desc);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_destroy - wrapper function
< *------------------------------------------------------------------------*/
< void
< usb2_cv_destroy(struct cv *cv)
< {
< cv_destroy(cv);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_wait - wrapper function
< *------------------------------------------------------------------------*/
< void
< usb2_cv_wait(struct cv *cv, struct mtx *mtx)
< {
< int err;
<
< err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), 0);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_wait_sig - wrapper function
< *------------------------------------------------------------------------*/
< int
< usb2_cv_wait_sig(struct cv *cv, struct mtx *mtx)
< {
< int err;
<
< err = usb2_msleep(cv, mtx, PCATCH, cv_wmesg(cv), 0);
< return (err);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_timedwait - wrapper function
< *------------------------------------------------------------------------*/
< int
< usb2_cv_timedwait(struct cv *cv, struct mtx *mtx, int timo)
< {
< int err;
<
< if (timo == 0)
< timo = 1; /* zero means no timeout */
< err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), timo);
< return (err);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_signal - wrapper function
< *------------------------------------------------------------------------*/
< void
< usb2_cv_signal(struct cv *cv)
< {
< wakeup_one(cv);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_cv_broadcast - wrapper function
< *------------------------------------------------------------------------*/
< void
< usb2_cv_broadcast(struct cv *cv)
< {
< wakeup(cv);
< }
<
< /*------------------------------------------------------------------------*
< * usb2_msleep - wrapper function
< *------------------------------------------------------------------------*/
< static int
< usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg,
< int timo)
< {
< int err;
<
< if (mtx == &Giant) {
< err = tsleep(chan, priority, wmesg, timo);
< } else {
< #ifdef mtx_sleep
< err = mtx_sleep(chan, mtx, priority, wmesg, timo);
< #else
< err = msleep(chan, mtx, priority, wmesg, timo);
< #endif
< }
< return (err);
< }
<
< #endif