ntdll: Fix stack alignment in relay calls on ARM.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-11-27 16:15:05 +01:00
parent 55fd7667d3
commit 74b50e27e1

View file

@ -469,30 +469,21 @@ __ASM_GLOBAL_FUNC( call_entry_point,
"mov r4, r0\n\t" "mov r4, r0\n\t"
"mov r5, SP\n\t" "mov r5, SP\n\t"
"lsl r3, r1, #2\n\t" "lsl r3, r1, #2\n\t"
"cmp r3, #0\n\t"
"beq 5f\n\t"
"sub SP, SP, r3\n\t" "sub SP, SP, r3\n\t"
"tst r1, #1\n\t" "and SP, SP, #~7\n"
"subeq SP, SP, #4\n\t"
"1:\tsub r3, r3, #4\n\t" "1:\tsub r3, r3, #4\n\t"
"ldr r0, [r2, r3]\n\t" "ldr r0, [r2, r3]\n\t"
"str r0, [SP, r3]\n\t" "str r0, [SP, r3]\n\t"
"cmp r3, #0\n\t" "cmp r3, #0\n\t"
"bgt 1b\n\t" "bgt 1b\n\t"
"cmp r1, #1\n\t" "cmp r1, #0\n\t"
"beq 3f\n\t"
"cmp r1, #2\n\t"
"bgt 2f\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" "pop {r0-r1}\n\t"
"b 5f\n\t" "b 3f\n"
"3:\tcmp r1, #3\n\t" "2:\tpop {r0-r3}\n"
"bgt 4f\n\t" "3:\tblx r4\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" "mov SP, r5\n\t"
"pop {r4, r5, PC}" ) "pop {r4, r5, PC}" )