parisc: Convert MAP_TYPE to cover 4 bits on parisc
authorHelge Deller <deller@gmx.de>
Mon, 25 Sep 2017 22:21:27 +0000 (00:21 +0200)
committerHelge Deller <deller@gmx.de>
Tue, 27 Mar 2018 16:52:21 +0000 (18:52 +0200)
On parisc we want to be as much as possible compatible to the major
architectures like x86. Those architectures have MAP_TYPE defined as 0x0f which
covers MAP_SHARED and MAP_PRIVATE and leaves two more bits unused.

In contrast, on parisc we have MAP_TYPE defined to 0x03 which covers MAP_SHARED
and MAP_PRIVATE only. But we don't have the 2 bits free as x86.

Usually that's not a problem, but during the discussions for pmem+dax support
the idea came up to use the two remaining bits of MAP_TYPE (on x86 and others)
for the new MAP_DIRECT and MAP_SYNC flags. One requirement is, that an old
kernel should correctly handle MAP_DIRECT and MAP_SYNC and fail on those if
set. This only works if MAP_TYPE has 4 bits.

Even though the pmem+dax people now choosed another solution via
MAP_SHARED_VALIDATE, let's still proceed to be more compatible to x86 by adding
two more bits for future usage.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
arch/parisc/include/uapi/asm/mman.h

index 80510ba..a056a64 100644 (file)
@@ -13,7 +13,7 @@
 #define MAP_SHARED     0x01            /* Share changes */
 #define MAP_PRIVATE    0x02            /* Changes are private */
 #define MAP_SHARED_VALIDATE 0x03       /* share + validate extension flags */
-#define MAP_TYPE       0x03            /* Mask for type of mapping */
+#define MAP_TYPE       0x2b            /* Mask for type of mapping, includes bits 0x08 and 0x20 */
 #define MAP_FIXED      0x04            /* Interpret addr exactly */
 #define MAP_ANONYMOUS  0x10            /* don't use a file */