]>
Commit | Line | Data |
---|---|---|
9da59186 JY |
1 | #------------------------------------------------------------------------------\r |
2 | #\r | |
3 | # Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
4 | # This program and the accompanying materials\r | |
5 | # are licensed and made available under the terms and conditions of the BSD License\r | |
6 | # which accompanies this distribution. The full text of the license may be found at\r | |
7 | # http://opensource.org/licenses/bsd-license.php.\r | |
8 | #\r | |
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | #\r | |
12 | # Abstract:\r | |
13 | #\r | |
14 | # Provide FSP helper function.\r | |
15 | #\r | |
16 | #------------------------------------------------------------------------------\r | |
17 | \r | |
f0abe42f JY |
18 | #\r |
19 | # FspInfoHeaderRelativeOff is patched during build process and initialized to offset of the AsmGetFspBaseAddress \r | |
20 | # from the FSP Info header. \r | |
21 | #\r | |
9da59186 JY |
22 | ASM_GLOBAL ASM_PFX(FspInfoHeaderRelativeOff)\r |
23 | ASM_PFX(FspInfoHeaderRelativeOff):\r | |
24 | #\r | |
25 | # This value will be pached by the build script\r | |
26 | #\r | |
27 | .long 0x012345678\r | |
28 | \r | |
f0abe42f JY |
29 | #\r |
30 | # Returns FSP Base Address. \r | |
31 | #\r | |
32 | # This function gets the FSP Info Header using relative addressing and returns the FSP Base from the header structure\r | |
33 | #\r | |
16b7e82c JY |
34 | ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)\r |
35 | ASM_PFX(AsmGetFspBaseAddress):\r | |
36 | mov $AsmGetFspBaseAddress, %eax\r | |
f0abe42f | 37 | sub FspInfoHeaderRelativeOff, %eax\r |
9da59186 JY |
38 | add $0x01C, %eax\r |
39 | mov (%eax), %eax\r | |
40 | ret\r | |
41 | \r | |
f0abe42f JY |
42 | #\r |
43 | # No stack counter part of AsmGetFspBaseAddress. Return address is in edi.\r | |
44 | #\r | |
45 | ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddressNoStack)\r | |
46 | ASM_PFX(AsmGetFspBaseAddressNoStack):\r | |
47 | mov $AsmGetFspBaseAddress, %eax\r | |
48 | sub FspInfoHeaderRelativeOff, %eax\r | |
49 | add $0x01C, %eax \r | |
50 | mov (%eax), %eax\r | |
51 | jmp *%edi\r | |
52 | \r | |
53 | #\r | |
54 | # Returns FSP Info Header. \r | |
55 | #\r | |
56 | # This function gets the FSP Info Header using relative addressing and returns it\r | |
57 | #\r | |
16b7e82c JY |
58 | ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)\r |
59 | ASM_PFX(AsmGetFspInfoHeader):\r | |
60 | mov $AsmGetFspBaseAddress, %eax\r | |
f0abe42f | 61 | sub FspInfoHeaderRelativeOff, %eax\r |
3b17b245 | 62 | ret\r |
f0abe42f JY |
63 | \r |
64 | #\r | |
65 | # No stack counter part of AsmGetFspInfoHeader. Return address is in edi.\r | |
66 | #\r | |
67 | ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeaderNoStack)\r | |
68 | ASM_PFX(AsmGetFspInfoHeaderNoStack):\r | |
69 | mov $AsmGetFspBaseAddress, %eax\r | |
70 | sub FspInfoHeaderRelativeOff, %eax\r | |
71 | jmp *%edi\r |