summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2014-01-10 02:48:49 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-10 02:48:49 +0000
commit554dddfcd938be621514593d2b2d0d86f42579ac (patch)
treea670921496bc98f1290786b1e7ee1fddd2c858b3 /UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
parent1d13123720d2ac07155f98764e527c2fe5598ade (diff)
downloadedk2-554dddfcd938be621514593d2b2d0d86f42579ac.tar.gz
edk2-554dddfcd938be621514593d2b2d0d86f42579ac.tar.bz2
edk2-554dddfcd938be621514593d2b2d0d86f42579ac.zip
Fix bug when reserve stack space to fill exception context.
Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15086 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S')
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
index 6e80d848fe..233dbcbcc5 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------ ;
-# Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -269,15 +269,15 @@ VectorNum:
ASM_GLOBAL ASM_PFX(HookAfterStubHeaderEnd)
ASM_PFX(HookAfterStubHeaderEnd):
movq %rsp, %rax
- subq $8, %rsp
- andl $0x0fffffff0, %esp
+ andl $0x0fffffff0, %esp # make sure 16-byte aligned for exception context
+ subq $0x18, %rsp # reserve room for filling exception data later
pushq %rcx
movq 8(%rax), %rcx
pushq %rax
movabsl ASM_PFX(mErrorCodeFlag), %eax
bt %ecx, %eax
popq %rax
- jc NoErrorData
+ jnc NoErrorData
pushq (%rsp) # push additional rcx to make stack alignment
NoErrorData:
xchgq (%rsp), %rcx # restore rcx, save Exception Number in stack