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

Alexandre Julliard julliard at winehq.org
Thu Jul 27 15:26:14 CDT 2017


Module: wine
Branch: master
Commit: 9a07d210f135c91dda89d888dcedac864ff36781
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9a07d210f135c91dda89d888dcedac864ff36781

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul 27 10:50:41 2017 +0200

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

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/mach.c   |  5 +++++
 server/procfs.c |  5 +++++
 server/ptrace.c | 15 +++++++++++++++
 server/thread.c |  1 +
 server/thread.h |  1 +
 5 files changed, 27 insertions(+)

diff --git a/server/mach.c b/server/mach.c
index 2ef6e59..9d8d911 100644
--- a/server/mach.c
+++ b/server/mach.c
@@ -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 )
 {
diff --git a/server/procfs.c b/server/procfs.c
index 5caa02b..7b61b2a 100644
--- a/server/procfs.c
+++ b/server/procfs.c
@@ -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 )
 {
diff --git a/server/ptrace.c b/server/ptrace.c
index cb436b6..7de506b 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -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 )
 {
diff --git a/server/thread.c b/server/thread.c
index 70f5f28..24e9af5 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -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 );
diff --git a/server/thread.h b/server/thread.h
index 2821991..2fdfd66 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -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 );




More information about the wine-cvs mailing list