diff options
| author | riastradh <riastradh@NetBSD.org> | 2018-10-23 03:56:33 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2018-10-23 03:56:33 +0000 |
| commit | bbb6e6cd6ad4b13ec8247c41a72041fb76b9edb0 (patch) | |
| tree | ab8c697011dabec43c24b85dc0010036d0ba8c1c /sys/external/bsd/drm2/include/linux | |
| parent | 7789c30815efb77ed097d9d6da7f962ae73c840f (diff) | |
DELAY takes microseconds, not ticks.
XXX pullup-7
XXX pullup-8
Diffstat (limited to 'sys/external/bsd/drm2/include/linux')
| -rw-r--r-- | sys/external/bsd/drm2/include/linux/sched.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/external/bsd/drm2/include/linux/sched.h b/sys/external/bsd/drm2/include/linux/sched.h index 71b94cf486c..02fe9a015c4 100644 --- a/sys/external/bsd/drm2/include/linux/sched.h +++ b/sys/external/bsd/drm2/include/linux/sched.h @@ -1,4 +1,4 @@ -/* $NetBSD: sched.h,v 1.10 2018/08/27 07:47:11 riastradh Exp $ */ +/* $NetBSD: sched.h,v 1.11 2018/10/23 03:56:33 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -60,7 +60,16 @@ schedule_timeout_uninterruptible(long timeout) int start, end; if (cold) { - DELAY(timeout); + unsigned us; + if (hz <= 1000) { + unsigned ms = hztoms(MIN(timeout, mstohz(INT_MAX))); + us = MIN(ms, INT_MAX/1000)*1000; + } else if (hz <= 1000000) { + us = MIN(timeout, (INT_MAX/1000000)/hz)*hz*1000000; + } else { + us = timeout/(1000000/hz); + } + DELAY(us); return 0; } |
