diff options
Diffstat (limited to 'src/libtools')
| -rw-r--r-- | src/libtools/threads.c | 3 | ||||
| -rwxr-xr-x | src/libtools/threads32.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c index 6fd7ffe6..1076b3e2 100644 --- a/src/libtools/threads.c +++ b/src/libtools/threads.c @@ -24,6 +24,7 @@ #include "x64trace.h" #include "bridge.h" #include "myalign.h" +#include "x64tls.h" #ifdef DYNAREC #include "dynablock.h" #include "dynarec/native_lock.h" @@ -215,6 +216,7 @@ x64emu_t* thread_get_emu() setProtection_stack((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); x64emu_t *emu = NewX64Emu(my_context, my_context->exit_bridge, (uintptr_t)stack, stacksize, 1); SetupX64Emu(emu, NULL); + getTLSData(emu); thread_set_emu(emu); return emu; } @@ -248,6 +250,7 @@ static void* pthread_routine(void* p) et->emu->type = EMUTYPE_MAIN; // setup callstack and run... x64emu_t* emu = et->emu; + getTLSData(emu); ResetSegmentsCache(emu); Push64(emu, 0); // PUSH 0 (backtrace marker: return address is 0) Push64(emu, 0); // PUSH BP diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c index ce5a4579..4d614b93 100755 --- a/src/libtools/threads32.c +++ b/src/libtools/threads32.c @@ -27,6 +27,7 @@ #include "x64trace.h" #include "bridge.h" #include "threads32.h" +#include "x64tls.h" #ifdef DYNAREC #include "dynablock.h" #endif @@ -112,6 +113,7 @@ static void* pthread_routine(void* p) et->hself = to_hash(et->self); // setup callstack and run... x64emu_t* emu = et->emu; + getTLSData(emu); Push_32(emu, 0); // PUSH 0 (backtrace marker: return address is 0) Push_32(emu, 0); // PUSH BP R_EBP = R_ESP; // MOV BP, SP |