From patchwork Thu Feb 1 18:15:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 25730 Received: (qmail 33354 invoked by alias); 1 Feb 2018 18:15:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 33323 invoked by uid 89); 1 Feb 2018 18:15:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 1 Feb 2018 18:15:28 +0000 From: Joseph Myers To: Subject: Add MAP_SYNC from Linux 4.15 Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) [Proposed for once the release changes for 2.27, and the post-release changes opening master for development for 2.28, have been committed.] This patch adds the MAP_SYNC macro from Linux 4.15 to various bits/mman.h headers. Note that this is *not* added to all architectures: in Linux 4.15, this macro is only in asm-generic/mman.h, and only some architectures' asm/mman.h include the asm-generic file - the architectures not using the asm-generic file will need their own values of MAP_SYNC allocated to support this functionality (some of them also already have conflicting mmap flags so the value there will have to be different from the generic 0x80000). Specifically, for glibc architectures, alpha hppa mips powerpc sparc tile lack allocations of values for MAP_SYNC. Tested for x86_64. 2018-02-01 Joseph Myers * sysdeps/unix/sysv/linux/aarch64/bits/mman.h [__USE_MISC] (MAP_SYNC): New macro. * sysdeps/unix/sysv/linux/arm/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/m68k/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/microblaze/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/nios2/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/riscv/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/s390/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/sh/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. * sysdeps/unix/sysv/linux/x86/bits/mman.h [__USE_MISC] (MAP_SYNC): Likewise. diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/mman.h b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h index 83ff48c..9ad8a60 100644 --- a/sysdeps/unix/sysv/linux/aarch64/bits/mman.h +++ b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h @@ -36,6 +36,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif diff --git a/sysdeps/unix/sysv/linux/arm/bits/mman.h b/sysdeps/unix/sysv/linux/arm/bits/mman.h index 9e059e6..be71c82 100644 --- a/sysdeps/unix/sysv/linux/arm/bits/mman.h +++ b/sysdeps/unix/sysv/linux/arm/bits/mman.h @@ -34,6 +34,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/sysdeps/unix/sysv/linux/ia64/bits/mman.h index cb64de4..0f00a1a 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h @@ -35,6 +35,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h index db26a44..80cc2a6 100644 --- a/sysdeps/unix/sysv/linux/m68k/bits/mman.h +++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h @@ -34,6 +34,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/mman.h b/sysdeps/unix/sysv/linux/microblaze/bits/mman.h index b820da1..8ca77b6 100644 --- a/sysdeps/unix/sysv/linux/microblaze/bits/mman.h +++ b/sysdeps/unix/sysv/linux/microblaze/bits/mman.h @@ -36,6 +36,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/nios2/bits/mman.h b/sysdeps/unix/sysv/linux/nios2/bits/mman.h index b7c27b8..987e479 100644 --- a/sysdeps/unix/sysv/linux/nios2/bits/mman.h +++ b/sysdeps/unix/sysv/linux/nios2/bits/mman.h @@ -36,6 +36,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/riscv/bits/mman.h b/sysdeps/unix/sysv/linux/riscv/bits/mman.h index 0e64f1e..8425772 100644 --- a/sysdeps/unix/sysv/linux/riscv/bits/mman.h +++ b/sysdeps/unix/sysv/linux/riscv/bits/mman.h @@ -30,6 +30,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h index 4b926e8..cdd7a63 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/mman.h +++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h @@ -35,6 +35,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h index c5844dc..e22be10 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h @@ -34,6 +34,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */ diff --git a/sysdeps/unix/sysv/linux/x86/bits/mman.h b/sysdeps/unix/sysv/linux/x86/bits/mman.h index fb4737a..ebfc0c7 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/mman.h +++ b/sysdeps/unix/sysv/linux/x86/bits/mman.h @@ -39,6 +39,8 @@ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ #endif /* Include generic Linux declarations. */