1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
12 ; Implementation of SetJump() on IA-32.
14 ;------------------------------------------------------------------------------
20 extern ASM_PFX(InternalAssertJumpBuffer)
21 extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
23 ;------------------------------------------------------------------------------
27 ; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
29 ;------------------------------------------------------------------------------
30 global ASM_PFX(SetJump)
33 call ASM_PFX(InternalAssertJumpBuffer) ; To validate JumpBuffer
35 pop ecx ; ecx <- return address
39 mov [edx + 24], eax ; save 0 to SSP
41 mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
45 bt eax, 23 ; check if CET is enabled
49 INCSSP_EAX ; to read original SSP
51 mov [edx + 0x24], eax ; save SSP
60 mov [edx + 20], ecx ; eip value to restore in LongJump