From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 8C41338518B5; Sun, 4 Dec 2022 13:27:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C41338518B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670160477; bh=AW/HtbkoF/BcAGYI8CT57bfaoFgFDlg+dTVZhy+2Eco=; h=From:To:Subject:Date:From; b=INLbYR68A8Gd29nEHLJfjCTCMtC3dphwgkTva+O/iC9llTgPXk+Hq6Z429eFu18R9 i4nIQ1sAkF1pIsbJ2kCxa4/eT+TsKzuzrLK9NfGQtMGGOFeddX815aqjpuHBdmRwZc gx7nKH29DfOMvu0mb9hRE+Up3Z4ork0yxROjjQSw= 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: drop wincap::def_guard_pages X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: ae2829a2269010230506e08a550b80e43d2083cc X-Git-Newrev: ef741db52b4897de7bc169e2b9e76a07ba4d1ff3 Message-Id: <20221204132757.8C41338518B5@sourceware.org> Date: Sun, 4 Dec 2022 13:27:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Def741db52b4= 897de7bc169e2b9e76a07ba4d1ff3 commit ef741db52b4897de7bc169e2b9e76a07ba4d1ff3 Author: Corinna Vinschen AuthorDate: Tue Nov 15 17:56:42 2022 +0100 Commit: Corinna Vinschen CommitDate: Sun Dec 4 14:01:41 2022 +0100 Cygwin: drop wincap::def_guard_pages =20 Only required for Windows 7. Define constant value DEFAULT_GUARD_PAGE_COUNT instead. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/local_includes/memory_layout.h | 3 +++ winsup/cygwin/local_includes/wincap.h | 5 +++-- winsup/cygwin/wincap.cc | 12 ------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/winsup/cygwin/local_includes/memory_layout.h b/winsup/cygwin/l= ocal_includes/memory_layout.h index 6a4b7a28a11c..481215b06a59 100644 --- a/winsup/cygwin/local_includes/memory_layout.h +++ b/winsup/cygwin/local_includes/memory_layout.h @@ -56,3 +56,6 @@ details. */ Set the lowest address to leave ~32 Gigs for heap. */ #define MMAP_STORAGE_LOW 0x001000000000UL #define MMAP_STORAGE_HIGH 0x700000000000UL + +/* Default number of pages used as thread stack guard pages. */ +#define DEFAULT_GUARD_PAGE_COUNT 3 diff --git a/winsup/cygwin/local_includes/wincap.h b/winsup/cygwin/local_in= cludes/wincap.h index d5579e7ea71a..c6dbd2311078 100644 --- a/winsup/cygwin/local_includes/wincap.h +++ b/winsup/cygwin/local_includes/wincap.h @@ -9,9 +9,10 @@ details. */ #ifndef _WINCAP_H #define _WINCAP_H =20 +#include "memory_layout.h" + struct wincaps { - DWORD def_guard_pages; /* The bitfields must be 8 byte aligned on x86_64, otherwise the bitfield ops generated by gcc are off by 4 bytes. */ struct __attribute__ ((aligned (8))) { @@ -64,7 +65,7 @@ public: =20 DWORD def_guard_page_size () const { - return ((wincaps *) this->caps)->def_guard_pages * page_size (); + return DEFAULT_GUARD_PAGE_COUNT * page_size (); } bool IMPLEMENT (is_server) bool IMPLEMENT (has_new_pebteb_region) diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 7aefde48cb49..702d99e15b85 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -20,7 +20,6 @@ details. */ puzzled that this has never been noticed before... */ =20 wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = =3D { - def_guard_pages:2, { is_server:false, has_new_pebteb_region:false, @@ -43,7 +42,6 @@ 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, { is_server:false, has_new_pebteb_region:false, @@ -66,7 +64,6 @@ 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, { is_server:false, has_new_pebteb_region:false, @@ -89,7 +86,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_c= ommon"), shared)) =3D { }; =20 wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), sha= red)) =3D { - def_guard_pages:3, { is_server:false, has_new_pebteb_region:false, @@ -112,7 +108,6 @@ 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, { is_server:false, has_new_pebteb_region:false, @@ -135,7 +130,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -158,7 +152,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -181,7 +174,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -204,7 +196,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -227,7 +218,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -250,7 +240,6 @@ 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, { is_server:false, has_new_pebteb_region:true, @@ -273,7 +262,6 @@ 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, { is_server:false, has_new_pebteb_region:true,