Module: wine Branch: master Commit: 468fbf5907f690c4df3e60a1794d2f7ce0eade13 URL: https://gitlab.winehq.org/wine/wine/-/commit/468fbf5907f690c4df3e60a1794d2f7...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jun 7 10:23:38 2024 +0200
kernelbase: Implement the GetProcAddress wrapper on ARM64EC.
---
dlls/kernelbase/loader.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index e0be2a88d2b..7afbe0460eb 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -430,7 +430,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetModuleHandleExW( DWORD flags, LPCWSTR name, HMO * GetProcAddress (kernelbase.@) */
-#ifdef __x86_64__ /* * Work around a Delphi bug on x86_64. When delay loading a symbol, * Delphi saves rcx, rdx, r8 and r9 to the stack. It then calls @@ -440,6 +439,23 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetModuleHandleExW( DWORD flags, LPCWSTR name, HMO * these registers if the function takes floating point parameters. * This wrapper saves xmm0 - 3 to the stack. */ +#ifdef __arm64ec__ +FARPROC WINAPI __attribute__((naked)) GetProcAddress( HMODULE module, LPCSTR function ) +{ + asm( ".seh_proc "#GetProcAddress"\n\t" + "stp x29, x30, [sp, #-48]!\n\t" + ".seh_save_fplr_x 48\n\t" + ".seh_endprologue\n\t" + "stp d0, d1, [sp, #16]\n\t" + "stp d2, d3, [sp, #32]\n\t" + "bl "#get_proc_address"\n\t" + "ldp d0, d1, [sp, #16]\n\t" + "ldp d2, d3, [sp, #32]\n\t" + "ldp x29, x30, [sp], #48\n\t" + "ret\n\t" + ".seh_endproc" ); +} +#elif defined(__x86_64__) __ASM_GLOBAL_FUNC( GetProcAddress, ".byte 0x48\n\t" /* hotpatch prolog */ "pushq %rbp\n\t"