]>
Commit | Line | Data |
---|---|---|
9da59186 JY |
1 | ;; @file\r |
2 | ; Provide FSP helper function.\r | |
3 | ;\r | |
4 | ; Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
5 | ; This program and the accompanying materials\r | |
6 | ; are licensed and made available under the terms and conditions of the BSD License\r | |
7 | ; which accompanies this distribution. The full text of the license may be found at\r | |
8 | ; http://opensource.org/licenses/bsd-license.php.\r | |
9 | ;\r | |
10 | ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | ;;\r | |
13 | \r | |
14 | .586p\r | |
15 | .model flat,C\r | |
16 | .code\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 | |
3b17b245 | 22 | FspInfoHeaderRelativeOff PROC NEAR PUBLIC\r |
9da59186 JY |
23 | ;\r |
24 | ; This value will be pached by the build script\r | |
25 | ;\r | |
26 | DD 012345678h\r | |
27 | FspInfoHeaderRelativeOff ENDP\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 | AsmGetFspBaseAddress PROC NEAR PUBLIC\r |
35 | mov eax, AsmGetFspBaseAddress\r | |
9da59186 JY |
36 | sub eax, dword ptr [FspInfoHeaderRelativeOff]\r |
37 | add eax, 01Ch\r | |
38 | mov eax, dword ptr [eax]\r | |
39 | ret\r | |
16b7e82c | 40 | AsmGetFspBaseAddress ENDP\r |
9da59186 | 41 | \r |
f0abe42f JY |
42 | ;\r |
43 | ; No stack counter part of AsmGetFspBaseAddress. Return address is in edi.\r | |
44 | ;\r | |
45 | AsmGetFspBaseAddressNoStack PROC NEAR PUBLIC\r | |
46 | mov eax, AsmGetFspBaseAddress\r | |
47 | sub eax, dword ptr [FspInfoHeaderRelativeOff]\r | |
48 | add eax, 01Ch \r | |
49 | mov eax, dword ptr [eax]\r | |
50 | jmp edi\r | |
51 | AsmGetFspBaseAddressNoStack ENDP\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 | AsmGetFspInfoHeader PROC NEAR PUBLIC\r |
59 | mov eax, AsmGetFspBaseAddress\r | |
3b17b245 MM |
60 | sub eax, dword ptr [FspInfoHeaderRelativeOff]\r |
61 | ret\r | |
16b7e82c | 62 | AsmGetFspInfoHeader ENDP\r |
3b17b245 | 63 | \r |
f0abe42f JY |
64 | ;\r |
65 | ; No stack counter part of AsmGetFspInfoHeader. Return address is in edi.\r | |
66 | ;\r | |
67 | AsmGetFspInfoHeaderNoStack PROC NEAR PUBLIC\r | |
68 | mov eax, AsmGetFspBaseAddress\r | |
69 | sub eax, dword ptr [FspInfoHeaderRelativeOff]\r | |
70 | jmp edi\r | |
71 | AsmGetFspInfoHeaderNoStack ENDP\r | |
72 | \r | |
9da59186 | 73 | END |