]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm
This revision can only work with Intel(c) UDK Debugger Tool version 1.2 or greater...
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugAgent / DebugAgentCommon / X64 / AsmFuncs.asm
index b712c428c891dd23a5efb1f5fe59941546ba0450..16d73a41211977022378207c113b98bdf0c26359 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -263,9 +263,12 @@ NoExtrPush:
     push    rax\r
 \r
     sub     rsp, 512\r
-    mov rdi, rsp\r
+    mov     rdi, rsp\r
     db 0fh, 0aeh, 00000111y ;fxsave [rdi]\r
 \r
+    ;; save the exception data\r
+    push    qword ptr [rbp + 16]\r
+\r
     ;; Clear Direction Flag\r
     cld\r
        \r
@@ -273,9 +276,16 @@ NoExtrPush:
     mov     rdx, rsp      ; Structure\r
     mov     r15, rcx      ; save vector in r15\r
     \r
-    sub     rsp, 32\r
+    ;\r
+    ; Per X64 calling convention, allocate maximum parameter stack space\r
+    ; and make sure RSP is 16-byte aligned\r
+    ;\r
+    sub     rsp, 32 + 8\r
     call    InterruptProcess\r
-    add     rsp, 32\r
+    add     rsp, 32 + 8\r
+\r
+    ;; skip the exception data\r
+    add     rsp, 8\r
     \r
     mov     rsi, rsp\r
     db 0fh, 0aeh, 00001110y ; fxrstor [rsi]\r