Module Name: src
Committed By: riastradh
Date: Tue Apr 1 14:57:58 UTC 2014
Modified Files:
src/sys/external/bsd/common/include/linux: kernel.h
Log Message:
Merge changes from drm2 <linux/kernel.h> to common <linux/kernel.h>.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/kernel.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.1 src/sys/external/bsd/common/include/linux/kernel.h:1.2
--- src/sys/external/bsd/common/include/linux/kernel.h:1.1 Thu Sep 5 15:28:07 2013
+++ src/sys/external/bsd/common/include/linux/kernel.h Tue Apr 1 14:57:58 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: kernel.h,v 1.1 2013/09/05 15:28:07 skrll Exp $ */
+/* $NetBSD: kernel.h,v 1.2 2014/04/01 14:57:58 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -44,13 +44,24 @@
#define barrier() __insn_barrier()
#define unlikely(X) __predict_false(X)
-#define uninitialized_var(x) x
+/*
+ * XXX Linux kludge to work around GCC uninitialized variable warning.
+ * Linux does `x = x', which is bollocks.
+ */
+#define uninitialized_var(x) x = 0
/* XXX These will multiply evaluate their arguments. */
#define max_t(T, X, Y) MAX(X, Y)
#define min_t(T, X, Y) MIN(X, Y)
/*
+ * Rounding to nearest.
+ */
+#define DIV_ROUND_CLOSEST(N, D) \
+ ((0 < (N)) ? (((N) + ((D) / 2)) / (D)) \
+ : (((N) - ((D) / 2)) / (D)))
+
+/*
* Rounding to what may or may not be powers of two.
*/
#define DIV_ROUND_UP(X, N) (((X) + (N) - 1) / (N))
@@ -102,4 +113,6 @@ abs64(int64_t x)
return (x < 0? (-x) : x);
}
+static int panic_timeout __unused = 0;
+
#endif /* _LINUX_KERNEL_H_ */