selftests/thuge-gen: Use platform specific MAP_HUGETLB value
authorHelge Deller <deller@gmx.de>
Thu, 31 Mar 2016 11:11:05 +0000 (13:11 +0200)
committerHelge Deller <deller@gmx.de>
Sun, 22 May 2016 19:43:41 +0000 (21:43 +0200)
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>
tools/testing/selftests/vm/thuge-gen.c

index c87957295f74ae6830f6348ea0482427901c4493..0bc737a75150bf225f6b3508182341536b66c88e 100644 (file)
@@ -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