svn commit: r329969 - stable/11/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Sun Feb 25 10:33:13 UTC 2018


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 <johalun0 at 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:


More information about the svn-src-all mailing list