Commit abca25b3 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

ntdll: Adjust PC according to THUMB/ARM flag.

parent 071e7299
...@@ -283,9 +283,12 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, ...@@ -283,9 +283,12 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4,
void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ); void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context );
__ASM_GLOBAL_FUNC( set_cpu_context, __ASM_GLOBAL_FUNC( set_cpu_context,
".arm\n\t" ".arm\n\t"
"ldr r1, [r0, #0x44]\n\t" /* context->Cpsr */ "ldr r2, [r0, #0x44]\n\t" /* context->Cpsr */
"msr CPSR_f, r1\n\t" "tst r2, #0x20\n\t" /* thumb? */
"ldr r1, [r0, #0x40]\n\t" /* context->Pc */ "ldr r1, [r0, #0x40]\n\t" /* context->Pc */
"orrne r1, r1, #1\n\t" /* Adjust PC according to thumb */
"biceq r1, r1, #1\n\t" /* Adjust PC according to arm */
"msr CPSR_f, r2\n\t"
"ldr lr, [r0, #0x3c]\n\t" /* context->Lr */ "ldr lr, [r0, #0x3c]\n\t" /* context->Lr */
"ldr sp, [r0, #0x38]\n\t" /* context->Sp */ "ldr sp, [r0, #0x38]\n\t" /* context->Sp */
"push {r1}\n\t" "push {r1}\n\t"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment