Module Name: src
Committed By: riastradh
Date: Mon Aug 27 07:02:51 UTC 2018
Modified Files:
src/sys/external/bsd/common/include/linux: kernel.h
src/sys/external/bsd/drm2/include/linux: math64.h
Log Message:
Define DIV_ROUND_CLOSEST_ULL and div_s64.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/common/include/linux/kernel.h
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/math64.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/common/include/linux/kernel.h
diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.16 src/sys/external/bsd/common/include/linux/kernel.h:1.17
--- src/sys/external/bsd/common/include/linux/kernel.h:1.16 Mon Aug 27 06:55:32 2018
+++ src/sys/external/bsd/common/include/linux/kernel.h Mon Aug 27 07:02:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: kernel.h,v 1.16 2018/08/27 06:55:32 riastradh Exp $ */
+/* $NetBSD: kernel.h,v 1.17 2018/08/27 07:02:51 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -86,6 +86,8 @@
((0 < (N)) ? (((N) + ((D) / 2)) / (D)) \
: (((N) - ((D) / 2)) / (D)))
+#define DIV_ROUND_CLOSEST_ULL(N, D) (((N) + (D)/2)/(D))
+
/*
* Rounding to what may or may not be powers of two.
*/
Index: src/sys/external/bsd/drm2/include/linux/math64.h
diff -u src/sys/external/bsd/drm2/include/linux/math64.h:1.5 src/sys/external/bsd/drm2/include/linux/math64.h:1.6
--- src/sys/external/bsd/drm2/include/linux/math64.h:1.5 Mon Aug 27 06:51:07 2018
+++ src/sys/external/bsd/drm2/include/linux/math64.h Mon Aug 27 07:02:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: math64.h,v 1.5 2018/08/27 06:51:07 riastradh Exp $ */
+/* $NetBSD: math64.h,v 1.6 2018/08/27 07:02:51 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -54,6 +54,12 @@ div64_s64(int64_t dividend, int64_t divi
return dividend / divisor;
}
+static inline int64_t
+div_s64(int64_t dividend, int32_t divisor)
+{
+ return dividend / divisor;
+}
+
static inline uint64_t
div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *rem)
{