about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-01 18:01:47 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-01 18:01:47 +0200
commit37a8ac3b32163cfa9ed646805217069f78b09f95 (patch)
treec283a0bde724f61f6e5f64f86edb9530cce0d749 /src/libtools
parent3b2e75055fa21c3466a73aa9252e082359e0d9c9 (diff)
downloadbox64-37a8ac3b32163cfa9ed646805217069f78b09f95.tar.gz
box64-37a8ac3b32163cfa9ed646805217069f78b09f95.zip
Try to setup some kind of Stack Frame on new thread
Diffstat (limited to 'src/libtools')
-rwxr-xr-xsrc/libtools/threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index 6d6c7e6d..4f569817 100755
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -229,6 +229,8 @@ static void* pthread_routine(void* p)
 	et->emu->type = EMUTYPE_MAIN;
 	// setup callstack and run...
 	x64emu_t* emu = et->emu;
+	Push64(emu, 0);		// PUSH BP
+	R_RBP = R_RSP;	// MOV BP, SP
 	R_RSP -= 64;	// Gard zone
 	PushExit(emu);
 	R_RIP = et->fnc;