Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7b96e82f
Commit
7b96e82f
authored
Sep 02, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make the reserved area functions static.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4c45348f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
65 deletions
+11
-65
loader.c
dlls/ntdll/unix/loader.c
+4
-55
unix_private.h
dlls/ntdll/unix/unix_private.h
+0
-5
virtual.c
dlls/ntdll/unix/virtual.c
+7
-5
No files found.
dlls/ntdll/unix/loader.c
View file @
7b96e82f
...
...
@@ -1406,12 +1406,6 @@ static void start_main_thread(void)
#ifdef __APPLE__
struct
apple_stack_info
{
void
*
stack
;
size_t
desired_size
;
};
static
void
*
apple_wine_thread
(
void
*
arg
)
{
start_main_thread
();
...
...
@@ -1419,31 +1413,6 @@ static void *apple_wine_thread( void *arg )
}
/***********************************************************************
* apple_alloc_thread_stack
*
* Callback for mmap_enum_reserved_areas to allocate space for
* the secondary thread's stack.
*/
#ifndef _WIN64
static
int
CDECL
apple_alloc_thread_stack
(
void
*
base
,
size_t
size
,
void
*
arg
)
{
struct
apple_stack_info
*
info
=
arg
;
/* For mysterious reasons, putting the thread stack at the very top
* of the address space causes subsequent execs to fail, even on the
* child side of a fork. Avoid the top 16MB. */
char
*
const
limit
=
(
char
*
)
0xff000000
;
if
((
char
*
)
base
>=
limit
)
return
0
;
if
(
size
>
limit
-
(
char
*
)
base
)
size
=
limit
-
(
char
*
)
base
;
if
(
size
<
info
->
desired_size
)
return
0
;
info
->
stack
=
wine_anon_mmap
(
(
char
*
)
base
+
size
-
info
->
desired_size
,
info
->
desired_size
,
PROT_READ
|
PROT_WRITE
,
MAP_FIXED
);
return
(
info
->
stack
!=
(
void
*
)
-
1
);
}
#endif
/***********************************************************************
* apple_create_wine_thread
*
* Spin off a secondary thread to complete Wine initialization, leaving
...
...
@@ -1453,33 +1422,13 @@ static int CDECL apple_alloc_thread_stack( void *base, size_t size, void *arg )
*/
static
void
apple_create_wine_thread
(
void
*
arg
)
{
int
success
=
0
;
pthread_t
thread
;
pthread_attr_t
attr
;
if
(
!
pthread_attr_init
(
&
attr
))
{
#ifndef _WIN64
struct
apple_stack_info
info
;
/* Try to put the new thread's stack in the reserved area. If this
* fails, just let it go wherever. It'll be a waste of space, but we
* can go on. */
if
(
!
pthread_attr_getstacksize
(
&
attr
,
&
info
.
desired_size
)
&&
mmap_enum_reserved_areas
(
apple_alloc_thread_stack
,
&
info
,
1
))
{
mmap_remove_reserved_area
(
info
.
stack
,
info
.
desired_size
);
pthread_attr_setstackaddr
(
&
attr
,
(
char
*
)
info
.
stack
+
info
.
desired_size
);
}
#endif
if
(
!
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_JOINABLE
)
&&
!
pthread_create
(
&
thread
,
&
attr
,
apple_wine_thread
,
NULL
))
success
=
1
;
pthread_attr_destroy
(
&
attr
);
}
if
(
!
success
)
exit
(
1
);
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_JOINABLE
);
if
(
pthread_create
(
&
thread
,
&
attr
,
apple_wine_thread
,
NULL
))
exit
(
1
);
pthread_attr_destroy
(
&
attr
);
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
7b96e82f
...
...
@@ -103,11 +103,6 @@ extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN;
extern
NTSTATUS
CDECL
fast_wait_cv
(
RTL_CONDITION_VARIABLE
*
variable
,
const
void
*
value
,
const
LARGE_INTEGER
*
timeout
)
DECLSPEC_HIDDEN
;
void
CDECL
mmap_add_reserved_area
(
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
void
CDECL
mmap_remove_reserved_area
(
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
int
CDECL
mmap_is_in_reserved_area
(
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
int
CDECL
mmap_enum_reserved_areas
(
int
(
CDECL
*
enum_func
)(
void
*
base
,
SIZE_T
size
,
void
*
arg
),
void
*
arg
,
int
top_down
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_initial_environment
(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_startup_info
(
startup_info_t
*
info
,
SIZE_T
*
total_size
,
SIZE_T
*
info_size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_dynamic_environment
(
WCHAR
*
env
,
SIZE_T
*
size
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
7b96e82f
...
...
@@ -212,6 +212,8 @@ static inline BOOL is_inside_signal_stack( void *ptr )
}
static
void
mmap_add_reserved_area
(
void
*
addr
,
SIZE_T
size
);
static
void
reserve_area
(
void
*
addr
,
void
*
end
)
{
#ifdef __APPLE__
...
...
@@ -351,7 +353,7 @@ static void mmap_init( const struct preload_info *preload_info )
#endif
}
void
CDECL
mmap_add_reserved_area
(
void
*
addr
,
SIZE_T
size
)
static
void
mmap_add_reserved_area
(
void
*
addr
,
SIZE_T
size
)
{
struct
reserved_area
*
area
;
struct
list
*
ptr
;
...
...
@@ -400,7 +402,7 @@ void CDECL mmap_add_reserved_area( void *addr, SIZE_T size )
}
}
void
CDECL
mmap_remove_reserved_area
(
void
*
addr
,
SIZE_T
size
)
static
void
mmap_remove_reserved_area
(
void
*
addr
,
SIZE_T
size
)
{
struct
reserved_area
*
area
;
struct
list
*
ptr
;
...
...
@@ -460,7 +462,7 @@ void CDECL mmap_remove_reserved_area( void *addr, SIZE_T size )
}
}
int
CDECL
mmap_is_in_reserved_area
(
void
*
addr
,
SIZE_T
size
)
static
int
mmap_is_in_reserved_area
(
void
*
addr
,
SIZE_T
size
)
{
struct
reserved_area
*
area
;
struct
list
*
ptr
;
...
...
@@ -477,8 +479,8 @@ int CDECL mmap_is_in_reserved_area( void *addr, SIZE_T size )
return
0
;
}
int
CDECL
mmap_enum_reserved_areas
(
int
(
CDECL
*
enum_func
)(
void
*
base
,
SIZE_T
size
,
void
*
arg
),
void
*
arg
,
int
top_down
)
static
int
mmap_enum_reserved_areas
(
int
(
CDECL
*
enum_func
)(
void
*
base
,
SIZE_T
size
,
void
*
arg
),
void
*
arg
,
int
top_down
)
{
int
ret
=
0
;
struct
list
*
ptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment