Skip to content

Commit

Permalink
[WRAPPER] Reworked libudev1 wrapping with new wrapperhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Oct 3, 2024
1 parent 8b8e650 commit 61c4699
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/wrapped/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@
#() pFLLp
#() pFLpi
#() pFLpp
#() pFpcU
#() pFpii
#() pFpiu
#() pFpid
Expand All @@ -757,7 +758,6 @@
#() pFpip
#() pFpiS
#() pFpCi
#() pFpCu
#() pFpWi
#() pFpWW
#() pFpWp
Expand Down
7 changes: 3 additions & 4 deletions src/wrapped/generated/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ typedef void* (*pFLup_t)(uintptr_t, uint32_t, void*);
typedef void* (*pFLLp_t)(uintptr_t, uintptr_t, void*);
typedef void* (*pFLpi_t)(uintptr_t, void*, int32_t);
typedef void* (*pFLpp_t)(uintptr_t, void*, void*);
typedef void* (*pFpcU_t)(void*, int8_t, uint64_t);
typedef void* (*pFpii_t)(void*, int32_t, int32_t);
typedef void* (*pFpiu_t)(void*, int32_t, uint32_t);
typedef void* (*pFpid_t)(void*, int32_t, double);
Expand All @@ -788,7 +789,6 @@ typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t);
typedef void* (*pFpip_t)(void*, int32_t, void*);
typedef void* (*pFpiS_t)(void*, int32_t, void*);
typedef void* (*pFpCi_t)(void*, uint8_t, int32_t);
typedef void* (*pFpCu_t)(void*, uint8_t, uint32_t);
typedef void* (*pFpWi_t)(void*, uint16_t, int32_t);
typedef void* (*pFpWW_t)(void*, uint16_t, uint16_t);
typedef void* (*pFpWp_t)(void*, uint16_t, void*);
Expand Down Expand Up @@ -4014,6 +4014,7 @@ void pFLup(x64emu_t *emu, uintptr_t fcn) { pFLup_t fn = (pFLup_t)fcn; R_RAX=(uin
void pFLLp(x64emu_t *emu, uintptr_t fcn) { pFLLp_t fn = (pFLLp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); }
void pFLpi(x64emu_t *emu, uintptr_t fcn) { pFLpi_t fn = (pFLpi_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); }
void pFLpp(x64emu_t *emu, uintptr_t fcn) { pFLpp_t fn = (pFLpp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); }
void pFpcU(x64emu_t *emu, uintptr_t fcn) { pFpcU_t fn = (pFpcU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int8_t)R_RSI, (uint64_t)R_RDX); }
void pFpii(x64emu_t *emu, uintptr_t fcn) { pFpii_t fn = (pFpii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); }
void pFpiu(x64emu_t *emu, uintptr_t fcn) { pFpiu_t fn = (pFpiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); }
void pFpid(x64emu_t *emu, uintptr_t fcn) { pFpid_t fn = (pFpid_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); }
Expand All @@ -4022,7 +4023,6 @@ void pFpiL(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_RAX=(uin
void pFpip(x64emu_t *emu, uintptr_t fcn) { pFpip_t fn = (pFpip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); }
void pFpiS(x64emu_t *emu, uintptr_t fcn) { pFpiS_t fn = (pFpiS_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, io_convert((void*)R_RDX)); }
void pFpCi(x64emu_t *emu, uintptr_t fcn) { pFpCi_t fn = (pFpCi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); }
void pFpCu(x64emu_t *emu, uintptr_t fcn) { pFpCu_t fn = (pFpCu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX); }
void pFpWi(x64emu_t *emu, uintptr_t fcn) { pFpWi_t fn = (pFpWi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX); }
void pFpWW(x64emu_t *emu, uintptr_t fcn) { pFpWW_t fn = (pFpWW_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); }
void pFpWp(x64emu_t *emu, uintptr_t fcn) { pFpWp_t fn = (pFpWp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); }
Expand Down Expand Up @@ -7117,14 +7117,14 @@ int isSimpleWrapper(wrapper_t fun) {
if (fun == &pFLLp) return 1;
if (fun == &pFLpi) return 1;
if (fun == &pFLpp) return 1;
if (fun == &pFpcU) return 1;
if (fun == &pFpii) return 1;
if (fun == &pFpiu) return 1;
if (fun == &pFpid) return 2;
if (fun == &pFpil) return 1;
if (fun == &pFpiL) return 1;
if (fun == &pFpip) return 1;
if (fun == &pFpCi) return 1;
if (fun == &pFpCu) return 1;
if (fun == &pFpWi) return 1;
if (fun == &pFpWW) return 1;
if (fun == &pFpWp) return 1;
Expand Down Expand Up @@ -8703,7 +8703,6 @@ int isSimpleWrapper(wrapper_t fun) {
if (fun == &pFLup) return 1;
if (fun == &pFLLp) return 1;
if (fun == &pFLpp) return 1;
if (fun == &pFpCu) return 1;
if (fun == &pFpWW) return 1;
if (fun == &pFpWp) return 1;
if (fun == &pFpuu) return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped/generated/wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ void pFLup(x64emu_t *emu, uintptr_t fnc);
void pFLLp(x64emu_t *emu, uintptr_t fnc);
void pFLpi(x64emu_t *emu, uintptr_t fnc);
void pFLpp(x64emu_t *emu, uintptr_t fnc);
void pFpcU(x64emu_t *emu, uintptr_t fnc);
void pFpii(x64emu_t *emu, uintptr_t fnc);
void pFpiu(x64emu_t *emu, uintptr_t fnc);
void pFpid(x64emu_t *emu, uintptr_t fnc);
Expand All @@ -794,7 +795,6 @@ void pFpiL(x64emu_t *emu, uintptr_t fnc);
void pFpip(x64emu_t *emu, uintptr_t fnc);
void pFpiS(x64emu_t *emu, uintptr_t fnc);
void pFpCi(x64emu_t *emu, uintptr_t fnc);
void pFpCu(x64emu_t *emu, uintptr_t fnc);
void pFpWi(x64emu_t *emu, uintptr_t fnc);
void pFpWW(x64emu_t *emu, uintptr_t fnc);
void pFpWp(x64emu_t *emu, uintptr_t fnc);
Expand Down
10 changes: 5 additions & 5 deletions src/wrapped/wrappedudev1_private.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
#error Meh....
#error Meh...
#endif

GO(udev_device_ref, pFp)
GO(udev_device_unref, pFp)
GO(udev_device_get_udev, pFp)
GO(udev_device_new_from_syspath, pFpp)
GO(udev_device_new_from_devnum, pFpCu)
GO(udev_device_new_from_devnum, pFpcU)
GO(udev_device_new_from_subsystem_sysname, pFppp)
GO(udev_device_new_from_environment, pFp)
GO(udev_device_get_parent, pFp)
Expand All @@ -24,7 +24,7 @@ GO(udev_device_get_properties_list_entry, pFp)
GO(udev_device_get_tags_list_entry, pFp)
GO(udev_device_get_property_value, pFpp)
GO(udev_device_get_driver, pFp)
GO(udev_device_get_devnum, uFp)
GO(udev_device_get_devnum, UFp)
GO(udev_device_get_action, pFp)
GO(udev_device_get_sysattr_value, pFpp)
GO(udev_device_get_sysattr_list_entry, pFp)
Expand Down Expand Up @@ -69,7 +69,7 @@ GO(udev_new, pFv)
GO(udev_ref, pFp)
GO(udev_unref, pFp)
GO(udev_queue_ref, pFp)
GO(udev_queue_unref, vFp)
GO(udev_queue_unref, pFp)
GO(udev_queue_get_udev, pFp)
GO(udev_queue_new, pFp)
GO(udev_queue_get_kernel_seqnum, UFp)
Expand All @@ -93,4 +93,4 @@ GO(udev_hwdb_ref, pFp)
GO(udev_hwdb_unref, pFp)
GO(udev_hwdb_new, pFp)
GO(udev_hwdb_get_properties_list_entry, pFppu)
GO(udev_util_encode_string, iFppL)
GO(udev_util_encode_string, iFppL)

0 comments on commit 61c4699

Please sign in to comment.