Author: hselasky
Date: Sun Feb 25 10:33:12 2018
New Revision: 329969
URL: https://svnweb.freebsd.org/changeset/base/329969

Log:
  MFC r329513:
  Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI.
  Add compile time asserts to catch conflicts with native defines.
  
  Submitted by: Johannes Lundberg <johal...@gmail.com>
  Sponsored by: Mellanox Technologies
  Sponsored by: Limelight Networks

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h    Sun Feb 25 
10:32:26 2018        (r329968)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h    Sun Feb 25 
10:33:12 2018        (r329969)
@@ -54,6 +54,8 @@
 #define        __GFP_NO_KSWAPD 0
 #define        __GFP_WAIT      M_WAITOK
 #define        __GFP_DMA32     (1U << 24) /* LinuxKPI only */
+#define        __GFP_BITS_SHIFT 25
+#define        __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
 
 #define        GFP_NOWAIT      M_NOWAIT
 #define        GFP_ATOMIC      (M_NOWAIT | M_USE_RESERVE)
@@ -66,6 +68,9 @@
 #define        GFP_DMA32       __GFP_DMA32
 #define        GFP_TEMPORARY   M_NOWAIT
 #define        GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO)
+
+CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0);
+CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK);
 
 /*
  * Resolve a page into a virtual address:
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to