#------------------------------------------------------------------------------ ;\r
-# Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2012 - 2014, 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
ASM_GLOBAL ASM_PFX(HookAfterStubHeaderEnd)\r
ASM_PFX(HookAfterStubHeaderEnd):\r
movq %rsp, %rax\r
- subq $8, %rsp\r
- andl $0x0fffffff0, %esp\r
+ andl $0x0fffffff0, %esp # make sure 16-byte aligned for exception context\r
+ subq $0x18, %rsp # reserve room for filling exception data later\r
pushq %rcx\r
movq 8(%rax), %rcx\r
pushq %rax\r
movabsl ASM_PFX(mErrorCodeFlag), %eax\r
bt %ecx, %eax\r
popq %rax\r
- jc NoErrorData\r
+ jnc NoErrorData\r
pushq (%rsp) # push additional rcx to make stack alignment\r
NoErrorData:\r
xchgq (%rsp), %rcx # restore rcx, save Exception Number in stack\r
;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2012 - 2014, 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
jmp rax\r
HookAfterStubHeaderEnd:\r
mov rax, rsp\r
- sub rsp, 8h\r
- and sp, 0fff0h\r
+ and sp, 0fff0h ; make sure 16-byte aligned for exception context\r
+ sub rsp, 18h ; reserve room for filling exception data later\r
push rcx\r
mov rcx, [rax + 8]\r
bt mErrorCodeFlag, ecx\r
- jc @F\r
+ jnc @F\r
push [rsp] ; push additional rcx to make stack alignment\r
@@:\r
xchg rcx, [rsp] ; restore rcx, save Exception Number in stack\r