]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/FspSecCore/X64/FspHelper.nasm
IntelFsp2Pkg: FspSecCore support for X64
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / X64 / FspHelper.nasm
1 ;; @file
2 ; Provide FSP helper function.
3 ;
4 ; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
6 ;;
7 DEFAULT REL
8 SECTION .text
9
10 global ASM_PFX(AsmGetFspBaseAddress)
11 ASM_PFX(AsmGetFspBaseAddress):
12 call ASM_PFX(AsmGetFspInfoHeader)
13 add rax, 0x1C
14 mov eax, [rax]
15 ret
16
17 global ASM_PFX(AsmGetFspInfoHeader)
18 ASM_PFX(AsmGetFspInfoHeader):
19 lea rax, [ASM_PFX(AsmGetFspInfoHeader)]
20 DB 0x48, 0x2d ; sub rax, 0x????????
21 global ASM_PFX(FspInfoHeaderRelativeOff)
22 ASM_PFX(FspInfoHeaderRelativeOff):
23 DD 0x12345678 ; This value must be patched by the build script
24 and rax, 0xffffffff
25 ret
26
27 global ASM_PFX(AsmGetFspInfoHeaderNoStack)
28 ASM_PFX(AsmGetFspInfoHeaderNoStack):
29 lea rax, [ASM_PFX(AsmGetFspInfoHeader)]
30 lea rcx, [ASM_PFX(FspInfoHeaderRelativeOff)]
31 mov ecx, [rcx]
32 sub rax, rcx
33 and rax, 0xffffffff
34 jmp rdi