about summary refs log tree commit diff stats
path: root/src/box64context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/box64context.c')
-rwxr-xr-xsrc/box64context.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/box64context.c b/src/box64context.c
index c9aac3b1..fa4b74b7 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -12,6 +12,7 @@
 #include "custommem.h"
 #include "threads.h"
 #include "x64trace.h"
+#include "bridge.h"
 
 
 EXPORTDYN
@@ -60,6 +61,8 @@ void free_tlsdatasize(void* p)
     free(p);
 }
 
+void x64Syscall(x64emu_t *emu);
+
 EXPORTDYN
 box64context_t *NewBox64Context(int argc)
 {
@@ -77,6 +80,9 @@ box64context_t *NewBox64Context(int argc)
 
     init_custommem_helper(context);
 
+    context->system = NewBridge();
+    // create vsyscall
+//    context->vsyscall = AddBridge(context->system, vFv, x64Syscall, 0);
     context->box64lib = dlopen(NULL, RTLD_NOW|RTLD_GLOBAL);
     //context->dlprivate = NewDLPrivate();
 
@@ -127,11 +133,6 @@ void FreeBox64Context(box64context_t** context)
 
     CleanStackSize(ctx);
 
-#ifndef BUILD_LIB
-    if(ctx->box64lib)
-        dlclose(ctx->box64lib);
-#endif
-
     //FreeDLPrivate(&ctx->dlprivate);
 
     free(ctx->stack);
@@ -139,6 +140,8 @@ void FreeBox64Context(box64context_t** context)
     free(ctx->fullpath);
     free(ctx->box64path);
 
+    FreeBridge(&ctx->system);
+
     void* ptr;
     if ((ptr = pthread_getspecific(ctx->tlskey)) != NULL) {
         free_tlsdatasize(ptr);