From 1ceec8c78982d7ef5124e86a8da53166473e1f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sun, 15 Jul 2012 16:45:01 +0200 Subject: [PATCH] ntdll: Add support for relay debugging on ARM. --- dlls/ntdll/relay.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index 3588f1c5e09..b3c4aea2b8e 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(relay); -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) WINE_DECLARE_DEBUG_CHANNEL(timestamp); @@ -355,6 +355,37 @@ __ASM_GLOBAL_FUNC( call_entry_point, __ASM_CFI(".cfi_def_cfa %esp,4\n\t") __ASM_CFI(".cfi_same_value %ebp\n\t") "ret" ) +#elif defined(__arm__) +__ASM_GLOBAL_FUNC( call_entry_point, + "push {r4, r5, LR}\n\t" + "mov r4, r0\n\t" + "mov r5, SP\n\t" + "lsl r3, r1, #2\n\t" + "cmp r3, #0\n\t" + "beq 5f\n\t" + "sub SP, SP, r3\n\t" + "bic SP, SP, #15\n\t" + "1:\tsub r3, r3, #4\n\t" + "ldr r0, [r2, r3]\n\t" + "str r0, [SP, r3]\n\t" + "cmp r3, #0\n\t" + "bgt 1b\n\t" + "cmp r1, #1\n\t" + "bgt 2f\n\t" + "pop {r0}\n\t" + "b 5f\n\t" + "2:\tcmp r1, #2\n\t" + "bgt 3f\n\t" + "pop {r0-r1}\n\t" + "b 5f\n\t" + "3:\tcmp r1, #3\n\t" + "bgt 4f\n\t" + "pop {r0-r2}\n\t" + "b 5f\n\t" + "4:\tpop {r0-r3}\n\t" + "5:\tblx r4\n\t" + "mov SP, r5\n\t" + "pop {r4, r5, PC}" ) #else __ASM_GLOBAL_FUNC( call_entry_point, "pushq %rbp\n\t"