Date: Sun, 18 Feb 2018 08:58:20 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329513 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201802180858.w1I8wKrC016909@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802180858.w1I8wKrC016909>