18cf108c5SZhang Yi /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28cf108c5SZhang Yi #ifndef _LINUX_MMAN_H 38cf108c5SZhang Yi #define _LINUX_MMAN_H 48cf108c5SZhang Yi 58cf108c5SZhang Yi #include <asm/mman.h> 68cf108c5SZhang Yi #include <asm-generic/hugetlb_encode.h> 78cf108c5SZhang Yi 88cf108c5SZhang Yi #define MREMAP_MAYMOVE 1 98cf108c5SZhang Yi #define MREMAP_FIXED 2 10dc6f8d45SCornelia Huck #define MREMAP_DONTUNMAP 4 118cf108c5SZhang Yi 128cf108c5SZhang Yi #define OVERCOMMIT_GUESS 0 138cf108c5SZhang Yi #define OVERCOMMIT_ALWAYS 1 148cf108c5SZhang Yi #define OVERCOMMIT_NEVER 2 158cf108c5SZhang Yi 16d9cb4336SCornelia Huck #define MAP_SHARED 0x01 /* Share changes */ 17d9cb4336SCornelia Huck #define MAP_PRIVATE 0x02 /* Changes are private */ 18d9cb4336SCornelia Huck #define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */ 19d9cb4336SCornelia Huck 208cf108c5SZhang Yi /* 218cf108c5SZhang Yi * Huge page size encoding when MAP_HUGETLB is specified, and a huge page 228cf108c5SZhang Yi * size other than the default is desired. See hugetlb_encode.h. 238cf108c5SZhang Yi * All known huge page size encodings are provided here. It is the 248cf108c5SZhang Yi * responsibility of the application to know which sizes are supported on 258cf108c5SZhang Yi * the running system. See mmap(2) man page for details. 268cf108c5SZhang Yi */ 278cf108c5SZhang Yi #define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT 288cf108c5SZhang Yi #define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK 298cf108c5SZhang Yi 30*53ba2eeeSMatthew Rosato #define MAP_HUGE_16KB HUGETLB_FLAG_ENCODE_16KB 318cf108c5SZhang Yi #define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB 328cf108c5SZhang Yi #define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB 338cf108c5SZhang Yi #define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB 348cf108c5SZhang Yi #define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB 358cf108c5SZhang Yi #define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB 368cf108c5SZhang Yi #define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB 378cf108c5SZhang Yi #define MAP_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB 388cf108c5SZhang Yi #define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB 398cf108c5SZhang Yi #define MAP_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB 408cf108c5SZhang Yi #define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB 418cf108c5SZhang Yi #define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB 428cf108c5SZhang Yi #define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB 438cf108c5SZhang Yi 448cf108c5SZhang Yi #endif /* _LINUX_MMAN_H */ 45