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
108cf108c5SZhang Yi 
118cf108c5SZhang Yi #define OVERCOMMIT_GUESS		0
128cf108c5SZhang Yi #define OVERCOMMIT_ALWAYS		1
138cf108c5SZhang Yi #define OVERCOMMIT_NEVER		2
148cf108c5SZhang Yi 
15*d9cb4336SCornelia Huck #define MAP_SHARED	0x01		/* Share changes */
16*d9cb4336SCornelia Huck #define MAP_PRIVATE	0x02		/* Changes are private */
17*d9cb4336SCornelia Huck #define MAP_SHARED_VALIDATE 0x03	/* share + validate extension flags */
18*d9cb4336SCornelia Huck 
198cf108c5SZhang Yi /*
208cf108c5SZhang Yi  * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
218cf108c5SZhang Yi  * size other than the default is desired.  See hugetlb_encode.h.
228cf108c5SZhang Yi  * All known huge page size encodings are provided here.  It is the
238cf108c5SZhang Yi  * responsibility of the application to know which sizes are supported on
248cf108c5SZhang Yi  * the running system.  See mmap(2) man page for details.
258cf108c5SZhang Yi  */
268cf108c5SZhang Yi #define MAP_HUGE_SHIFT	HUGETLB_FLAG_ENCODE_SHIFT
278cf108c5SZhang Yi #define MAP_HUGE_MASK	HUGETLB_FLAG_ENCODE_MASK
288cf108c5SZhang Yi 
298cf108c5SZhang Yi #define MAP_HUGE_64KB	HUGETLB_FLAG_ENCODE_64KB
308cf108c5SZhang Yi #define MAP_HUGE_512KB	HUGETLB_FLAG_ENCODE_512KB
318cf108c5SZhang Yi #define MAP_HUGE_1MB	HUGETLB_FLAG_ENCODE_1MB
328cf108c5SZhang Yi #define MAP_HUGE_2MB	HUGETLB_FLAG_ENCODE_2MB
338cf108c5SZhang Yi #define MAP_HUGE_8MB	HUGETLB_FLAG_ENCODE_8MB
348cf108c5SZhang Yi #define MAP_HUGE_16MB	HUGETLB_FLAG_ENCODE_16MB
358cf108c5SZhang Yi #define MAP_HUGE_32MB	HUGETLB_FLAG_ENCODE_32MB
368cf108c5SZhang Yi #define MAP_HUGE_256MB	HUGETLB_FLAG_ENCODE_256MB
378cf108c5SZhang Yi #define MAP_HUGE_512MB	HUGETLB_FLAG_ENCODE_512MB
388cf108c5SZhang Yi #define MAP_HUGE_1GB	HUGETLB_FLAG_ENCODE_1GB
398cf108c5SZhang Yi #define MAP_HUGE_2GB	HUGETLB_FLAG_ENCODE_2GB
408cf108c5SZhang Yi #define MAP_HUGE_16GB	HUGETLB_FLAG_ENCODE_16GB
418cf108c5SZhang Yi 
428cf108c5SZhang Yi #endif /* _LINUX_MMAN_H */
43