summaryrefslogtreecommitdiff
path: root/uts/debian/patches/sysmacros-gnu-compat.patch
blob: 93434809c9cce6ea044376f51639405b35487d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: some macros expected to be in sys/param.h
Index: b/usr/src/uts/common/sys/param.h
===================================================================
--- a/usr/src/uts/common/sys/param.h	2014-03-01 22:56:06.894436513 +0400
+++ b/usr/src/uts/common/sys/param.h	2014-03-01 22:56:09.138760389 +0400
@@ -203,6 +203,17 @@
 #endif
 
 /*
+ * Macros for counting and rounding.
+ */
+#define	howmany(x, y)	(((x)+((y)-1))/(y))
+#define	roundup(x, y)	((((x)+((y)-1))/(y))*(y))
+
+/*
+ * Macro to determine if value is a power of 2
+ */
+#define	powerof2(x)		(((x) & ((x) - 1)) == 0)
+
+/*
  * MAXLINKNAMELEN defines the longest possible permitted datalink name,
  * including the terminating NUL.  Note that this must not be larger
  * than related networking constants such as LIFNAMSIZ.
Index: b/usr/src/uts/common/sys/sysmacros.h
===================================================================
--- a/usr/src/uts/common/sys/sysmacros.h	2014-03-01 22:54:04.212714127 +0400
+++ b/usr/src/uts/common/sys/sysmacros.h	2014-03-01 22:56:09.140460526 +0400
@@ -214,15 +214,9 @@
 #define	IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
 
 /*
- * Macros for counting and rounding.
- */
-#define	howmany(x, y)	(((x)+((y)-1))/(y))
-#define	roundup(x, y)	((((x)+((y)-1))/(y))*(y))
-
-/*
  * Macro to determine if value is a power of 2
  */
-#define	ISP2(x)		(((x) & ((x) - 1)) == 0)
+#define	ISP2(x)		powerof2(x)
 
 /*
  * Macros for various sorts of alignment and rounding.  The "align" must