diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-02 17:55:55 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-02 17:55:55 +0100 |
| commit | b4851d8dd52dba587e55818b2e20b15f8624e955 (patch) | |
| tree | 799db5bcbe4d71e8ee91d1e6f2445b7ccae78fe4 /src/box64context.c | |
| parent | 8b56536bb1e38cfa83346544ec62e2e2003dd071 (diff) | |
| download | box64-b4851d8dd52dba587e55818b2e20b15f8624e955.tar.gz box64-b4851d8dd52dba587e55818b2e20b15f8624e955.zip | |
Added bridge handling
Diffstat (limited to 'src/box64context.c')
| -rwxr-xr-x | src/box64context.c | 13 |
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); |