Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 10:33:12 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329969 - stable/11/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201802251033.w1PAXCnS018124@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802251033.w1PAXCnS018124>