[3/10] ntdll: Add implementation for RtlCaptureContext on ARM

André Hentschel nerv at dawncrow.de
Fri Apr 15 12:32:55 CDT 2011


This implementation uses the actual values of the registers instead of using the stack in some way.
I think that's fine for now even if the control registers and r0 have wrong values.
If you decide to reject this one, you can simply skip it as there is no real dependency to the other patches.

---
 dlls/ntdll/signal_arm.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index 0934164..e92ebcc 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -160,11 +160,17 @@ static inline void restore_fpu( CONTEXT *context, const ucontext_t *sigcontext )
 /***********************************************************************
  *		RtlCaptureContext (NTDLL.@)
  */
-void WINAPI RtlCaptureContext( CONTEXT *context )
-{
-    FIXME("not implemented\n");
-    memset( context, 0, sizeof(*context) );
-}
+/* FIXME: Use the Stack instead of the actual register values */
+__ASM_STDCALL_FUNC( RtlCaptureContext, 4,
+                    "stmfd SP!, {r1}\n\t"
+                    "mov r1, #0x40\n\t"     /* CONTEXT_ARM */
+                    "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 */
+                    "mrs r1, CPSR\n\t"
+                    "stmib r0, {r1}\n\t"    /* context->Cpsr */
+                    )
 
 
 /***********************************************************************
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list