1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2018, 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.
14 ; This file provides macro definitions for stuffing the Return Stack Buffer (RSB)
17 ;------------------------------------------------------------------------------
19 %define RSB_STUFF_ENTRIES 0x20
23 ; @param 1: register to use as counter (e.g. IA32:eax, X64:rax)
24 ; @param 2: stack pointer to restore (IA32:esp, X64:rsp)
25 ; @param 3: the size of a stack frame (IA32:4, X64:8)
28 mov %1, RSB_STUFF_ENTRIES / 2
44 add %2, RSB_STUFF_ENTRIES * %3 ; Restore the stack pointer
48 ; RSB stuffing macros for IA32 and X64