From: Fabian Maurer dark.shadow4@web.de
--- dlls/ntdll/unix/unix_private.h | 2 +- dlls/ntdll/unix/virtual.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 07f2724eac7..2e1f737e1dd 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -120,7 +120,7 @@ struct async_fileio HANDLE handle; };
-static const SIZE_T page_size = 0x1000; +extern SIZE_T page_size; static const SIZE_T teb_size = 0x3800; /* TEB64 + TEB32 + debug info */ static const SIZE_T signal_stack_mask = 0xffff; static const SIZE_T signal_stack_size = 0x10000 - 0x3800; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index e805c349eac..c6cfd7a9fa2 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -152,6 +152,7 @@ static const BYTE VIRTUAL_Win32Flags[16] = static struct wine_rb_tree views_tree; static pthread_mutex_t virtual_mutex;
+SIZE_T page_size; static const UINT page_shift = 12; static const UINT_PTR page_mask = 0xfff; static const UINT_PTR granularity_mask = 0xffff; @@ -3256,6 +3257,8 @@ void virtual_init(void) int i; pthread_mutexattr_t attr;
+ page_size = getpagesize(); + pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); pthread_mutex_init( &virtual_mutex, &attr );
From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52715 --- dlls/ntdll/unix/virtual.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index c6cfd7a9fa2..77cff772584 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -153,8 +153,8 @@ static struct wine_rb_tree views_tree; static pthread_mutex_t virtual_mutex;
SIZE_T page_size; -static const UINT page_shift = 12; -static const UINT_PTR page_mask = 0xfff; +static UINT page_shift; +static UINT_PTR page_mask; static const UINT_PTR granularity_mask = 0xffff;
/* Note: these are Windows limits, you cannot change them. */ @@ -3246,6 +3246,13 @@ static void *alloc_virtual_heap( SIZE_T size ) return anon_mmap_alloc( size, PROT_READ | PROT_WRITE ); }
+static UINT get_page_shift(SIZE_T page_size) +{ + UINT ret = 0; + while (page_size >>= 1) ret++; + return ret; +} + /*********************************************************************** * virtual_init */ @@ -3258,6 +3265,8 @@ void virtual_init(void) pthread_mutexattr_t attr;
page_size = getpagesize(); + page_shift = get_page_shift(page_size); + page_mask = page_size - 1;
pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );