]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg: Using the "movabsq" instruction to read global variable mDoFarReturnFlag...
authorLaszlo Ersek <lersek@redhat.com>
Fri, 29 Nov 2013 04:44:22 +0000 (04:44 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Nov 2013 04:44:22 +0000 (04:44 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14920 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S

index 7d5672f892b9d7886158d254e72fe4541617272d..6e80d848fef2033f77cb5afa203d862e83639374 100644 (file)
@@ -273,7 +273,10 @@ ASM_PFX(HookAfterStubHeaderEnd):
     andl    $0x0fffffff0, %esp\r
     pushq   %rcx\r
     movq    8(%rax), %rcx\r
-    bt      %ecx, ASM_PFX(mErrorCodeFlag)\r
+    pushq   %rax\r
+    movabsl ASM_PFX(mErrorCodeFlag), %eax\r
+    bt      %ecx, %eax\r
+    popq    %rax\r
     jc      NoErrorData\r
     pushq   (%rsp)            # push additional rcx to make stack alignment\r
 NoErrorData:\r
@@ -301,8 +304,8 @@ ASM_PFX(CommonInterruptEntry):
     cmp     $32, %ecx          # Intel reserved vector for exceptions?\r
     jae     NoErrorCode\r
     pushq   %rax\r
-    leaq    ASM_PFX(mErrorCodeFlag)(%rip), %rax\r
-    bt      %ecx, (%rax) \r
+    movabsl ASM_PFX(mErrorCodeFlag), %eax\r
+    bt      %ecx, %eax\r
     popq    %rax\r
     jc      CommonInterruptEntry_al_0000\r
 \r
@@ -549,7 +552,10 @@ ErrorCode:
     jmp     *-24(%rsp)\r
 \r
 DoReturn:\r
-    cmpq    $0, ASM_PFX(mDoFarReturnFlag)   # Check if need to do far return instead of IRET\r
+    pushq   %rax\r
+    movabsq ASM_PFX(mDoFarReturnFlag), %rax\r
+    cmpq    $0, %rax          # Check if need to do far return instead of IRET\r
+    popq    %rax\r
     jz      DoIret\r
     pushq   %rax\r
     movq    %rsp, %rax        # save old RSP to rax\r