]>
Commit | Line | Data |
---|---|---|
cf1d4549 JY |
1 | ;; @file\r |
2 | ; Provide FSP API entry points.\r | |
3 | ;\r | |
00aa71ce | 4 | ; Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>\r |
9672cd30 | 5 | ; SPDX-License-Identifier: BSD-2-Clause-Patent\r |
cf1d4549 JY |
6 | ;;\r |
7 | \r | |
8 | SECTION .text\r | |
9 | \r | |
00aa71ce TK |
10 | STACK_SAVED_EAX_OFFSET EQU 4 * 7 ; size of a general purpose register * eax index\r |
11 | \r | |
cf1d4549 JY |
12 | ;\r |
13 | ; Following functions will be provided in C\r | |
14 | ;\r | |
15 | extern ASM_PFX(Loader2PeiSwitchStack)\r | |
16 | extern ASM_PFX(FspApiCallingCheck)\r | |
17 | \r | |
18 | ;\r | |
19 | ; Following functions will be provided in ASM\r | |
20 | ;\r | |
21 | extern ASM_PFX(FspApiCommonContinue)\r | |
22 | extern ASM_PFX(AsmGetFspInfoHeader)\r | |
23 | \r | |
24 | ;----------------------------------------------------------------------------\r | |
25 | ; FspApiCommon API\r | |
26 | ;\r | |
27 | ; This is the FSP API common entry point to resume the FSP execution\r | |
28 | ;\r | |
29 | ;----------------------------------------------------------------------------\r | |
30 | global ASM_PFX(FspApiCommon)\r | |
31 | ASM_PFX(FspApiCommon):\r | |
32 | ;\r | |
33 | ; EAX holds the API index\r | |
34 | ;\r | |
35 | \r | |
36 | ;\r | |
37 | ; Stack must be ready\r | |
38 | ;\r | |
39 | push eax\r | |
40 | add esp, 4\r | |
41 | cmp eax, dword [esp - 4]\r | |
42 | jz FspApiCommon1\r | |
43 | mov eax, 080000003h\r | |
44 | jmp exit\r | |
45 | \r | |
46 | FspApiCommon1:\r | |
47 | ;\r | |
48 | ; Verify the calling condition\r | |
49 | ;\r | |
50 | pushad\r | |
51 | push DWORD [esp + (4 * 8 + 4)] ; push ApiParam\r | |
52 | push eax ; push ApiIdx\r | |
53 | call ASM_PFX(FspApiCallingCheck)\r | |
54 | add esp, 8\r | |
55 | cmp eax, 0\r | |
56 | jz FspApiCommon2\r | |
00aa71ce | 57 | mov dword [esp + STACK_SAVED_EAX_OFFSET], eax\r |
cf1d4549 JY |
58 | popad\r |
59 | exit:\r | |
60 | ret\r | |
61 | \r | |
62 | FspApiCommon2:\r | |
63 | popad\r | |
64 | cmp eax, 3 ; FspMemoryInit API\r | |
65 | jz FspApiCommon3\r | |
66 | \r | |
f2cdb268 CC |
67 | cmp eax, 6 ; FspMultiPhaseSiInitApiIndex API\r |
68 | jz FspApiCommon3\r | |
69 | \r | |
3d35a6c2 CC |
70 | cmp eax, 8 ; FspMultiPhaseMemInitApiIndex API\r |
71 | jz FspApiCommon3\r | |
72 | \r | |
cf1d4549 JY |
73 | call ASM_PFX(AsmGetFspInfoHeader)\r |
74 | jmp ASM_PFX(Loader2PeiSwitchStack)\r | |
75 | \r | |
76 | FspApiCommon3:\r | |
77 | jmp ASM_PFX(FspApiCommonContinue)\r | |
78 | \r |