From patchwork Sat Jan 2 22:31:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 10198 Received: (qmail 12250 invoked by alias); 2 Jan 2016 22:31:34 -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 12238 invoked by uid 89); 2 Jan 2016 22:31:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Flags, mapping, 16K, 16k X-HELO: mout.gmx.net To: GNU C Library Cc: carlos@redhat.com, 'Mike Frysinger' , John David Anglin From: Helge Deller Subject: [PATCH] Add MAP_HUGETLB and MAP_STACK defines for hppa X-Enigmail-Draft-Status: N1110 Message-ID: <56884FB0.8030504@gmx.de> Date: Sat, 2 Jan 2016 23:31:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-UI-Out-Filterresults: notjunk:1; V01:K0:dGYGJIACflc=:4eL763PJtX3qZ7hcfGTsuw pJizo6UNyLbR9NmB8RTcWS+nwUMSemv5LPM9xqe08xVBsATXH+o0WQUrMSJ+VMg7MaGDn79CX UuVY1urblaXLHS0EhGiyJ02bjGcv9j6/CSc2bl1kKJNUGYkmACymQteSxVseK4I+in6GssWoC wXkPdRULlYQuZxpQE8S1SPmQq7bPiVqaRXdngvCaxFsCL2rE1+hRsI81GF6+xHTA/CVK29rW9 kpO7F8G00bG1uJIdgA+Tr+x/o/q7LWKs3meWrL8KnzgexUG8YX/wLZ/Ryd9OLC3SADips7nY8 psU/OQIlLBH4pgFPUm9Y/MpEFRxr8gXUjvjKrZeYsh5/AaRSW7CO/dqGX3D6aux78wmZfZH+T clek1yUPJwOeY4l3ez5DXjoYX81zKa1uBCUD94h4JraMBl3D04iIf3cGzmSE20CgEhNTf2j/7 YWH+Z6tfaxItaKZiroWL+YKxabroOrYeHASwe5BRPYY8QgN6JYm5o/t4LDnLGyQYXTQl6kVkd Rs4DktFwI12p02q9R6Hu9N2eVLZCJ4yZKINFm666o1xJVo2o8xa8NErmK0at+T8IeC6tyi8T7 PYGuXkOOrIJcuq0jbiTDz+QtelRfwqbVd9M0B//XRu0+RZhCczKAcl21uU+n33zcHxkPJXWCo UmrLBlsBSqdBOSpD70NgNwajSQSbUG3ap62RSpaPKJjaxUXoUfv7CK3eK3xGpBfmhF6wgd0Dk PF407NOzoWCNOulVSO3vL+UtwXzVE82HmKHYcaEogeAKp3qPXZFn45lZViI= The attached patch adds some upstream defines like MAP_HUGETLB and MAP_STACK in mman.h for the hppa architecture. The glibc mman.h header file for the hppa architecture (sysdeps/unix/sysv/linux/hppa/bits/mman.h) is missing the Linux upstream defines for MAP_HUGETLB, MCL_ONFAULT, MADV_HUGEPAGE, MADV_NOHUGEPAGE, MADV_DONTDUMP and MADV_DODUMP. Those are added by this patch. The existing MADV_xxK_PAGES defines were dropped upstream, because they were originally added many years ago based on a proposed patch for the Linux kernel which was never applied. So, this patch drops those unneeded defines. The change closes BZ #19285]. Please install if okay. Thanks, Helge 2016-01-02 Helge Deller [BZ #19285] * sysdeps/unix/sysv/linux/hppa/bits/mman.h (MAP_STACK): Define. (MAP_HUGETLB, MCL_ONFAULT): Likewise. (MADV_HUGEPAGE, MADV_NOHUGEPAGE, MADV_DONTDUMP, MADV_DODUMP): Likewise. (MADV_xxK_PAGES): Remove. 2016-01-02 Helge Deller [BZ #19285] * sysdeps/unix/sysv/linux/hppa/bits/mman.h (MAP_STACK): Define. (MAP_HUGETLB, MCL_ONFAULT): Likewise. (MADV_HUGEPAGE, MADV_NOHUGEPAGE, MADV_DONTDUMP, MADV_DODUMP): Likewise. (MADV_xxK_PAGES): Remove. diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h index cbde4b8..561f607 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h @@ -58,6 +58,8 @@ # define MAP_GROWSDOWN 0x8000 /* Stack-like segment */ # define MAP_POPULATE 0x10000 /* Populate (prefault) pagetables */ # define MAP_NONBLOCK 0x20000 /* Do not block on IO */ +# define MAP_STACK 0x40000 /* Create for process/thread stacks */ +# define MAP_HUGETLB 0x80000 /* Create a huge page mapping */ #endif /* Flags to "msync" */ @@ -68,6 +70,7 @@ /* Flags to "mlockall" */ #define MCL_CURRENT 1 /* Lock all current mappings */ #define MCL_FUTURE 2 /* Lock all future mappings */ +#define MCL_ONFAULT 4 /* Lock all pages that are faulted in */ /* Flags for `mremap'. */ #ifdef __USE_GNU @@ -90,19 +93,11 @@ # define MADV_DOFORK 11 /* Do inherit across fork. */ # define MADV_MERGEABLE 65 /* KSM may merge identical pages */ # define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */ -#endif - -/* The range 12-64 is reserved for page size specification. */ -/* These are Linux-specific. */ -#ifdef __USE_MISC -# define MADV_4K_PAGES 12 /* Use 4K pages. */ -# define MADV_16K_PAGES 14 /* Use 16K pages. */ -# define MADV_64K_PAGES 16 /* Use 64K pages. */ -# define MADV_256K_PAGES 18 /* Use 256K pages. */ -# define MADV_1M_PAGES 20 /* Use 1 Megabyte pages. */ -# define MADV_4M_PAGES 22 /* Use 4 Megabyte pages. */ -# define MADV_16M_PAGES 24 /* Use 16 Megabyte pages. */ -# define MADV_64M_PAGES 26 /* Use 64 Megabyte pages. */ +# define MADV_HUGEPAGE 67 /* Worth backing with hugepages */ +# define MADV_NOHUGEPAGE 68 /* Not worth backing with hugepages */ +# define MADV_DONTDUMP 69 /* Explicity exclude from the core dump, + overrides the coredump filter bits */ +# define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */ #endif /* The POSIX people had to invent similar names for the same things. */