public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESS
@ 2023-01-17 19:15 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-01-17 19:15 UTC (permalink / raw)
  To: cygwin-cvs

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

commit 50cbbb1c0e7263d370a526fec0e905e3392bb9ba
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Mon Jan 16 22:20:48 2023 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Tue Jan 17 17:07:11 2023 +0100

    Cygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESS
    
    Fix comments accordingly.
    
    This is in preparation for a change in open_shared, handling shared
    regions more cleanly.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/local_includes/memory_layout.h | 18 ++++++++++--------
 winsup/cygwin/mm/shared.cc                   |  2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/winsup/cygwin/local_includes/memory_layout.h b/winsup/cygwin/local_includes/memory_layout.h
index 481215b06a59..21e00c1bcf55 100644
--- a/winsup/cygwin/local_includes/memory_layout.h
+++ b/winsup/cygwin/local_includes/memory_layout.h
@@ -16,14 +16,16 @@ details. */
    dynamicbase is accidentally not set in the PE/COFF header of the DLL. */
 #define CYGWIN_DLL_ADDRESS		0x180040000UL
 
-/* New with ASLR: We need a fixed place for the global shared memory areas.
-   Prior to ASLR, the addresses were relative to the address the Cygwin DLL
-   was loaded to. */
-#define SHARED_REGIONS_ADDRESS_LOW	0x1f0000000UL
-#define CYGWIN_REGION_ADDRESS		0x1f0000000UL
-#define USER_REGION_ADDRESS		0x1f2000000UL
-#define PINFO_REGION_ADDRESS		0x1f4000000UL
-#define SHARED_CONSOLE_REGION_ADDRESS	0x1f6000000UL
+/* Default addresses of required standard shared regions (Cygwin shared,
+   user shared, myself, shared console). */
+#define CYGWIN_REGION_ADDRESS		0x1a0000000UL
+#define USER_REGION_ADDRESS		0x1a1000000UL
+#define MYSELF_REGION_ADDRESS		0x1a2000000UL
+#define SHARED_CONSOLE_REGION_ADDRESS	0x1a3000000UL
+
+/* Area for non-fixed-address Cygwin-specific shared memory regions.  Fallback
+   for standard shared regions if the can't load at their default address. */
+#define SHARED_REGIONS_ADDRESS_LOW	0x1a4000000UL
 #define SHARED_REGIONS_ADDRESS_HIGH	0x200000000UL
 
 /* Rebased DLLs are located in this 16 Gigs arena.  Will be kept for
diff --git a/winsup/cygwin/mm/shared.cc b/winsup/cygwin/mm/shared.cc
index 351d314af01b..aa9997c7569c 100644
--- a/winsup/cygwin/mm/shared.cc
+++ b/winsup/cygwin/mm/shared.cc
@@ -118,7 +118,7 @@ static uintptr_t region_address[] =
 {
   CYGWIN_REGION_ADDRESS,		/* SH_CYGWIN_SHARED */
   USER_REGION_ADDRESS,			/* SH_USER_SHARED */
-  PINFO_REGION_ADDRESS,			/* SH_MYSELF */
+  MYSELF_REGION_ADDRESS,		/* SH_MYSELF */
   SHARED_CONSOLE_REGION_ADDRESS,	/* SH_SHARED_CONSOLE */
   0
 };

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

only message in thread, other threads:[~2023-01-17 19:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 19:15 [newlib-cygwin/main] Cygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESS 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).