Commit 9a07d210 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 56998d56
......@@ -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 )
{
......
......@@ -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 )
{
......
......@@ -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 )
{
......
......@@ -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 );
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment