2 ; Provide FSP API entry points.
4 ; Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
10 STACK_SAVED_EAX_OFFSET EQU 4 * 7 ; size of a general purpose register * eax index
13 ; Following functions will be provided in C
15 extern ASM_PFX(Loader2PeiSwitchStack)
16 extern ASM_PFX(FspApiCallingCheck)
19 ; Following functions will be provided in ASM
21 extern ASM_PFX(FspApiCommonContinue)
22 extern ASM_PFX(AsmGetFspInfoHeader)
24 ;----------------------------------------------------------------------------
27 ; This is the FSP API common entry point to resume the FSP execution
29 ;----------------------------------------------------------------------------
30 global ASM_PFX(FspApiCommon)
31 ASM_PFX(FspApiCommon):
33 ; EAX holds the API index
41 cmp eax, dword [esp - 4]
48 ; Verify the calling condition
51 push DWORD [esp + (4 * 8 + 4)] ; push ApiParam
52 push eax ; push ApiIdx
53 call ASM_PFX(FspApiCallingCheck)
57 mov dword [esp + STACK_SAVED_EAX_OFFSET], eax
64 cmp eax, 3 ; FspMemoryInit API
67 cmp eax, 6 ; FspMultiPhaseSiInitApiIndex API
70 cmp eax, 8 ; FspMultiPhaseMemInitApiIndex API
73 call ASM_PFX(AsmGetFspInfoHeader)
74 jmp ASM_PFX(Loader2PeiSwitchStack)
77 jmp ASM_PFX(FspApiCommonContinue)