server: Add a platform-specific entry point to initialize registers of a new thread.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-27 10:50:41 +02:00
parent 56998d567e
commit 9a07d210f1
5 changed files with 27 additions and 0 deletions

View File

@ -148,6 +148,11 @@ void finish_process_tracing( struct process *process )
}
}
/* initialize registers in new thread if necessary */
void init_thread_context( struct thread *thread )
{
}
/* retrieve the thread x86 registers */
void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
{

View File

@ -202,6 +202,11 @@ error:
close( fd );
}
/* initialize registers in new thread if necessary */
void init_thread_context( struct thread *thread )
{
}
/* retrieve the thread registers */
void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
{

View File

@ -542,6 +542,11 @@ void get_selector_entry( struct thread *thread, int entry, unsigned int *base,
/* debug register offset in struct user */
#define DR_OFFSET(dr) ((((struct user *)0)->u_debugreg) + (dr))
/* initialize registers in new thread if necessary */
void init_thread_context( struct thread *thread )
{
}
/* retrieve the thread x86 registers */
void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
{
@ -652,6 +657,11 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
#include <machine/reg.h>
/* initialize registers in new thread if necessary */
void init_thread_context( struct thread *thread )
{
}
/* retrieve the thread x86 registers */
void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
{
@ -726,6 +736,11 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
#else /* linux || __FreeBSD__ */
/* initialize registers in new thread if necessary */
void init_thread_context( struct thread *thread )
{
}
/* retrieve the thread x86 registers */
void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
{

View File

@ -1317,6 +1317,7 @@ DECL_HANDLER(init_thread)
}
if (process->unix_pid != current->unix_pid)
process->unix_pid = -1; /* can happen with linuxthreads */
init_thread_context( current );
stop_thread_if_suspended( current );
generate_debug_event( current, CREATE_THREAD_DEBUG_EVENT, &req->entry );
set_thread_affinity( current, current->affinity );

View File

@ -131,6 +131,7 @@ extern int is_cpu_supported( enum cpu_type cpu );
/* ptrace functions */
extern void sigchld_callback(void);
extern void init_thread_context( struct thread *thread );
extern void get_thread_context( struct thread *thread, context_t *context, unsigned int flags );
extern void set_thread_context( struct thread *thread, const context_t *context, unsigned int flags );
extern int send_thread_signal( struct thread *thread, int sig );