Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -25,10 +25,12 @@
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ *
+ * Copyright 2018 Joyent Inc.
  */
 
 #ifndef _SYS_SYSMACROS_H
 #define _SYS_SYSMACROS_H
 

@@ -365,17 +367,14 @@
         uint8_t _h, _g, _f, _e, _d, _c, _b, _a
 #else
 #error  One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
 #endif  /* _BIT_FIELDS_LTOH */
 
-/* avoid any possibility of clashing with <stddef.h> version */
-#if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && !defined(_KMEMUSER)
-
+#if !defined(ARRAY_SIZE)
 #define ARRAY_SIZE(x)   (sizeof (x) / sizeof (x[0]))
+#endif
 
-#endif /* _KERNEL, !_KMEMUSER */
-
 #ifdef  __cplusplus
 }
 #endif
 
 #endif  /* _SYS_SYSMACROS_H */