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>
7*d0bf492fSCédric Le Goater #include <linux/types.h>
88cf108c5SZhang Yi 
98cf108c5SZhang Yi #define MREMAP_MAYMOVE		1
108cf108c5SZhang Yi #define MREMAP_FIXED		2
11dc6f8d45SCornelia Huck #define MREMAP_DONTUNMAP	4
128cf108c5SZhang Yi 
138cf108c5SZhang Yi #define OVERCOMMIT_GUESS		0
148cf108c5SZhang Yi #define OVERCOMMIT_ALWAYS		1
158cf108c5SZhang Yi #define OVERCOMMIT_NEVER		2
168cf108c5SZhang Yi 
17d9cb4336SCornelia Huck #define MAP_SHARED	0x01		/* Share changes */
18d9cb4336SCornelia Huck #define MAP_PRIVATE	0x02		/* Changes are private */
19d9cb4336SCornelia Huck #define MAP_SHARED_VALIDATE 0x03	/* share + validate extension flags */
20d9cb4336SCornelia Huck 
218cf108c5SZhang Yi /*
228cf108c5SZhang Yi  * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
238cf108c5SZhang Yi  * size other than the default is desired.  See hugetlb_encode.h.
248cf108c5SZhang Yi  * All known huge page size encodings are provided here.  It is the
258cf108c5SZhang Yi  * responsibility of the application to know which sizes are supported on
268cf108c5SZhang Yi  * the running system.  See mmap(2) man page for details.
278cf108c5SZhang Yi  */
288cf108c5SZhang Yi #define MAP_HUGE_SHIFT	HUGETLB_FLAG_ENCODE_SHIFT
298cf108c5SZhang Yi #define MAP_HUGE_MASK	HUGETLB_FLAG_ENCODE_MASK
308cf108c5SZhang Yi 
3153ba2eeeSMatthew Rosato #define MAP_HUGE_16KB	HUGETLB_FLAG_ENCODE_16KB
328cf108c5SZhang Yi #define MAP_HUGE_64KB	HUGETLB_FLAG_ENCODE_64KB
338cf108c5SZhang Yi #define MAP_HUGE_512KB	HUGETLB_FLAG_ENCODE_512KB
348cf108c5SZhang Yi #define MAP_HUGE_1MB	HUGETLB_FLAG_ENCODE_1MB
358cf108c5SZhang Yi #define MAP_HUGE_2MB	HUGETLB_FLAG_ENCODE_2MB
368cf108c5SZhang Yi #define MAP_HUGE_8MB	HUGETLB_FLAG_ENCODE_8MB
378cf108c5SZhang Yi #define MAP_HUGE_16MB	HUGETLB_FLAG_ENCODE_16MB
388cf108c5SZhang Yi #define MAP_HUGE_32MB	HUGETLB_FLAG_ENCODE_32MB
398cf108c5SZhang Yi #define MAP_HUGE_256MB	HUGETLB_FLAG_ENCODE_256MB
408cf108c5SZhang Yi #define MAP_HUGE_512MB	HUGETLB_FLAG_ENCODE_512MB
418cf108c5SZhang Yi #define MAP_HUGE_1GB	HUGETLB_FLAG_ENCODE_1GB
428cf108c5SZhang Yi #define MAP_HUGE_2GB	HUGETLB_FLAG_ENCODE_2GB
438cf108c5SZhang Yi #define MAP_HUGE_16GB	HUGETLB_FLAG_ENCODE_16GB
448cf108c5SZhang Yi 
45*d0bf492fSCédric Le Goater struct cachestat_range {
46*d0bf492fSCédric Le Goater 	__u64 off;
47*d0bf492fSCédric Le Goater 	__u64 len;
48*d0bf492fSCédric Le Goater };
49*d0bf492fSCédric Le Goater 
50*d0bf492fSCédric Le Goater struct cachestat {
51*d0bf492fSCédric Le Goater 	__u64 nr_cache;
52*d0bf492fSCédric Le Goater 	__u64 nr_dirty;
53*d0bf492fSCédric Le Goater 	__u64 nr_writeback;
54*d0bf492fSCédric Le Goater 	__u64 nr_evicted;
55*d0bf492fSCédric Le Goater 	__u64 nr_recently_evicted;
56*d0bf492fSCédric Le Goater };
57*d0bf492fSCédric Le Goater 
588cf108c5SZhang Yi #endif /* _LINUX_MMAN_H */
59