TianoCore EDK2 master
Loading...
Searching...
No Matches
FspNotifyPhasePeim.c
Go to the documentation of this file.
1
9
22EFIAPI
25 IN EFI_PEI_SERVICES **PeiServices,
27 );
28
29CONST EFI_DXE_IPL_PPI mDxeIplPpi = {
31};
32
33CONST EFI_PEI_PPI_DESCRIPTOR mInstallDxeIplPpi = {
34 EFI_PEI_PPI_DESCRIPTOR_PPI,
35 &gEfiDxeIplPpiGuid,
36 (VOID *)&mDxeIplPpi
37};
38
39CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi = {
40 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
41 &gEfiEndOfPeiSignalPpiGuid,
42 NULL
43};
44
45CONST EFI_PEI_PPI_DESCRIPTOR gFspReadyForNotifyPhasePpi = {
46 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
47 &gFspReadyForNotifyPhasePpiGuid,
48 NULL
49};
50
63EFIAPI
66 IN EFI_PEI_SERVICES **PeiServices,
68 )
69{
70 EFI_STATUS Status;
71
72 DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP HOB is located at 0x%08X\n", HobList));
73
74 //
75 // End of PEI phase signal
76 //
77 Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
78 ASSERT_EFI_ERROR (Status);
79
80 //
81 // Give control back to BootLoader after FspSiliconInit
82 //
83 DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP is waiting for NOTIFY\n"));
85
86 //
87 // BootLoader called FSP again through NotifyPhase
88 //
90
91 if (GetFspGlobalDataPointer ()->FspMode == FSP_IN_API_MODE) {
92 //
93 // Should not come here
94 //
95 while (TRUE) {
96 DEBUG ((DEBUG_ERROR, "No FSP API should be called after FSP is DONE!\n"));
97 SetFspApiReturnStatus (EFI_UNSUPPORTED);
99 }
100 }
101
102 return EFI_SUCCESS;
103}
104
115EFIAPI
117 IN EFI_PEI_FILE_HANDLE FileHandle,
118 IN CONST EFI_PEI_SERVICES **PeiServices
119 )
120{
121 EFI_STATUS Status;
122 VOID *OldDxeIplPpi;
123 EFI_PEI_PPI_DESCRIPTOR *OldDescriptor;
124
125 DEBUG ((DEBUG_INFO | DEBUG_INIT, "The entry of FspNotificationPeim\n"));
126
127 if (GetFspGlobalDataPointer ()->FspMode == FSP_IN_API_MODE) {
128 //
129 // Locate old DXE IPL PPI
130 //
131 Status = PeiServicesLocatePpi (
132 &gEfiDxeIplPpiGuid,
133 0,
134 &OldDescriptor,
135 &OldDxeIplPpi
136 );
137 ASSERT_EFI_ERROR (Status);
138
139 //
140 // Re-install the DXE IPL PPI to wait for notify
141 //
142 Status = PeiServicesReInstallPpi (OldDescriptor, &mInstallDxeIplPpi);
143 ASSERT_EFI_ERROR (Status);
144 } else {
145 Status = PeiServicesInstallPpi (&gFspReadyForNotifyPhasePpi);
146 ASSERT_EFI_ERROR (Status);
147 }
148
149 return EFI_SUCCESS;
150}
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI PeiServicesReInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
VOID EFIAPI SetFspApiReturnStatus(IN UINTN ReturnStatus)
Definition: FspCommonLib.c:160
FSP_GLOBAL_DATA *EFIAPI GetFspGlobalDataPointer(VOID)
Definition: FspCommonLib.c:73
EFI_STATUS EFIAPI FspNotifyPhasePeimEntryPoint(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI WaitForNotify(IN CONST EFI_DXE_IPL_PPI *This, IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_HOB_POINTERS HobList)
VOID EFIAPI FspWaitForNotify(VOID)
VOID EFIAPI FspSiliconInitDone2(IN EFI_STATUS Status)
EFI_STATUS EFIAPI Pei2LoaderSwitchStack(VOID)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112