ntdll: Be more generic when storing ARM context

André Hentschel nerv at dawncrow.de
Tue Apr 19 13:48:06 CDT 2011


stmib is not supported on ARMs without Thumb
see http://forum.winehq.org/viewtopic.php?p=59676#59676
---
 dlls/ntdll/signal_arm.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index c87bb1c..c54f807 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -2,7 +2,7 @@
  * ARM signal handling routines
  *
  * Copyright 2002 Marcus Meissner, SuSE Linux AG
- * Copyright 2010 André Hentschel
+ * Copyright 2010, 2011 André Hentschel
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -177,9 +177,25 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4,
                     "add r1, r1, #0x3\n\t"  /* CONTEXT_FULL */
                     "str r1, [r0]\n\t"      /* context->ContextFlags */
                     "ldmfd SP!, {r1}\n\t"
-                    "stmib r0, {r0-pc}\n\t" /* Push registers to pointer */
+                    "str r0, [r0, #0x4]\n\t"   /* context->R0 */
+                    "str r1, [r0, #0x8]\n\t"   /* context->R1 */
+                    "str r2, [r0, #0xc]\n\t"   /* context->R2 */
+                    "str r3, [r0, #0x10]\n\t"  /* context->R3 */
+                    "str r4, [r0, #0x14]\n\t"  /* context->R4 */
+                    "str r5, [r0, #0x18]\n\t"  /* context->R5 */
+                    "str r6, [r0, #0x1c]\n\t"  /* context->R6 */
+                    "str r7, [r0, #0x20]\n\t"  /* context->R7 */
+                    "str r8, [r0, #0x24]\n\t"  /* context->R8 */
+                    "str r9, [r0, #0x28]\n\t"  /* context->R9 */
+                    "str r10, [r0, #0x2c]\n\t" /* context->R10 */
+                    "str r11, [r0, #0x30]\n\t" /* context->Fp */
+                    "str IP, [r0, #0x34]\n\t"  /* context->Ip */
+                    "str SP, [r0, #0x38]\n\t"  /* context->Sp */
+                    "str LR, [r0, #0x3c]\n\t"  /* context->Lr */
+                    "str PC, [r0, #0x40]\n\t"  /* context->Pc */
                     "mrs r1, CPSR\n\t"
-                    "stmib r0, {r1}\n\t"    /* context->Cpsr */
+                    "str r1, [r0, #0x44]\n\t"  /* context->Cpsr */
+                    "mov PC, LR\n"
                     )
 
 
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list