Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-01-10 21:11:32 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-01-10 21:11:32 +0300
commitb773a592d3dfea4525c852a1d98540aa86bc0e43 (patch)
tree10f26be64fbe4b3dfa4384928e8c9b72267ce323 /winsup/cygwin/mmap.cc
parentdea958bc0612f79a603e4a8a915c8beeafc464e1 (diff)
* dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
* init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker. Call wincap.init here before doing anything else. Use wincap.is_wow64 to determine if we're running in a WOW64 emulator. * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's apparently not supported. (mmap64): Don't create mappings beyond EOF, which would need to use AT_ROUND_TO_PAGE, on WOW64. * wincap.cc (wincap): Throw into the .cygwin_dll_common section. (wincapc::init): Determine if running in WOW64 and set wow_64 flag. * wincap.h (class wincapc): Add wow64 member. (wincapc::is_wow64): New method.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 46deea31c..76d3d5d86 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -350,7 +350,7 @@ MapViewNT (HANDLE h, void *addr, size_t len, DWORD openflags,
void *base = addr;
ULONG commitsize = attached (prot) ? 0 : len;
ULONG viewsize = len;
- ULONG alloc_type = base ? AT_ROUND_TO_PAGE : 0;
+ ULONG alloc_type = base && !wincap.is_wow64 () ? AT_ROUND_TO_PAGE : 0;
/* Try mapping using the given address first, even if it's NULL.
If it failed, and addr was not NULL and flags is not MAP_FIXED,
@@ -1109,8 +1109,13 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
anonymous pages. That's not possible on 9x for two reasons.
It neither allows to create reserved pages in the shared memory
area, nor does it allow to create page aligend mappings (in
- contrast to granularity aligned mappings). */
+ contrast to granularity aligned mappings).
+
+ Note that this isn't done in WOW64 environments since apparently
+ WOW64 does not support the AT_ROUND_TO_PAGE flag which is required
+ to get this right. Too bad. */
if (wincap.virtual_protect_works_on_shared_pages ()
+ && !wincap.is_wow64 ()
&& ((len > fsiz && !autogrow (flags))
|| len < pagesize))
orig_len = len;
@@ -1177,9 +1182,9 @@ go_ahead:
protection as the file's pages, then as much pages as necessary
to accomodate the requested length, but as reserved pages which
raise a SIGBUS when trying to access them. AT_ROUND_TO_PAGE
- and page protection on shared pages is only supported by NT, so
- don't even try on 9x. This is accomplished by not setting
- orig_len on 9x above. */
+ and page protection on shared pages is only supported by 32 bit NT,
+ so don't even try on 9x and in WOW64. This is accomplished by not
+ setting orig_len on 9x and in WOW64 above. */
orig_len = roundup2 (orig_len, pagesize);
len = roundup2 (len, getsystempagesize ());
if (orig_len - len)