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