Module Name:    src
Committed By:   riastradh
Date:           Tue Oct 23 03:56:33 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/include/linux: sched.h

Log Message:
DELAY takes microseconds, not ticks.

XXX pullup-7
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/include/linux/sched.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/sched.h
diff -u src/sys/external/bsd/drm2/include/linux/sched.h:1.10 src/sys/external/bsd/drm2/include/linux/sched.h:1.11
--- src/sys/external/bsd/drm2/include/linux/sched.h:1.10	Mon Aug 27 07:47:11 2018
+++ src/sys/external/bsd/drm2/include/linux/sched.h	Tue Oct 23 03:56:33 2018
@@ -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 ti
 	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;
 	}
 

Reply via email to