]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFspPkg/FspSecCore/Ia32/FspHelper.s
IntelFspPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspPkg / FspSecCore / Ia32 / FspHelper.s
CommitLineData
9da59186
JY
1#------------------------------------------------------------------------------\r
2#\r
3# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
16a16ea6 4# SPDX-License-Identifier: BSD-2-Clause-Patent\r
9da59186
JY
5#\r
6# Abstract:\r
7#\r
8# Provide FSP helper function.\r
9#\r
10#------------------------------------------------------------------------------\r
11\r
f0abe42f
JY
12#\r
13# FspInfoHeaderRelativeOff is patched during build process and initialized to offset of the AsmGetFspBaseAddress \r
14# from the FSP Info header. \r
15#\r
9da59186
JY
16ASM_GLOBAL ASM_PFX(FspInfoHeaderRelativeOff)\r
17ASM_PFX(FspInfoHeaderRelativeOff):\r
18 #\r
19 # This value will be pached by the build script\r
20 #\r
21 .long 0x012345678\r
22\r
f0abe42f
JY
23#\r
24# Returns FSP Base Address. \r
25#\r
26# This function gets the FSP Info Header using relative addressing and returns the FSP Base from the header structure\r
27#\r
16b7e82c
JY
28ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)\r
29ASM_PFX(AsmGetFspBaseAddress):\r
30 mov $AsmGetFspBaseAddress, %eax\r
f0abe42f 31 sub FspInfoHeaderRelativeOff, %eax\r
9da59186
JY
32 add $0x01C, %eax\r
33 mov (%eax), %eax\r
34 ret\r
35\r
f0abe42f
JY
36#\r
37# No stack counter part of AsmGetFspBaseAddress. Return address is in edi.\r
38#\r
39ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddressNoStack)\r
40ASM_PFX(AsmGetFspBaseAddressNoStack):\r
41 mov $AsmGetFspBaseAddress, %eax\r
42 sub FspInfoHeaderRelativeOff, %eax\r
43 add $0x01C, %eax \r
44 mov (%eax), %eax\r
45 jmp *%edi\r
46\r
47#\r
48# Returns FSP Info Header. \r
49#\r
50# This function gets the FSP Info Header using relative addressing and returns it\r
51#\r
16b7e82c
JY
52ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)\r
53ASM_PFX(AsmGetFspInfoHeader):\r
54 mov $AsmGetFspBaseAddress, %eax\r
f0abe42f 55 sub FspInfoHeaderRelativeOff, %eax\r
3b17b245 56 ret\r
f0abe42f
JY
57 \r
58#\r
59# No stack counter part of AsmGetFspInfoHeader. Return address is in edi.\r
60#\r
61ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeaderNoStack)\r
62ASM_PFX(AsmGetFspInfoHeaderNoStack):\r
63 mov $AsmGetFspBaseAddress, %eax\r
64 sub FspInfoHeaderRelativeOff, %eax\r
65 jmp *%edi\r