2 ; Provide FSP helper function.
4 ; Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 ; This program and the accompanying materials
6 ; are licensed and made available under the terms and conditions of the BSD License
7 ; which accompanies this distribution. The full text of the license may be found at
8 ; http://opensource.org/licenses/bsd-license.php.
10 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 ; FspInfoHeaderRelativeOff is patched during build process and initialized to offset of the AsmGetFspBaseAddress
20 ; from the FSP Info header.
22 FspInfoHeaderRelativeOff PROC NEAR PUBLIC
24 ; This value will be pached by the build script
27 FspInfoHeaderRelativeOff ENDP
30 ; Returns FSP Base Address.
32 ; This function gets the FSP Info Header using relative addressing and returns the FSP Base from the header structure
34 AsmGetFspBaseAddress PROC NEAR PUBLIC
35 mov eax, AsmGetFspBaseAddress
36 sub eax, dword ptr [FspInfoHeaderRelativeOff]
38 mov eax, dword ptr [eax]
40 AsmGetFspBaseAddress ENDP
43 ; No stack counter part of AsmGetFspBaseAddress. Return address is in edi.
45 AsmGetFspBaseAddressNoStack PROC NEAR PUBLIC
46 mov eax, AsmGetFspBaseAddress
47 sub eax, dword ptr [FspInfoHeaderRelativeOff]
49 mov eax, dword ptr [eax]
51 AsmGetFspBaseAddressNoStack ENDP
54 ; Returns FSP Info Header.
56 ; This function gets the FSP Info Header using relative addressing and returns it
58 AsmGetFspInfoHeader PROC NEAR PUBLIC
59 mov eax, AsmGetFspBaseAddress
60 sub eax, dword ptr [FspInfoHeaderRelativeOff]
62 AsmGetFspInfoHeader ENDP
65 ; No stack counter part of AsmGetFspInfoHeader. Return address is in edi.
67 AsmGetFspInfoHeaderNoStack PROC NEAR PUBLIC
68 mov eax, AsmGetFspBaseAddress
69 sub eax, dword ptr [FspInfoHeaderRelativeOff]
71 AsmGetFspInfoHeaderNoStack ENDP