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
53e4c36e
Commit
53e4c36e
authored
Nov 29, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a platform-specific helper for starting a thread.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
afb16abc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
22 deletions
+161
-22
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
signal_arm.c
dlls/ntdll/signal_arm.c
+31
-0
signal_arm64.c
dlls/ntdll/signal_arm64.c
+31
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+33
-2
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+31
-0
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+31
-0
thread.c
dlls/ntdll/thread.c
+3
-20
No files found.
dlls/ntdll/ntdll_misc.h
View file @
53e4c36e
...
...
@@ -68,6 +68,7 @@ extern NTSTATUS signal_alloc_thread( TEB **teb ) DECLSPEC_HIDDEN;
extern
void
signal_free_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_process
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
signal_start_process
(
LPTHREAD_START_ROUTINE
entry
,
BOOL
suspend
)
DECLSPEC_HIDDEN
;
extern
void
version_init
(
const
WCHAR
*
appname
)
DECLSPEC_HIDDEN
;
extern
void
debug_init
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/signal_arm.c
View file @
53e4c36e
...
...
@@ -62,6 +62,7 @@
#include "winnt.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
static
pthread_key_t
teb_key
;
...
...
@@ -1012,6 +1013,36 @@ void signal_init_process(void)
}
struct
startup_info
{
LPTHREAD_START_ROUTINE
entry
;
void
*
arg
;
};
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
call_thread_entry_point
(
info
->
entry
,
info
->
arg
);
}
/***********************************************************************
* signal_start_thread
*/
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
{
NTSTATUS
status
;
struct
startup_info
info
=
{
entry
,
arg
};
if
(
!
(
status
=
wine_call_on_stack
(
attach_dlls
,
(
void
*
)
1
,
NtCurrentTeb
()
->
Tib
.
StackBase
)))
{
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
entry
,
arg
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
return
status
;
}
/**********************************************************************
* signal_start_process
*/
...
...
dlls/ntdll/signal_arm64.c
View file @
53e4c36e
...
...
@@ -59,6 +59,7 @@
#include "winnt.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
static
pthread_key_t
teb_key
;
...
...
@@ -883,6 +884,36 @@ void signal_init_process(void)
}
struct
startup_info
{
LPTHREAD_START_ROUTINE
entry
;
void
*
arg
;
};
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
call_thread_entry_point
(
info
->
entry
,
info
->
arg
);
}
/***********************************************************************
* signal_start_thread
*/
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
{
NTSTATUS
status
;
struct
startup_info
info
=
{
entry
,
arg
};
if
(
!
(
status
=
wine_call_on_stack
(
attach_dlls
,
(
void
*
)
1
,
NtCurrentTeb
()
->
Tib
.
StackBase
)))
{
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
entry
,
arg
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
return
status
;
}
/***********************************************************************
* start_process
*/
...
...
dlls/ntdll/signal_i386.c
View file @
53e4c36e
...
...
@@ -69,6 +69,9 @@
#undef ERR
/* Solaris needs to define this */
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
/* not defined for x86, so copy the x86_64 definition */
typedef
struct
DECLSPEC_ALIGN
(
16
)
_M128A
{
...
...
@@ -468,8 +471,6 @@ typedef struct trapframe ucontext_t;
#error You must define the signal context functions for your platform
#endif
/* linux */
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
const
size_t
teb_size
=
4096
;
/* we reserve one page for the TEB */
...
...
@@ -2601,6 +2602,36 @@ void signal_init_process(void)
}
struct
startup_info
{
LPTHREAD_START_ROUTINE
entry
;
void
*
arg
;
};
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
call_thread_entry_point
(
info
->
entry
,
info
->
arg
);
}
/***********************************************************************
* signal_start_thread
*/
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
{
NTSTATUS
status
;
struct
startup_info
info
=
{
entry
,
arg
};
if
(
!
(
status
=
wine_call_on_stack
(
attach_dlls
,
(
void
*
)
1
,
NtCurrentTeb
()
->
Tib
.
StackBase
)))
{
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
entry
,
arg
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
return
status
;
}
/**********************************************************************
* signal_start_process
*/
...
...
dlls/ntdll/signal_powerpc.c
View file @
53e4c36e
...
...
@@ -59,6 +59,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
static
pthread_key_t
teb_key
;
...
...
@@ -1085,6 +1086,36 @@ void signal_init_process(void)
}
struct
startup_info
{
LPTHREAD_START_ROUTINE
entry
;
void
*
arg
;
};
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
call_thread_entry_point
(
info
->
entry
,
info
->
arg
);
}
/***********************************************************************
* signal_start_thread
*/
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
{
NTSTATUS
status
;
struct
startup_info
info
=
{
entry
,
arg
};
if
(
!
(
status
=
wine_call_on_stack
(
attach_dlls
,
(
void
*
)
1
,
NtCurrentTeb
()
->
Tib
.
StackBase
)))
{
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
entry
,
arg
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
return
status
;
}
/***********************************************************************
* start_process
*/
...
...
dlls/ntdll/signal_x86_64.c
View file @
53e4c36e
...
...
@@ -73,6 +73,7 @@
#endif
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
struct
_DISPATCHER_CONTEXT
;
...
...
@@ -3143,6 +3144,36 @@ void signal_init_process(void)
}
struct
startup_info
{
LPTHREAD_START_ROUTINE
entry
;
void
*
arg
;
};
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
call_thread_entry_point
(
info
->
entry
,
info
->
arg
);
}
/***********************************************************************
* signal_start_thread
*/
NTSTATUS
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
{
NTSTATUS
status
;
struct
startup_info
info
=
{
entry
,
arg
};
if
(
!
(
status
=
wine_call_on_stack
(
attach_dlls
,
(
void
*
)
1
,
NtCurrentTeb
()
->
Tib
.
StackBase
)))
{
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
entry
,
arg
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
return
status
;
}
/**********************************************************************
* signal_start_process
*/
...
...
dlls/ntdll/thread.c
View file @
53e4c36e
...
...
@@ -47,7 +47,6 @@
#include "wine/exception.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
thread
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
struct
_KUSER_SHARED_DATA
*
user_shared_data
=
NULL
;
...
...
@@ -491,29 +490,13 @@ void exit_thread( int status )
/***********************************************************************
* thread_startup
*/
static
void
thread_startup
(
void
*
param
)
{
struct
startup_info
*
info
=
param
;
PRTL_THREAD_START_ROUTINE
func
=
info
->
entry_point
;
void
*
arg
=
info
->
entry_arg
;
attach_dlls
(
(
void
*
)
1
);
TRACE_
(
relay
)(
"
\1
Starting thread proc %p (arg=%p)
\n
"
,
func
,
arg
);
call_thread_entry_point
(
(
LPTHREAD_START_ROUTINE
)
func
,
arg
);
}
/***********************************************************************
* start_thread
*
* Startup routine for a newly created thread.
*/
static
void
start_thread
(
struct
startup_info
*
info
)
{
NTSTATUS
status
;
TEB
*
teb
=
info
->
teb
;
struct
ntdll_thread_data
*
thread_data
=
(
struct
ntdll_thread_data
*
)
&
teb
->
GdiTebBatch
;
struct
debug_info
debug_info
;
...
...
@@ -525,8 +508,8 @@ static void start_thread( struct startup_info *info )
signal_init_thread
(
teb
);
server_init_thread
(
info
->
entry_point
);
wine_switch_to_stack
(
thread_startup
,
info
,
teb
->
Tib
.
StackBase
);
status
=
signal_start_thread
(
(
LPTHREAD_START_ROUTINE
)
info
->
entry_point
,
info
->
entry_arg
);
NtTerminateThread
(
GetCurrentThread
(),
status
);
}
...
...
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