about summary refs log tree commit diff stats
path: root/src/emu/x64syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/x64syscall.c')
-rw-r--r--src/emu/x64syscall.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c
index 4a82f9a1..4f9d6c88 100644
--- a/src/emu/x64syscall.c
+++ b/src/emu/x64syscall.c
@@ -77,7 +77,7 @@ typedef struct scwrap_s {
     int nbpars;
 } scwrap_t;
 
-scwrap_t syscallwrap[] = {
+static scwrap_t syscallwrap[] = {
     //{ 0, __NR_read, 3 },      // wrapped so SA_RESTART can be handled by libc
     //{ 1, __NR_write, 3 },     // same
     //{ 2, __NR_open, 3 },      // flags need transformation
@@ -198,6 +198,7 @@ scwrap_t syscallwrap[] = {
     { 208, __NR_io_getevents, 4},
     { 209, __NR_io_submit, 3},
     { 210, __NR_io_cancel, 3},
+    { 212, __NR_lookup_dcookie, 3},
     #ifdef __NR_epoll_create
     { 213, __NR_epoll_create, 1},
     #endif
@@ -215,6 +216,8 @@ scwrap_t syscallwrap[] = {
     { 233, __NR_epoll_ctl, 4},
     #endif
     { 234, __NR_tgkill, 3},
+    { 238, __NR_set_mempolicy, 3},
+    { 239, __NR_get_mempolicy, 5},
     { 247, __NR_waitid, 5},
     #ifdef __NR_inotify_init
     { 253, __NR_inotify_init, 0},   //0xFD
@@ -557,8 +560,8 @@ void EXPORT x64Syscall(x64emu_t *emu)
                         }
                     }
                     x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RSI)?0:1);
-                    SetupX64Emu(newemu);
-                    CloneEmu(newemu, emu);
+                    SetupX64Emu(newemu, emu);
+                    //CloneEmu(newemu, emu);
                     Push64(newemu, 0);
                     PushExit(newemu);
                     void* mystack = NULL;
@@ -749,7 +752,7 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
 {
     static uint32_t warned = 0;
     uint32_t s = R_EDI;
-    printf_dump(LOG_DEBUG, "%p: Calling libc syscall 0x%02X (%d) %p %p %p %p %p\n", (void*)R_RIP, s, s, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); 
+    printf_dump(LOG_DEBUG, "%04d| %p: Calling libc syscall 0x%02X (%d) %p %p %p %p %p\n", GetTID(), (void*)R_RIP, s, s, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); 
     // check wrapper first
     int cnt = sizeof(syscallwrap) / sizeof(scwrap_t);
     for (int i=0; i<cnt; i++) {
@@ -858,8 +861,8 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
                     }
                 }
                 x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RDX)?0:1);
-                SetupX64Emu(newemu);
-                CloneEmu(newemu, emu);
+                SetupX64Emu(newemu, emu);
+                //CloneEmu(newemu, emu);
                 Push64(newemu, 0);
                 PushExit(newemu);
                 void* mystack = NULL;