2 ; Provide FSP API entry points.
4 ; Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
11 ; Following functions will be provided in C
13 extern ASM_PFX(Loader2PeiSwitchStack)
14 extern ASM_PFX(FspApiCallingCheck)
17 ; Following functions will be provided in ASM
19 extern ASM_PFX(FspApiCommonContinue)
20 extern ASM_PFX(AsmGetFspInfoHeader)
22 ;----------------------------------------------------------------------------
25 ; This is the FSP API common entry point to resume the FSP execution
27 ;----------------------------------------------------------------------------
28 global ASM_PFX(FspApiCommon)
29 ASM_PFX(FspApiCommon):
31 ; EAX holds the API index
39 cmp eax, dword [esp - 4]
46 ; Verify the calling condition
49 push DWORD [esp + (4 * 8 + 4)] ; push ApiParam
50 push eax ; push ApiIdx
51 call ASM_PFX(FspApiCallingCheck)
55 mov dword [esp + (4 * 7)], eax
62 cmp eax, 3 ; FspMemoryInit API
65 cmp eax, 6 ; FspMultiPhaseSiInitApiIndex API
68 call ASM_PFX(AsmGetFspInfoHeader)
69 jmp ASM_PFX(Loader2PeiSwitchStack)
72 jmp ASM_PFX(FspApiCommonContinue)