David Herrmann | 9183df2 | 2014-08-08 14:25:29 -0700 | [diff] [blame] | 1 | #ifndef _UAPI_LINUX_MEMFD_H |
| 2 | #define _UAPI_LINUX_MEMFD_H |
| 3 | |
Mike Kravetz | 749df87 | 2017-09-06 16:24:16 -0700 | [diff] [blame] | 4 | #include <asm-generic/hugetlb_encode.h> |
| 5 | |
David Herrmann | 9183df2 | 2014-08-08 14:25:29 -0700 | [diff] [blame] | 6 | /* flags for memfd_create(2) (unsigned int) */ |
| 7 | #define MFD_CLOEXEC 0x0001U |
| 8 | #define MFD_ALLOW_SEALING 0x0002U |
Mike Kravetz | 749df87 | 2017-09-06 16:24:16 -0700 | [diff] [blame] | 9 | #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 Herrmann | 9183df2 | 2014-08-08 14:25:29 -0700 | [diff] [blame] | 31 | |
| 32 | #endif /* _UAPI_LINUX_MEMFD_H */ |