about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-09 09:26:07 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-09 09:26:07 +0100
commitcdd33ffec4ce977b77aa3b915c48419da827b44c (patch)
tree2d4b4543e2d472106436948c6b1d1f2de4a247b1
parent340bdb0b6c67ee0960f604767a8fa8e81326f92d (diff)
downloadbox64-cdd33ffec4ce977b77aa3b915c48419da827b44c.tar.gz
box64-cdd33ffec4ce977b77aa3b915c48419da827b44c.zip
Added some phtreads wrapped functions
-rw-r--r--src/wrapped/generated/functions_list.txt1
-rw-r--r--src/wrapped/generated/wrapper.c2
-rw-r--r--src/wrapped/generated/wrapper.h1
-rwxr-xr-xsrc/wrapped/wrappedlibpthread_private.h40
4 files changed, 24 insertions, 20 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index ecd14c0d..05ea550d 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -254,6 +254,7 @@
 #() pFppu
 #() pFppL
 #() pFppp
+#() pFpOM
 #() vFEipV
 #() vFEpip
 #() vFEpup
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index 2ad6f607..f0e82962 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -287,6 +287,7 @@ typedef void* (*pFppi_t)(void*, void*, int32_t);
 typedef void* (*pFppu_t)(void*, void*, uint32_t);
 typedef void* (*pFppL_t)(void*, void*, uintptr_t);
 typedef void* (*pFppp_t)(void*, void*, void*);
+typedef void* (*pFpOM_t)(void*, int32_t, ...);
 typedef void (*vFEipV_t)(x64emu_t*, int32_t, void*, void*);
 typedef void (*vFEpip_t)(x64emu_t*, void*, int32_t, void*);
 typedef void (*vFEpup_t)(x64emu_t*, void*, uint32_t, void*);
@@ -1118,6 +1119,7 @@ void pFppi(x64emu_t *emu, uintptr_t fcn) { pFppi_t fn = (pFppi_t)fcn; R_RAX=(uin
 void pFppu(x64emu_t *emu, uintptr_t fcn) { pFppu_t fn = (pFppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); }
 void pFppL(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); }
 void pFppp(x64emu_t *emu, uintptr_t fcn) { pFppp_t fn = (pFppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); }
+void pFpOM(x64emu_t *emu, uintptr_t fcn) { pFpOM_t fn = (pFpOM_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, of_convert((int32_t)R_RSI), (void*)R_RDX, (void*)R_RCX); }
 void vFEipV(x64emu_t *emu, uintptr_t fcn) { vFEipV_t fn = (vFEipV_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); }
 void vFEpip(x64emu_t *emu, uintptr_t fcn) { vFEpip_t fn = (vFEpip_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); }
 void vFEpup(x64emu_t *emu, uintptr_t fcn) { vFEpup_t fn = (vFEpup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index 80b6b89a..3825f939 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -284,6 +284,7 @@ void pFppi(x64emu_t *emu, uintptr_t fnc);
 void pFppu(x64emu_t *emu, uintptr_t fnc);
 void pFppL(x64emu_t *emu, uintptr_t fnc);
 void pFppp(x64emu_t *emu, uintptr_t fnc);
+void pFpOM(x64emu_t *emu, uintptr_t fnc);
 void vFEipV(x64emu_t *emu, uintptr_t fnc);
 void vFEpip(x64emu_t *emu, uintptr_t fnc);
 void vFEpup(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h
index d0a1148b..68cd47d4 100755
--- a/src/wrapped/wrappedlibpthread_private.h
+++ b/src/wrapped/wrappedlibpthread_private.h
@@ -146,18 +146,18 @@ GO(pthread_self, LFv)
 //GO(pthread_setconcurrency, iFi)
 //GOM(pthread_setname_np, iFEpp)   // not present on the Pandora
 //GO(pthread_setschedparam, iFuip)
-//GO(pthread_setschedprio, iFpi)
+GO(pthread_setschedprio, iFpi)
 GO(__pthread_setspecific, iFLp)
 GO(pthread_setspecific, iFLp)
-//GO(pthread_sigmask, iFipp)
-//GO(pthread_spin_destroy, iFp)
-//GO(pthread_spin_init, iFpi)
-//GO(pthread_spin_lock, iFp)
-//GO(pthread_spin_trylock, iFp)
-//GO(pthread_spin_unlock, iFp)
-//GO(pthread_testcancel, vFv)
-//GO(pthread_timedjoin_np, iFppp)
-//GO(pthread_tryjoin_np, iFpp)
+GO(pthread_sigmask, iFipp)
+GO(pthread_spin_destroy, iFp)
+GO(pthread_spin_init, iFpi)
+GO(pthread_spin_lock, iFp)
+GO(pthread_spin_trylock, iFp)
+GO(pthread_spin_unlock, iFp)
+GO(pthread_testcancel, vFv)
+GO(pthread_timedjoin_np, iFppp)
+GO(pthread_tryjoin_np, iFpp)
 GOM(__pthread_unregister_cancel, vFEp)
 // __pthread_unregister_cancel_restore
 // __pthread_unwind
@@ -165,16 +165,16 @@ GOM(__pthread_unwind_next, vFEp)
 GO(pthread_yield, iFv)
 // raise
 // __res_state
-//GO(sem_close, iFp)
-//GO(sem_destroy, iFp)
-//GO(sem_getvalue, iFpp)
-//GO(sem_init, iFpiu)
-//GO(sem_open, pFpiuuuuuuu)    // use a vararg at 3rd arg, so putting lots of args to be sure, even if only 2 are needed
-//GO(sem_post, iFp)
-//GO(sem_timedwait, iFpp)
-//GO(sem_trywait, iFp)
-//GO(sem_unlink, iFp)
-//GO(sem_wait, iFp)
+GO(sem_close, iFp)
+GO(sem_destroy, iFp)
+GO(sem_getvalue, iFpp)
+GO(sem_init, iFpiu)
+GO(sem_open, pFpOM)
+GO(sem_post, iFp)
+GO(sem_timedwait, iFpp)
+GO(sem_trywait, iFp)
+GO(sem_unlink, iFp)
+GO(sem_wait, iFp)
 // __sigaction
 // system
 // __vfork