]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/Include/PushPopRegsNasm.inc
IntelFsp2Pkg: BaseFspSwitchStackLib Support for X64
[mirror_edk2.git] / IntelFsp2Pkg / Include / PushPopRegsNasm.inc
CommitLineData
411b3ff6
KT
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>\r
4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
5;\r
6; Abstract:\r
7;\r
8; Provide macro to push/pop registers in X64\r
9;\r
10;------------------------------------------------------------------------------\r
11\r
12;-----------------------------------------------------------------------------\r
13; Macro: PUSHA_64\r
14;\r
15; Description: Saves all registers on stack\r
16;\r
17; Input: None\r
18;\r
19; Output: None\r
20;-----------------------------------------------------------------------------\r
21%macro PUSHA_64 0\r
22 push r8\r
23 push r9\r
24 push r10\r
25 push r11\r
26 push r12\r
27 push r13\r
28 push r14\r
29 push r15\r
30 push rax\r
31 push rcx\r
32 push rdx\r
33 push rbx\r
34 push rsp\r
35 push rbp\r
36 push rsi\r
37 push rdi\r
38%endmacro\r
39\r
40;-----------------------------------------------------------------------------\r
41; Macro: POPA_64\r
42;\r
43; Description: Restores all registers from stack\r
44;\r
45; Input: None\r
46;\r
47; Output: None\r
48;-----------------------------------------------------------------------------\r
49%macro POPA_64 0\r
50 pop rdi\r
51 pop rsi\r
52 pop rbp\r
53 pop rsp\r
54 pop rbx\r
55 pop rdx\r
56 pop rcx\r
57 pop rax\r
58 pop r15\r
59 pop r14\r
60 pop r13\r
61 pop r12\r
62 pop r11\r
63 pop r10\r
64 pop r9\r
65 pop r8\r
66%endmacro\r
67\r