]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / FspHelper.nasm
1 ;; @file
2 ; Provide FSP helper function.
3 ;
4 ; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
6 ;;
7
8 SECTION .text
9
10 global ASM_PFX(FspInfoHeaderRelativeOff)
11 ASM_PFX(FspInfoHeaderRelativeOff):
12 DD 0x12345678 ; This value must be patched by the build script
13
14 global ASM_PFX(AsmGetFspBaseAddress)
15 ASM_PFX(AsmGetFspBaseAddress):
16 call ASM_PFX(AsmGetFspInfoHeader)
17 add eax, 0x1C
18 mov eax, dword [eax]
19 ret
20
21 global ASM_PFX(AsmGetFspInfoHeader)
22 ASM_PFX(AsmGetFspInfoHeader):
23 call ASM_PFX(NextInstruction)
24 ASM_PFX(NextInstruction):
25 pop eax
26 sub eax, ASM_PFX(NextInstruction)
27 add eax, ASM_PFX(AsmGetFspInfoHeader)
28 sub eax, dword [eax - ASM_PFX(AsmGetFspInfoHeader) + ASM_PFX(FspInfoHeaderRelativeOff)]
29 ret
30
31 global ASM_PFX(AsmGetFspInfoHeaderNoStack)
32 ASM_PFX(AsmGetFspInfoHeaderNoStack):
33 mov eax, ASM_PFX(AsmGetFspInfoHeader)
34 sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)]
35 jmp edi