diff options
| author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2019-07-16 19:30:41 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 22:23:25 -0400 |
| commit | 8aa3c927ec10d1230c3ace8357f624479665f701 (patch) | |
| tree | 0a517187e60eaaa3ba55ceecbf65d8b7746622ca | |
| parent | 22fcea6f85f2cc74e61bd8b3640faa8467553c24 (diff) | |
mm/mmap: move common defines to mman-common.h
Two architecture that use arch specific MMAP flags are powerpc and
sparc. We still have few flag values common across them and other
architectures. Consolidate this in mman-common.h.
Also update the comment to indicate where to find HugeTLB specific
reserved values
Link: http://lkml.kernel.org/r/20190604090950.31417-1-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | arch/powerpc/include/uapi/asm/mman.h | 6 | ||||
| -rw-r--r-- | arch/sparc/include/uapi/asm/mman.h | 6 | ||||
| -rw-r--r-- | include/uapi/asm-generic/mman-common.h | 6 | ||||
| -rw-r--r-- | include/uapi/asm-generic/mman.h | 9 |
4 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h index 65065ce32814..c0c737215b00 100644 --- a/arch/powerpc/include/uapi/asm/mman.h +++ b/arch/powerpc/include/uapi/asm/mman.h | |||
| @@ -21,15 +21,11 @@ | |||
| 21 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | 21 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ |
| 22 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | 22 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
| 23 | 23 | ||
| 24 | |||
| 24 | #define MCL_CURRENT 0x2000 /* lock all currently mapped pages */ | 25 | #define MCL_CURRENT 0x2000 /* lock all currently mapped pages */ |
| 25 | #define MCL_FUTURE 0x4000 /* lock all additions to address space */ | 26 | #define MCL_FUTURE 0x4000 /* lock all additions to address space */ |
| 26 | #define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */ | 27 | #define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */ |
| 27 | 28 | ||
| 28 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
| 29 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
| 30 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
| 31 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | ||
| 32 | |||
| 33 | /* Override any generic PKEY permission defines */ | 29 | /* Override any generic PKEY permission defines */ |
| 34 | #define PKEY_DISABLE_EXECUTE 0x4 | 30 | #define PKEY_DISABLE_EXECUTE 0x4 |
| 35 | #undef PKEY_ACCESS_MASK | 31 | #undef PKEY_ACCESS_MASK |
diff --git a/arch/sparc/include/uapi/asm/mman.h b/arch/sparc/include/uapi/asm/mman.h index f6f99ec65bb3..cec9f4109687 100644 --- a/arch/sparc/include/uapi/asm/mman.h +++ b/arch/sparc/include/uapi/asm/mman.h | |||
| @@ -22,10 +22,4 @@ | |||
| 22 | #define MCL_FUTURE 0x4000 /* lock all additions to address space */ | 22 | #define MCL_FUTURE 0x4000 /* lock all additions to address space */ |
| 23 | #define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */ | 23 | #define MCL_ONFAULT 0x8000 /* lock all pages that are faulted in */ |
| 24 | 24 | ||
| 25 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
| 26 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
| 27 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
| 28 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | ||
| 29 | |||
| 30 | |||
| 31 | #endif /* _UAPI__SPARC_MMAN_H__ */ | 25 | #endif /* _UAPI__SPARC_MMAN_H__ */ |
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 93a8b420ce1e..63b1f506ea67 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h | |||
| @@ -20,7 +20,11 @@ | |||
| 20 | #define MAP_FIXED 0x10 /* Interpret addr exactly */ | 20 | #define MAP_FIXED 0x10 /* Interpret addr exactly */ |
| 21 | #define MAP_ANONYMOUS 0x20 /* don't use a file */ | 21 | #define MAP_ANONYMOUS 0x20 /* don't use a file */ |
| 22 | 22 | ||
| 23 | /* 0x0100 - 0x40000 flags are defined in asm-generic/mman.h */ | 23 | /* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */ |
| 24 | #define MAP_POPULATE 0x008000 /* populate (prefault) pagetables */ | ||
| 25 | #define MAP_NONBLOCK 0x010000 /* do not block on IO */ | ||
| 26 | #define MAP_STACK 0x020000 /* give out an address that is best suited for process/thread stacks */ | ||
| 27 | #define MAP_HUGETLB 0x040000 /* create a huge page mapping */ | ||
| 24 | #define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */ | 28 | #define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */ |
| 25 | #define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */ | 29 | #define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */ |
| 26 | 30 | ||
diff --git a/include/uapi/asm-generic/mman.h b/include/uapi/asm-generic/mman.h index 2dffcbf705b3..57e8195d0b53 100644 --- a/include/uapi/asm-generic/mman.h +++ b/include/uapi/asm-generic/mman.h | |||
| @@ -9,12 +9,11 @@ | |||
| 9 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | 9 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
| 10 | #define MAP_LOCKED 0x2000 /* pages are locked */ | 10 | #define MAP_LOCKED 0x2000 /* pages are locked */ |
| 11 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ | 11 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ |
| 12 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
| 13 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
| 14 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
| 15 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | ||
| 16 | 12 | ||
| 17 | /* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */ | 13 | /* |
| 14 | * Bits [26:31] are reserved, see asm-generic/hugetlb_encode.h | ||
| 15 | * for MAP_HUGETLB usage | ||
| 16 | */ | ||
| 18 | 17 | ||
| 19 | #define MCL_CURRENT 1 /* lock all current mappings */ | 18 | #define MCL_CURRENT 1 /* lock all current mappings */ |
| 20 | #define MCL_FUTURE 2 /* lock all future mappings */ | 19 | #define MCL_FUTURE 2 /* lock all future mappings */ |
