1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php.
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 ; Implementation of SetJump() on x64.
20 ;------------------------------------------------------------------------------
27 extern ASM_PFX(InternalAssertJumpBuffer)
28 extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
30 ;------------------------------------------------------------------------------
34 ; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
36 ;------------------------------------------------------------------------------
37 global ASM_PFX(SetJump)
41 call ASM_PFX(InternalAssertJumpBuffer)
47 mov [rcx + 0xF8], rax ; save 0 to SSP
49 mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
53 bt eax, 23 ; check if CET is enabled
57 INCSSP_RAX ; to read original SSP
59 mov [rcx + 0xF8], rax ; save SSP
73 ; save non-volatile fp registers
75 movdqu [rcx + 0x58], xmm6
76 movdqu [rcx + 0x68], xmm7
77 movdqu [rcx + 0x78], xmm8
78 movdqu [rcx + 0x88], xmm9
79 movdqu [rcx + 0x98], xmm10
80 movdqu [rcx + 0xA8], xmm11
81 movdqu [rcx + 0xB8], xmm12
82 movdqu [rcx + 0xC8], xmm13
83 movdqu [rcx + 0xD8], xmm14
84 movdqu [rcx + 0xE8], xmm15