public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: drop wincap::def_guard_pages
@ 2022-12-04 13:27 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-12-04 13:27 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ef741db52b4897de7bc169e2b9e76a07ba4d1ff3

commit ef741db52b4897de7bc169e2b9e76a07ba4d1ff3
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Tue Nov 15 17:56:42 2022 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Sun Dec 4 14:01:41 2022 +0100

    Cygwin: drop wincap::def_guard_pages
    
    Only required for Windows 7.  Define constant value
    DEFAULT_GUARD_PAGE_COUNT instead.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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/local_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_includes/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
 
+#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:
 
   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... */
 
 wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:2,
   {
     is_server:false,
     has_new_pebteb_region:false,
@@ -43,7 +42,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
 };
 
 wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:3,
   {
     is_server:false,
     has_new_pebteb_region:false,
@@ -66,7 +64,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
 };
 
 wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:3,
   {
     is_server:false,
     has_new_pebteb_region:false,
@@ -89,7 +86,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
 };
 
 wincaps  wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:3,
   {
     is_server:false,
     has_new_pebteb_region:false,
@@ -112,7 +108,6 @@ wincaps  wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared))
 };
 
 wincaps  wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:3,
   {
     is_server:false,
     has_new_pebteb_region:false,
@@ -135,7 +130,6 @@ wincaps  wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared))
 };
 
 wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_10_2004 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  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)) =
 };
 
 wincaps wincap_11 __attribute__((section (".cygwin_dll_common"), shared)) = {
-  def_guard_pages:3,
   {
     is_server:false,
     has_new_pebteb_region:true,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-04 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-04 13:27 [newlib-cygwin] Cygwin: drop wincap::def_guard_pages Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).