Alexandre Julliard : ntdll: Implement RtlRaiseException for x86_64 directly instead of using the winebuild-generated code .

Alexandre Julliard julliard at winehq.org
Thu Jan 27 12:43:17 CST 2011


Module: wine
Branch: master
Commit: 672a084584524dfb173819a30b19b87aa14bf8f8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=672a084584524dfb173819a30b19b87aa14bf8f8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan 27 13:59:45 2011 +0100

ntdll: Implement RtlRaiseException for x86_64 directly instead of using the winebuild-generated code.

---

 dlls/ntdll/signal_x86_64.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index c1d1b84..86f5c93 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -3098,7 +3098,22 @@ void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
     status = raise_exception( rec, context, TRUE );
     if (status != STATUS_SUCCESS) raise_status( status, rec );
 }
-DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 )
+__ASM_GLOBAL_FUNC( RtlRaiseException,
+                   "movq %rcx,8(%rsp)\n\t"
+                   "sub $0x4f8,%rsp\n\t"
+                   __ASM_CFI(".cfi_adjust_cfa_offset 0x4f8\n\t")
+                   "leaq 0x20(%rsp),%rcx\n\t"
+                   "call " __ASM_NAME("RtlCaptureContext") "\n\t"
+                   "leaq 0x20(%rsp),%rdx\n\t"   /* context pointer */
+                   "movq 0x4f8(%rsp),%rax\n\t"  /* return address */
+                   "movq %rax,0xf8(%rdx)\n\t"   /* context->Rip */
+                   "leaq 0x500(%rsp),%rax\n\t"  /* orig stack pointer */
+                   "movq %rax,0x98(%rdx)\n\t"   /* context->Rsp */
+                   "movq (%rax),%rcx\n\t"       /* original first parameter */
+                   "movq %rcx,0x80(%rdx)\n\t"   /* context->Rcx */
+                   "call " __ASM_NAME("__regs_RtlRaiseException") "\n\t"
+                   "leaq 0x20(%rsp),%rdi\n\t"   /* context pointer */
+                   "call " __ASM_NAME("set_cpu_context") /* does not return */ );
 
 
 /*************************************************************************




More information about the wine-cvs mailing list