about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorLeslie Zhai <zhaixiang@loongson.cn>2025-08-05 18:01:52 +0800
committerGitHub <noreply@github.com>2025-08-05 12:01:52 +0200
commit7e5598d0dbb38e8eb451032fe9bc19ceba0c84aa (patch)
treee06046c38431227b46c82242dc79b61b3e58df2f /src
parent9d5b2f3cc54806f7f188c541e47b73f76920824d (diff)
downloadbox64-7e5598d0dbb38e8eb451032fe9bc19ceba0c84aa.tar.gz
box64-7e5598d0dbb38e8eb451032fe9bc19ceba0c84aa.zip
[WRAPPER] Wrapped g_async_queue_new_full, g_async_queue_push_sorted, (#2899)
g_thread_pool_free, g_thread_pool_new and g_thread_pool_push
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64printer.c2
-rw-r--r--src/wrapped/generated/functions_list.txt5
-rw-r--r--src/wrapped/generated/wrappedglib2types.h4
-rw-r--r--src/wrapped/generated/wrapper.c2
-rw-r--r--src/wrapped/generated/wrapper.h1
-rw-r--r--src/wrapped/wrappedglib2.c15
-rw-r--r--src/wrapped/wrappedglib2_private.h10
7 files changed, 34 insertions, 5 deletions
diff --git a/src/emu/x64printer.c b/src/emu/x64printer.c
index d8b12860..fe00c2d7 100644
--- a/src/emu/x64printer.c
+++ b/src/emu/x64printer.c
@@ -4479,6 +4479,8 @@ void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int ti
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8);
     } else if (w == pFEpuppp) {
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8);
+    } else if (w == pFEppiip) {
+        snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8);
     } else if (w == pFEppupi) {
         snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8);
     } else if (w == pFEppLLp) {
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 363754c2..c073df1b 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -2454,6 +2454,7 @@
 #() pFEpuupp
 #() pFEpuppp
 #() pFEpLLiN
+#() pFEppiip
 #() pFEppupi
 #() pFEppLLp
 #() pFEpppLp
@@ -3921,6 +3922,7 @@ wrappedglib2:
 - vFp:
   - g_atexit
 - pFp:
+  - g_async_queue_new_full
   - g_completion_new
   - g_main_context_get_poll_func
   - g_private_new
@@ -4031,6 +4033,7 @@ wrappedglib2:
 - vFpupp:
   - g_datalist_id_set_data_full
 - vFpppp:
+  - g_async_queue_push_sorted
   - g_queue_insert_sorted
   - g_source_set_callback
 - iFpLpV:
@@ -4071,6 +4074,8 @@ wrappedglib2:
 - uFiuppp:
   - g_timeout_add_full
   - g_timeout_add_seconds_full
+- pFppiip:
+  - g_thread_pool_new
 - pFppppp:
   - g_option_group_new
 - vFpuuipp:
diff --git a/src/wrapped/generated/wrappedglib2types.h b/src/wrapped/generated/wrappedglib2types.h
index 07b528de..a11f3783 100644
--- a/src/wrapped/generated/wrappedglib2types.h
+++ b/src/wrapped/generated/wrappedglib2types.h
@@ -54,6 +54,7 @@ typedef void (*vFpiLpp_t)(void*, int32_t, uintptr_t, void*, void*);
 typedef void (*vFpuipV_t)(void*, uint32_t, int32_t, void*, ...);
 typedef uint32_t (*uFiippp_t)(int32_t, int32_t, void*, void*, void*);
 typedef uint32_t (*uFiuppp_t)(int32_t, uint32_t, void*, void*, void*);
+typedef void* (*pFppiip_t)(void*, void*, int32_t, int32_t, void*);
 typedef void* (*pFppppp_t)(void*, void*, void*, void*, void*);
 typedef void (*vFpuuipp_t)(void*, uint32_t, uint32_t, int32_t, void*, void*);
 typedef int32_t (*iFpupppp_t)(void*, uint32_t, void*, void*, void*, void*);
@@ -66,6 +67,7 @@ typedef int32_t (*iFpppuppppppp_t)(void*, void*, void*, uint32_t, void*, void*,
 
 #define SUPER() ADDED_FUNCTIONS() \
 	GO(g_atexit, vFp_t) \
+	GO(g_async_queue_new_full, pFp_t) \
 	GO(g_completion_new, pFp_t) \
 	GO(g_main_context_get_poll_func, pFp_t) \
 	GO(g_private_new, pFp_t) \
@@ -150,6 +152,7 @@ typedef int32_t (*iFpppuppppppp_t)(void*, void*, void*, uint32_t, void*, void*,
 	GO(g_log, vFpipV_t) \
 	GO(g_logv, vFpipA_t) \
 	GO(g_datalist_id_set_data_full, vFpupp_t) \
+	GO(g_async_queue_push_sorted, vFpppp_t) \
 	GO(g_queue_insert_sorted, vFpppp_t) \
 	GO(g_source_set_callback, vFpppp_t) \
 	GO(g_snprintf, iFpLpV_t) \
@@ -175,6 +178,7 @@ typedef int32_t (*iFpppuppppppp_t)(void*, void*, void*, uint32_t, void*, void*,
 	GO(g_child_watch_add_full, uFiippp_t) \
 	GO(g_timeout_add_full, uFiuppp_t) \
 	GO(g_timeout_add_seconds_full, uFiuppp_t) \
+	GO(g_thread_pool_new, pFppiip_t) \
 	GO(g_option_group_new, pFppppp_t) \
 	GO(g_node_traverse, vFpuuipp_t) \
 	GO(g_datalist_id_replace_data, iFpupppp_t) \
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index 19885227..3bb6c7d9 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -2481,6 +2481,7 @@ typedef void* (*pFEpuipp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*);
 typedef void* (*pFEpuupp_t)(x64emu_t*, void*, uint32_t, uint32_t, void*, void*);
 typedef void* (*pFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*);
 typedef void* (*pFEpLLiN_t)(x64emu_t*, void*, uintptr_t, uintptr_t, int32_t, ...);
+typedef void* (*pFEppiip_t)(x64emu_t*, void*, void*, int32_t, int32_t, void*);
 typedef void* (*pFEppupi_t)(x64emu_t*, void*, void*, uint32_t, void*, int32_t);
 typedef void* (*pFEppLLp_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, void*);
 typedef void* (*pFEpppLp_t)(x64emu_t*, void*, void*, void*, uintptr_t, void*);
@@ -6020,6 +6021,7 @@ void pFEpuipp(x64emu_t *emu, uintptr_t fcn) { pFEpuipp_t fn = (pFEpuipp_t)fcn; R
 void pFEpuupp(x64emu_t *emu, uintptr_t fcn) { pFEpuupp_t fn = (pFEpuupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); }
 void pFEpuppp(x64emu_t *emu, uintptr_t fcn) { pFEpuppp_t fn = (pFEpuppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); }
 void pFEpLLiN(x64emu_t *emu, uintptr_t fcn) { pFEpLLiN_t fn = (pFEpLLiN_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); }
+void pFEppiip(x64emu_t *emu, uintptr_t fcn) { pFEppiip_t fn = (pFEppiip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); }
 void pFEppupi(x64emu_t *emu, uintptr_t fcn) { pFEppupi_t fn = (pFEppupi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); }
 void pFEppLLp(x64emu_t *emu, uintptr_t fcn) { pFEppLLp_t fn = (pFEppLLp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); }
 void pFEpppLp(x64emu_t *emu, uintptr_t fcn) { pFEpppLp_t fn = (pFEpppLp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index 2425de36..6446d207 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -2491,6 +2491,7 @@ void pFEpuipp(x64emu_t *emu, uintptr_t fnc);
 void pFEpuupp(x64emu_t *emu, uintptr_t fnc);
 void pFEpuppp(x64emu_t *emu, uintptr_t fnc);
 void pFEpLLiN(x64emu_t *emu, uintptr_t fnc);
+void pFEppiip(x64emu_t *emu, uintptr_t fnc);
 void pFEppupi(x64emu_t *emu, uintptr_t fnc);
 void pFEppLLp(x64emu_t *emu, uintptr_t fnc);
 void pFEpppLp(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped/wrappedglib2.c b/src/wrapped/wrappedglib2.c
index d4f30fcf..875c33da 100644
--- a/src/wrapped/wrappedglib2.c
+++ b/src/wrapped/wrappedglib2.c
@@ -1541,6 +1541,21 @@ EXPORT void my_g_queue_insert_sorted(x64emu_t* emu, void* queue, void* data, voi
     my->g_queue_insert_sorted(queue, data, findGCompareDataFuncFct(f), user_data);
 }
 
+EXPORT void* my_g_async_queue_new_full(x64emu_t* emu, void* item_free_func)
+{
+    return my->g_async_queue_new_full(findGDestroyNotifyFct(item_free_func));
+}
+
+EXPORT void* my_g_thread_pool_new(x64emu_t* emu, void* func, void* user_data, int32_t max_threads, int32_t exclusive, void* error)
+{
+    return my->g_thread_pool_new(findGFuncFct(func), user_data, max_threads, exclusive, error);
+}
+
+EXPORT void my_g_async_queue_push_sorted(x64emu_t* emu, void* queue, void* data, void* func, void* user_data)
+{
+    my->g_async_queue_push_sorted(queue, data, findGCompareDataFuncFct(func), user_data);
+}
+
 #define PRE_INIT    \
     if(BOX64ENV(nogtk)) \
         return -1;
diff --git a/src/wrapped/wrappedglib2_private.h b/src/wrapped/wrappedglib2_private.h
index bc0e86bb..ec0f342e 100644
--- a/src/wrapped/wrappedglib2_private.h
+++ b/src/wrapped/wrappedglib2_private.h
@@ -47,11 +47,11 @@ GO(g_async_queue_length, iFp)
 GO(g_async_queue_length_unlocked, iFp)
 GO(g_async_queue_lock, vFp)
 GO(g_async_queue_new, pFv)
-//GOM(g_async_queue_new_full, pFp)
+GOM(g_async_queue_new_full, pFEp)
 GO(g_async_queue_pop, pFp)
 GO(g_async_queue_pop_unlocked, pFp)
 GO(g_async_queue_push, vFpp)
-//GOM(g_async_queue_push_sorted, vFpppp)
+GOM(g_async_queue_push_sorted, vFEpppp)
 //GOM(g_async_queue_push_sorted_unlocked, vFpppp)
 GO(g_async_queue_push_unlocked, vFpp)
 GO(g_async_queue_ref, pFp)
@@ -1278,14 +1278,14 @@ GO(g_thread_get_initialized, iFv)
 //GO(g_thread_init_glib, 
 GO(g_thread_join, pFp)
 GOM(g_thread_new, pFEppp)
-//GOM(g_thread_pool_free, vFpii)
+GO(g_thread_pool_free, vFpii)
 GO(g_thread_pool_get_max_idle_time, uFv)
 //GOM(g_thread_pool_get_max_threads, iFp)
 GO(g_thread_pool_get_max_unused_threads, iFv)
 //GOM(g_thread_pool_get_num_threads, uFp)
 GO(g_thread_pool_get_num_unused_threads, uFv)
-//GOM(g_thread_pool_new, pFppiip)
-//GOM(g_thread_pool_push, iFppp)
+GOM(g_thread_pool_new, pFEppiip)
+GO(g_thread_pool_push, iFppp)
 GO(g_thread_pool_set_max_idle_time, vFu)
 //GOM(g_thread_pool_set_max_threads, iFpip)
 GO(g_thread_pool_set_max_unused_threads, vFi)