hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/tools/include/uapi/asm-generic/mman-common.h
....@@ -11,24 +11,27 @@
1111 #define PROT_WRITE 0x2 /* page can be written */
1212 #define PROT_EXEC 0x4 /* page can be executed */
1313 #define PROT_SEM 0x8 /* page may be used for atomic ops */
14
+/* 0x10 reserved for arch-specific use */
15
+/* 0x20 reserved for arch-specific use */
1416 #define PROT_NONE 0x0 /* page can not be accessed */
1517 #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
1618 #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
1719
18
-#define MAP_SHARED 0x01 /* Share changes */
19
-#define MAP_PRIVATE 0x02 /* Changes are private */
20
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
20
+/* 0x01 - 0x03 are defined in linux/mman.h */
2121 #define MAP_TYPE 0x0f /* Mask for type of mapping */
2222 #define MAP_FIXED 0x10 /* Interpret addr exactly */
2323 #define MAP_ANONYMOUS 0x20 /* don't use a file */
24
-#ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED
25
-# define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be uninitialized */
26
-#else
27
-# define MAP_UNINITIALIZED 0x0 /* Don't support this flag */
28
-#endif
2924
30
-/* 0x0100 - 0x80000 flags are defined in asm-generic/mman.h */
25
+/* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */
26
+#define MAP_POPULATE 0x008000 /* populate (prefault) pagetables */
27
+#define MAP_NONBLOCK 0x010000 /* do not block on IO */
28
+#define MAP_STACK 0x020000 /* give out an address that is best suited for process/thread stacks */
29
+#define MAP_HUGETLB 0x040000 /* create a huge page mapping */
30
+#define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */
3131 #define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
32
+
33
+#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be
34
+ * uninitialized */
3235
3336 /*
3437 * Flags for mlock
....@@ -66,6 +69,9 @@
6669 #define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
6770 #define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
6871
72
+#define MADV_COLD 20 /* deactivate these pages */
73
+#define MADV_PAGEOUT 21 /* reclaim these pages */
74
+
6975 /* compatibility flags */
7076 #define MAP_FILE 0
7177