From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C00F2384642D; Fri, 28 Oct 2022 14:27:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C00F2384642D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666967261; bh=HyPvupJC61oMX24pUKyllaiUw1b7eUdfV+muXwrW1o0=; h=From:To:Subject:Date:From; b=vnuFQ+/7CvIfTO1WqF/WdzOK3BfwYfGGfxKvl7LxbVMBbUIEPG7BWXM9FDnWhlSZD RsIbQWIOIHd/UCpodGJFy7hk8fNOAVBqa3tqfiHqTx6WnW39fCtzQ15BRq2aqZDbRC 2NhjlBzHyl1S/cU6h30pgxKac+PbEFkKn5GaA6Wo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: memory_layout.h: define absolute MMAP_STORAGE_HIGH values here X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 0508e11f88f73df500f91f75e0314c3592c0526b X-Git-Newrev: 49df152de7cba665e08a807e5cbc3dea846c88fa Message-Id: <20221028142741.C00F2384642D@sourceware.org> Date: Fri, 28 Oct 2022 14:27:41 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D49df152de7c= ba665e08a807e5cbc3dea846c88fa commit 49df152de7cba665e08a807e5cbc3dea846c88fa Author: Corinna Vinschen Date: Wed Oct 26 22:04:41 2022 +0200 Cygwin: memory_layout.h: define absolute MMAP_STORAGE_HIGH values here =20 Use the symbolic values in wincap.cc. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/local_includes/memory_layout.h | 14 +++++++++----- winsup/cygwin/wincap.cc | 25 +++++++++++++------------ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/winsup/cygwin/local_includes/memory_layout.h b/winsup/cygwin/l= ocal_includes/memory_layout.h index 18e7e4d69..83ccf8f65 100644 --- a/winsup/cygwin/local_includes/memory_layout.h +++ b/winsup/cygwin/local_includes/memory_layout.h @@ -52,8 +52,12 @@ details. */ so there's not much chance to meet unluckily. */ #define USERHEAP_START 0xa00000000UL =20 -/* The memory region used for memory maps. - Up to Win 8 only 44 bit address space, 48 bit starting witrh 8.1, so - the max value is variable. */ -#define MMAP_STORAGE_LOW 0x001000000000L /* Leave ~32 Gigs for heap. */ -#define MMAP_STORAGE_HIGH wincap.mmap_storage_high () +/* The memory region used for memory maps. Mmaps grow downwards. + Set the lowest address to leave ~32 Gigs for heap. + + Up to Win 8 we only have a 44 bit address space, 48 bit address space + starting with 8.1, so the max value is a system-specific variable. */ +#define MMAP_STORAGE_LOW 0x001000000000UL +#define __MMAP_STORAGE_HIGH_LEGACY 0x070000000000UL +#define __MMAP_STORAGE_HIGH 0x700000000000UL +#define MMAP_STORAGE_HIGH wincap.mmap_storage_high () diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 30da7e1e9..7309516bf 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -11,6 +11,7 @@ details. */ #include "miscfuncs.h" #include "security.h" #include "ntdll.h" +#include "memory_layout.h" =20 /* CV, 2008-10-23: All wincapc's have to be in the .cygwin_dll_common sect= ion, same as wincap itself. Otherwise the capability changes made in @@ -20,7 +21,7 @@ details. */ =20 wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = =3D { def_guard_pages:2, - mmap_storage_high:0x070000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH_LEGACY, { is_server:false, needs_query_information:true, @@ -51,7 +52,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { =20 wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = =3D { def_guard_pages:3, - mmap_storage_high:0x070000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH_LEGACY, { is_server:false, needs_query_information:true, @@ -82,7 +83,7 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { =20 wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared))= =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -113,7 +114,7 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll= _common"), shared)) =3D { =20 wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), sha= red)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -144,7 +145,7 @@ wincaps wincap_10_1507 __attribute__((section (".cygwi= n_dll_common"), shared)) =20 wincaps wincap_10_1607 __attribute__((section (".cygwin_dll_common"), sha= red)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -175,7 +176,7 @@ wincaps wincap_10_1607 __attribute__((section (".cygwi= n_dll_common"), shared)) =20 wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -206,7 +207,7 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -237,7 +238,7 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -268,7 +269,7 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -299,7 +300,7 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -330,7 +331,7 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_10_2004 __attribute__((section (".cygwin_dll_common"), shar= ed)) =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false, @@ -361,7 +362,7 @@ wincaps wincap_10_2004 __attribute__((section (".cygwin= _dll_common"), shared)) =3D =20 wincaps wincap_11 __attribute__((section (".cygwin_dll_common"), shared)) = =3D { def_guard_pages:3, - mmap_storage_high:0x700000000000LL, + mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, needs_query_information:false,