blob: 7f3a722dbd722b8c515d3dd9176ce1d646a0caac [file] [log] [blame]
David Herrmann9183df22014-08-08 14:25:29 -07001#ifndef _UAPI_LINUX_MEMFD_H
2#define _UAPI_LINUX_MEMFD_H
3
Mike Kravetz749df872017-09-06 16:24:16 -07004#include <asm-generic/hugetlb_encode.h>
5
David Herrmann9183df22014-08-08 14:25:29 -07006/* flags for memfd_create(2) (unsigned int) */
7#define MFD_CLOEXEC 0x0001U
8#define MFD_ALLOW_SEALING 0x0002U
Mike Kravetz749df872017-09-06 16:24:16 -07009#define MFD_HUGETLB 0x0004U
10
11/*
12 * Huge page size encoding when MFD_HUGETLB is specified, and a huge page
13 * size other than the default is desired. See hugetlb_encode.h.
14 * All known huge page size encodings are provided here. It is the
15 * responsibility of the application to know which sizes are supported on
16 * the running system. See mmap(2) man page for details.
17 */
18#define MFD_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
19#define MFD_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK
20
21#define MFD_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB
22#define MFD_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB
23#define MFD_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB
24#define MFD_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB
25#define MFD_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB
26#define MFD_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB
27#define MFD_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB
28#define MFD_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB
29#define MFD_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
30#define MFD_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
David Herrmann9183df22014-08-08 14:25:29 -070031
32#endif /* _UAPI_LINUX_MEMFD_H */