svn commit: r329513 - head/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Feb 18 08:58:20 UTC 2018
Author: hselasky
Date: Sun Feb 18 08:58:20 2018
New Revision: 329513
URL: https://svnweb.freebsd.org/changeset/base/329513
Log:
Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI.
Add compile time asserts to catch conflicts with native defines.
MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0 at gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
Modified:
head/sys/compat/linuxkpi/common/include/linux/gfp.h
Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 18 08:47:15 2018 (r329512)
+++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 18 08:58:20 2018 (r329513)
@@ -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