about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-03-04 14:11:42 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-03-04 14:11:42 +0100
commit1bf4851cf6f3a97098d9e9ce9f51b4815eb7fd89 (patch)
tree8c35c9ae4af8a3aed884b4c09bbc98593747ed37 /src
parent2129e98b0e1ad3bc4f50698c61ca557146d26b5d (diff)
downloadbox64-1bf4851cf6f3a97098d9e9ce9f51b4815eb7fd89.tar.gz
box64-1bf4851cf6f3a97098d9e9ce9f51b4815eb7fd89.zip
[WRAPPER] Added epoll_pwait2 wrapped function
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64printer.c4
-rw-r--r--src/wrapped/generated/functions_list.txt4
-rw-r--r--src/wrapped/generated/wrappedlibctypes.h2
-rw-r--r--src/wrapped/generated/wrapper.c6
-rw-r--r--src/wrapped/generated/wrapper.h2
-rw-r--r--src/wrapped/wrappedlibc.c9
-rw-r--r--src/wrapped/wrappedlibc_private.h2
7 files changed, 29 insertions, 0 deletions
diff --git a/src/emu/x64printer.c b/src/emu/x64printer.c
index 18948ea8..b815db74 100644
--- a/src/emu/x64printer.c
+++ b/src/emu/x64printer.c
@@ -6406,6 +6406,8 @@ void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int ti
 #if defined(NOALIGN)
     } else if (w == iFipiip) {
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8);
+    } else if (w == iFipipp) {
+        snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8);
 #endif
 #if !defined(NOALIGN)
     } else if (w == iFELp) {
@@ -6418,6 +6420,8 @@ void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int ti
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX);
     } else if (w == iFEipiip) {
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8);
+    } else if (w == iFEipipp) {
+        snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8);
 #endif
 #if !defined(STATICBUILD)
     } else if (w == iFlip) {
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 5883e4c2..a18ca02d 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -3400,11 +3400,13 @@
 #() pFpupuupppppppppppppppppppp
 #() iFpppppppppppppppppppppppppppppppppp
 #defined(NOALIGN) iFipiip
+#defined(NOALIGN) iFipipp
 #!defined(NOALIGN) iFELp
 #!defined(NOALIGN) iFEppu
 #!defined(NOALIGN) iFEiiip
 #!defined(NOALIGN) iFEipii
 #!defined(NOALIGN) iFEipiip
+#!defined(NOALIGN) iFEipipp
 #!defined(STATICBUILD) lFiN
 #!defined(STATICBUILD) iFlip
 #!defined(STATICBUILD) iFLLi
@@ -4722,6 +4724,8 @@ wrappedlibc:
   - epoll_pwait
 - iFipiup:
   - statx
+- iFipipp:
+  - epoll_pwait2
 - iFipppp:
   - getopt_long
   - getopt_long_only
diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h
index 0eb6cd89..6fe99f0e 100644
--- a/src/wrapped/generated/wrappedlibctypes.h
+++ b/src/wrapped/generated/wrappedlibctypes.h
@@ -94,6 +94,7 @@ typedef int32_t (*iFiippi_t)(int32_t, int32_t, void*, void*, int32_t);
 typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
 typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*);
 typedef int32_t (*iFipiup_t)(int32_t, void*, int32_t, uint32_t, void*);
+typedef int32_t (*iFipipp_t)(int32_t, void*, int32_t, void*, void*);
 typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*);
 typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*);
 typedef int32_t (*iFpilpV_t)(void*, int32_t, intptr_t, void*, ...);
@@ -316,6 +317,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
 	GO(prctl, iFiLLLL_t) \
 	GO(epoll_pwait, iFipiip_t) \
 	GO(statx, iFipiup_t) \
+	GO(epoll_pwait2, iFipipp_t) \
 	GO(getopt_long, iFipppp_t) \
 	GO(getopt_long_only, iFipppp_t) \
 	GO(scandirat, iFipppp_t) \
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index 2ac88587..4df66630 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -3481,6 +3481,7 @@ typedef void (*vFppippDpDc_t)(void*, void*, int32_t, void*, void*, double, void*
 
 #if defined(NOALIGN)
 typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*);
+typedef int32_t (*iFipipp_t)(int32_t, void*, int32_t, void*, void*);
 #endif
 
 #if !defined(NOALIGN)
@@ -3489,6 +3490,7 @@ typedef int32_t (*iFEppu_t)(x64emu_t*, void*, void*, uint32_t);
 typedef int32_t (*iFEiiip_t)(x64emu_t*, int32_t, int32_t, int32_t, void*);
 typedef int32_t (*iFEipii_t)(x64emu_t*, int32_t, void*, int32_t, int32_t);
 typedef int32_t (*iFEipiip_t)(x64emu_t*, int32_t, void*, int32_t, int32_t, void*);
+typedef int32_t (*iFEipipp_t)(x64emu_t*, int32_t, void*, int32_t, void*, void*);
 #endif
 
 #if !defined(STATICBUILD)
@@ -6960,6 +6962,7 @@ void vFppippDpDc(x64emu_t *emu, uintptr_t fcn) { vFppippDpDc_t fn = (vFppippDpDc
 
 #if defined(NOALIGN)
 void iFipiip(x64emu_t *emu, uintptr_t fcn) { iFipiip_t fn = (iFipiip_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); }
+void iFipipp(x64emu_t *emu, uintptr_t fcn) { iFipipp_t fn = (iFipipp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); }
 #endif
 
 #if !defined(NOALIGN)
@@ -6968,6 +6971,7 @@ void iFEppu(x64emu_t *emu, uintptr_t fcn) { iFEppu_t fn = (iFEppu_t)fcn; R_RAX=(
 void iFEiiip(x64emu_t *emu, uintptr_t fcn) { iFEiiip_t fn = (iFEiiip_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); }
 void iFEipii(x64emu_t *emu, uintptr_t fcn) { iFEipii_t fn = (iFEipii_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); }
 void iFEipiip(x64emu_t *emu, uintptr_t fcn) { iFEipiip_t fn = (iFEipiip_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); }
+void iFEipipp(x64emu_t *emu, uintptr_t fcn) { iFEipipp_t fn = (iFEipipp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); }
 #endif
 
 #if !defined(STATICBUILD)
@@ -8999,6 +9003,7 @@ int isSimpleWrapper(wrapper_t fun) {
 	if (fun == &lFpLppdddddd) return 7;
 #if defined(NOALIGN)
 	if (fun == &iFipiip) return 1;
+	if (fun == &iFipipp) return 1;
 #endif
 #if !defined(STATICBUILD)
 	if (fun == &iFlip) return 1;
@@ -11016,6 +11021,7 @@ int isSimpleWrapper(wrapper_t fun) {
 	if (fun == &lFpLppdddddd) return 7;
 #if defined(NOALIGN)
 	if (fun == &iFipiip) return 209;
+	if (fun == &iFipipp) return 81;
 #endif
 #if !defined(STATICBUILD)
 	if (fun == &iFlip) return 33;
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index a02c6ac6..cc730b09 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -3439,6 +3439,7 @@ void iFpppppppppppppppppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc);
 
 #if defined(NOALIGN)
 void iFipiip(x64emu_t *emu, uintptr_t fnc);
+void iFipipp(x64emu_t *emu, uintptr_t fnc);
 #endif
 
 #if !defined(NOALIGN)
@@ -3447,6 +3448,7 @@ void iFEppu(x64emu_t *emu, uintptr_t fnc);
 void iFEiiip(x64emu_t *emu, uintptr_t fnc);
 void iFEipii(x64emu_t *emu, uintptr_t fnc);
 void iFEipiip(x64emu_t *emu, uintptr_t fnc);
+void iFEipipp(x64emu_t *emu, uintptr_t fnc);
 #endif
 
 #if !defined(STATICBUILD)
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 181a8c8b..206254e5 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2199,6 +2199,15 @@ EXPORT int32_t my_epoll_pwait(x64emu_t* emu, int32_t epfd, void* events, int32_t
         UnalignEpollEvent(events, _events, ret);
     return ret;
 }
+EXPORT int my_epoll_pwait2(int epfd, void* events, int maxevents, const struct timespec *timeout, const sigset_t * sigmask)
+{
+    struct epoll_event _events[maxevents];
+    //AlignEpollEvent(_events, events, maxevents);
+    int32_t ret = epoll_pwait2(epfd, events?_events:NULL, maxevents, timeout, sigmask);
+    if(ret>0)
+        UnalignEpollEvent(events, _events, ret);
+    return ret;
+}
 #endif
 
 #ifndef ANDROID
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index 2b05b283..f40ed957 100644
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -300,10 +300,12 @@ GO(epoll_create1, iFO)
 #ifdef NOALIGN
 GO(epoll_ctl, iFiiip)
 GO(epoll_pwait, iFipiip)
+GO(epoll_pwait2, iFipipp)
 GO(epoll_wait, iFipii)
 #else
 GOM(epoll_ctl, iFEiiip)
 GOM(epoll_pwait, iFEipiip)
+GOM(epoll_pwait2, iFEipipp)
 GOM(epoll_wait, iFEipii)
 #endif
 GO(erand48, dFp)