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