about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-12-17 14:46:09 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-12-17 14:46:09 +0100
commite751d41ba77846e6f62d49d238d9bd31cbaa8cbd (patch)
tree554a3f0a701395079756216bbd2ecd83573d6769 /src
parent7fd884b9c110eeb236dc909737917c62b70c5d43 (diff)
downloadbox64-e751d41ba77846e6f62d49d238d9bd31cbaa8cbd.tar.gz
box64-e751d41ba77846e6f62d49d238d9bd31cbaa8cbd.zip
Some (mostly) cosmetic change to x64emu initializers
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64emu.c8
-rw-r--r--src/include/x64emu.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c
index f140cb99..02ef89d5 100644
--- a/src/emu/x64emu.c
+++ b/src/emu/x64emu.c
@@ -95,7 +95,7 @@ static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t s
 EXPORTDYN
 x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack)
 {
-    printf_log(LOG_DEBUG, "Allocate a new X86_64 Emu, with %cIP=%p and Stack=%p/0x%X\n", box64_is32bits?'E':'R', (void*)start, (void*)stack, stacksize);
+    printf_log(LOG_DEBUG, "Allocate a new X86_64 Emu, with %cIP=%p and Stack=%p/0x%X%s\n", box64_is32bits?'E':'R', (void*)start, (void*)stack, stacksize, ownstack?" owned":"");
 
     x64emu_t *emu = (x64emu_t*)actual_calloc(1, sizeof(x64emu_t));
 
@@ -104,11 +104,11 @@ x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, i
     return emu;
 }
 
-x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack)
+x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize)
 {
     printf_log(LOG_DEBUG, "New X86_64 Emu from stack, with EIP=%p and Stack=%p/0x%X\n", (void*)start, (void*)stack, stacksize);
 
-    internalX64Setup(emu, context, start, stack, stacksize, ownstack);
+    internalX64Setup(emu, context, start, stack, stacksize, 0);
     
     return emu;
 }
@@ -203,7 +203,7 @@ void CallAllCleanup(x64emu_t *emu)
 static void internalFreeX64(x64emu_t* emu)
 {
     if(emu && emu->stack2free)
-        !munmap(emu->stack2free, emu->size_stack);
+        munmap(emu->stack2free, emu->size_stack);
     #ifdef BOX32
     if(emu->res_state_32)
         actual_free(emu->res_state_32);
diff --git a/src/include/x64emu.h b/src/include/x64emu.h
index 8c08a0c2..8b6fa4cb 100644
--- a/src/include/x64emu.h
+++ b/src/include/x64emu.h
@@ -6,7 +6,7 @@ typedef struct box64context_s box64context_t;
 typedef struct elfheader_s elfheader_t;
 
 x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack);
-x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack);
+x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize);
 void SetupX64Emu(x64emu_t *emu, x64emu_t *ref);
 void FreeX64Emu(x64emu_t **x64emu);
 void FreeX64EmuFromStack(x64emu_t **emu);