diff --git a/libs/wine/port.c b/libs/wine/port.c index 8e8caf87fd5..87e5833a6a9 100644 --- a/libs/wine/port.c +++ b/libs/wine/port.c @@ -156,6 +156,19 @@ __ASM_GLOBAL_FUNC( wine_call_on_stack, "blx r2\n\t" /* call func */ "mov sp, r4\n\t" /* restore old sp from local var */ "pop {r4,PC}") /* fetch return address into pc */ +#elif defined(__aarch64__) && defined(__GNUC__) +__ASM_GLOBAL_FUNC( wine_call_on_stack, + "stp x29, x30, [sp,#-32]!\n\t" /* save return address on stack */ + "str x19, [sp,#16]\n\t" /* save register on stack */ + "mov x19, sp\n\t" /* store old sp in local var */ + "mov sp, x2\n\t" /* stack */ + "mov x2, x0\n\t" /* func -> scratch register */ + "mov x0, x1\n\t" /* arg */ + "blr x2\n\t" /* call func */ + "mov sp, x19\n\t" /* restore old sp from local var */ + "ldr x19, [sp,#16]\n\t" /* restore register from stack */ + "ldp x29, x30, [sp],#32\n\t" /* restore return address */ + "ret") /* return */ #elif defined(__sparc__) && defined(__GNUC__) __ASM_GLOBAL_FUNC( wine_call_on_stack, "save %sp, -96, %sp\n\t" /* push: change register window */