History

arch: move common mmap flags to linux/mman.h

Now that we have 3 mmap flags shared by all architectures, let's move them into the common header. This will help discourage future architectures from duplicating code.

Michael S. Tsirkin committed 7 years ago

Commit 746c9391 parent 852661a6 files · +9 −15Browse files

Showing the changes to include/uapi (2 of 6 files). Show all

Unified · Split

2 files
  1. include/uapi/asm-generic/mman-common.h +1 −3
  2. include/uapi/linux/mman.h +4 −0
include/uapi/asm-generic/mman-common.h+1−3
@@ -15,9 +15,7 @@ · 14 unmodified lines
15#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */15#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
16#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */16#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
17 17
18#define MAP_SHARED 0x01 /* Share changes */18/* 0x01 - 0x03 are defined in linux/mman.h */
19#define MAP_PRIVATE 0x02 /* Changes are private */
20#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
21#define MAP_TYPE 0x0f /* Mask for type of mapping */19#define MAP_TYPE 0x0f /* Mask for type of mapping */
22#define MAP_FIXED 0x10 /* Interpret addr exactly */20#define MAP_FIXED 0x10 /* Interpret addr exactly */
23#define MAP_ANONYMOUS 0x20 /* don't use a file */21#define MAP_ANONYMOUS 0x20 /* don't use a file */
include/uapi/linux/mman.h+4−0
@@ -12,6 +12,10 @@ · 11 unmodified lines
12#define OVERCOMMIT_ALWAYS 112#define OVERCOMMIT_ALWAYS 1
13#define OVERCOMMIT_NEVER 213#define OVERCOMMIT_NEVER 2
14 14
15#define MAP_SHARED 0x01 /* Share changes */
16#define MAP_PRIVATE 0x02 /* Changes are private */
17#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
18
15/*19/*
16 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page20 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
17 * size other than the default is desired. See hugetlb_encode.h.21 * size other than the default is desired. See hugetlb_encode.h.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t