1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
8 ; This file provides macro definitions for stuffing the Return Stack Buffer (RSB)
11 ;------------------------------------------------------------------------------
13 %define RSB_STUFF_ENTRIES 0x20
17 ; @param 1: register to use as counter (e.g. IA32:eax, X64:rax)
18 ; @param 2: stack pointer to restore (IA32:esp, X64:rsp)
19 ; @param 3: the size of a stack frame (IA32:4, X64:8)
22 mov %1, RSB_STUFF_ENTRIES / 2
38 add %2, RSB_STUFF_ENTRIES * %3 ; Restore the stack pointer
42 ; RSB stuffing macros for IA32 and X64