summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-03-31 13:11:05 +0200
committerHelge Deller <deller@gmx.de>2016-05-22 21:43:41 +0200
commita4351cb5511b917556c796d97068318a53a00849 (patch)
tree4f797b85c26c5faa5b13da85e4a381310c12d5d5 /tools
parent54b668009076caddbede8fde513ca2c982590bfe (diff)
selftests/thuge-gen: Use platform specific MAP_HUGETLB value
Do not hardcode MAP_HUGETLB to 0x40000, since quite some architectures use a different value. Tested with a parisc architecture 64bit kernel. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/vm/thuge-gen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/vm/thuge-gen.c b/tools/testing/selftests/vm/thuge-gen.c
index c87957295f74..0bc737a75150 100644
--- a/tools/testing/selftests/vm/thuge-gen.c
+++ b/tools/testing/selftests/vm/thuge-gen.c
@@ -30,7 +30,9 @@
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
#define MAP_HUGE_SHIFT 26
#define MAP_HUGE_MASK 0x3f
+#if !defined(MAP_HUGETLB)
#define MAP_HUGETLB 0x40000
+#endif
#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
#define SHM_HUGE_SHIFT 26