<dec f='src/src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h' l='190'/>
<doc f='src/src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h' l='159'>/*
 * The DRM_*WAIT*_UNTIL macros are replacements for the Linux
 * wait_event* macros.  Like DRM_SPIN_WAIT_ON, they add an interlock,
 * and so may require some changes to the surrounding code.  They have
 * a different return value convention from DRM_SPIN_WAIT_ON and a
 * different return value convention from cv_*wait*.
 *
 * The untimed DRM_*WAIT*_UNTIL macros return
 *
 * . -EINTR/-ERESTART if interrupted by a signal, or
 * . zero if the condition evaluated
 *
 * The timed DRM_*TIMED_WAIT*_UNTIL macros return
 *
 * . -EINTR/-ERESTART if interrupted by a signal,
 * . 0 if the condition was false after the timeout,
 * . 1 if the condition was true just after the timeout, or
 * . the number of ticks remaining if the condition was true before the
 * timeout.
 *
 * Contrast DRM_SPIN_WAIT_ON which returns -EINTR/-ERESTART on signal,
 * -EBUSY on timeout, and zero on success; and cv_*wait*, which return
 * -EINTR/-ERESTART on signal, -EWOULDBLOCK on timeout, and zero on
 * success.
 *
 * XXX In retrospect, giving the timed and untimed macros a different
 * return convention from one another to match Linux may have been a
 * bad idea.  All of this inconsistent timeout return convention logic
 * has been a consistent source of bugs.
 */</doc>
