22 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
23 &gEfiPeiRscHandlerPpiGuid,
30 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
31 &gEfiPeiStatusCodePpiGuid,
50 UINTN *NumberOfEntries;
56 &gStatusCodeCallbackGuid,
57 sizeof (EFI_PEI_RSC_HANDLER_CALLBACK) * 64 +
sizeof (
UINTN)
59 ASSERT (NumberOfEntries !=
NULL);
63 return NumberOfEntries;
85 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
89 EFI_PEI_RSC_HANDLER_CALLBACK *CallbackEntry;
90 UINTN *NumberOfEntries;
95 if (Callback ==
NULL) {
96 return EFI_INVALID_PARAMETER;
102 while (Hob.Raw !=
NULL) {
103 NumberOfEntries = GET_GUID_HOB_DATA (Hob);
104 CallbackEntry = (EFI_PEI_RSC_HANDLER_CALLBACK *)(NumberOfEntries + 1);
105 if ((FreePacket ==
NULL) && (*NumberOfEntries < 64)) {
110 FreePacket = NumberOfEntries;
111 FreeEntryIndex = *NumberOfEntries;
114 for (Index = 0; Index < *NumberOfEntries; Index++) {
115 if (CallbackEntry[Index] == Callback) {
119 return EFI_ALREADY_STARTED;
122 if ((FreePacket ==
NULL) && (CallbackEntry[Index] ==
NULL)) {
127 FreePacket = NumberOfEntries;
128 FreeEntryIndex = Index;
132 Hob.Raw = GET_NEXT_HOB (Hob);
136 if (FreePacket ==
NULL) {
140 CallbackEntry = (EFI_PEI_RSC_HANDLER_CALLBACK *)(FreePacket + 1);
141 CallbackEntry[FreeEntryIndex] = Callback;
143 if (*FreePacket == FreeEntryIndex) {
170 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
174 EFI_PEI_RSC_HANDLER_CALLBACK *CallbackEntry;
175 UINTN *NumberOfEntries;
178 if (Callback ==
NULL) {
179 return EFI_INVALID_PARAMETER;
183 while (Hob.Raw !=
NULL) {
184 NumberOfEntries = GET_GUID_HOB_DATA (Hob);
185 CallbackEntry = (EFI_PEI_RSC_HANDLER_CALLBACK *)(NumberOfEntries + 1);
186 for (Index = 0; Index < *NumberOfEntries; Index++) {
187 if (CallbackEntry[Index] == Callback) {
191 CallbackEntry[Index] =
NULL;
196 Hob.Raw = GET_NEXT_HOB (Hob);
200 return EFI_NOT_FOUND;
241 EFI_PEI_RSC_HANDLER_CALLBACK *CallbackEntry;
242 UINTN *NumberOfEntries;
246 while (Hob.Raw !=
NULL) {
247 NumberOfEntries = GET_GUID_HOB_DATA (Hob);
248 CallbackEntry = (EFI_PEI_RSC_HANDLER_CALLBACK *)(NumberOfEntries + 1);
249 for (Index = 0; Index < *NumberOfEntries; Index++) {
250 if (CallbackEntry[Index] !=
NULL) {
251 CallbackEntry[Index](
262 Hob.Raw = GET_NEXT_HOB (Hob);
307 &gEfiPeiStatusCodePpiGuid,
310 (VOID **)&OldStatusCodePpi
312 if (!EFI_ERROR (Status)) {
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
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)
#define ASSERT_EFI_ERROR(StatusParameter)
VOID * EFI_PEI_FILE_HANDLE
UINT32 EFI_STATUS_CODE_VALUE
UINT32 EFI_STATUS_CODE_TYPE
EFI_STATUS EFIAPI GenericStatusCodePeiEntry(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
UINTN * CreateRscHandlerCallbackPacket(VOID)
EFI_STATUS EFIAPI Unregister(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
EFI_STATUS EFIAPI ReportDispatcher(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId OPTIONAL, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)