summaryrefslogtreecommitdiffstats
path: root/include/linux/bug.h
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2016-03-01 09:45:14 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2016-03-03 21:18:29 +1100
commitff20c2e0acc5ad7e27c68592ade135efee399549 (patch)
treeba2078e9b2def032e9722112e5ab9d82b5ac0de3 /include/linux/bug.h
parent368ced78e6ed3d72c2acc61233b58487071ec289 (diff)
downloadlinux-stable-ff20c2e0acc5ad7e27c68592ade135efee399549.tar.gz
linux-stable-ff20c2e0acc5ad7e27c68592ade135efee399549.tar.bz2
linux-stable-ff20c2e0acc5ad7e27c68592ade135efee399549.zip
mm: Some arch may want to use HPAGE_PMD related values as variables
With next generation power processor, we are having a new mmu model [1] that require us to maintain a different linux page table format. Inorder to support both current and future ppc64 systems with a single kernel we need to make sure kernel can select between different page table format at runtime. With the new MMU (radix MMU) added, we will have two different pmd hugepage size 16MB for hash model and 2MB for Radix model. Hence make HPAGE_PMD related values as a variable. Actual conversion of HPAGE_PMD to a variable for ppc64 happens in a followup patch. [1] http://ibm.biz/power-isa3 (Needs registration). Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include/linux/bug.h')
-rw-r--r--include/linux/bug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 7f4818673c41..e51b0709e78d 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -20,6 +20,7 @@ struct pt_regs;
#define BUILD_BUG_ON_MSG(cond, msg) (0)
#define BUILD_BUG_ON(condition) (0)
#define BUILD_BUG() (0)
+#define MAYBE_BUILD_BUG_ON(cond) (0)
#else /* __CHECKER__ */
/* Force a compilation error if a constant expression is not a power of 2 */
@@ -83,6 +84,14 @@ struct pt_regs;
*/
#define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
+#define MAYBE_BUILD_BUG_ON(cond) \
+ do { \
+ if (__builtin_constant_p((cond))) \
+ BUILD_BUG_ON(cond); \
+ else \
+ BUG_ON(cond); \
+ } while (0)
+
#endif /* __CHECKER__ */
#ifdef CONFIG_GENERIC_BUG