41 if (PpiList ==
NULL) {
42 return EFI_INVALID_PARAMETER;
47 PpiListPointer = &PrivateData->PpiData.
PpiList;
48 Index = PpiListPointer->CurrentCount;
63 if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) {
64 PpiListPointer->CurrentCount = LastCount;
65 DEBUG ((DEBUG_ERROR,
"ERROR -> InstallPpi: %g %p\n", PpiList->Guid, PpiList->Ppi));
66 return EFI_INVALID_PARAMETER;
69 if (Index >= PpiListPointer->MaxCount) {
73 ASSERT (Index < PpiListPointer->MaxCount);
76 DEBUG ((DEBUG_INFO,
"Install PPI: %g\n", PpiList->Guid));
79 PpiListPointer->CurrentCount++;
86 }
else if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) ==
87 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST)
106 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
108 PpiListPointer->CurrentCount,
169 if ((OldPpi ==
NULL) || (NewPpi ==
NULL)) {
170 return EFI_INVALID_PARAMETER;
173 if ((NewPpi->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) {
174 return EFI_INVALID_PARAMETER;
183 for (Index = 0; Index < PrivateData->PpiData.
PpiList.CurrentCount; Index++) {
189 if (Index == PrivateData->PpiData.
PpiList.CurrentCount) {
190 return EFI_NOT_FOUND;
196 DEBUG ((DEBUG_INFO,
"Reinstall PPI: %g\n", NewPpi->Guid));
204 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
250 for (Index = 0; Index < PrivateData->PpiData.
PpiList.CurrentCount; Index++) {
252 CheckGuid = TempPtr->
Guid;
259 if ((((INT32 *)Guid)[0] == ((INT32 *)CheckGuid)[0]) &&
260 (((INT32 *)Guid)[1] == ((INT32 *)CheckGuid)[1]) &&
261 (((INT32 *)Guid)[2] == ((INT32 *)CheckGuid)[2]) &&
262 (((INT32 *)Guid)[3] == ((INT32 *)CheckGuid)[3]))
265 if (PpiDescriptor !=
NULL) {
266 *PpiDescriptor = TempPtr;
280 return EFI_NOT_FOUND;
309 UINTN CallbackNotifyIndex;
310 UINTN LastCallbackNotifyCount;
312 UINTN DispatchNotifyIndex;
313 UINTN LastDispatchNotifyCount;
315 if (NotifyList ==
NULL) {
316 return EFI_INVALID_PARAMETER;
322 CallbackNotifyIndex = CallbackNotifyListPointer->CurrentCount;
323 LastCallbackNotifyCount = CallbackNotifyIndex;
326 DispatchNotifyIndex = DispatchNotifyListPointer->CurrentCount;
327 LastDispatchNotifyCount = DispatchNotifyIndex;
339 if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) == 0) {
340 CallbackNotifyListPointer->CurrentCount = LastCallbackNotifyCount;
341 DispatchNotifyListPointer->CurrentCount = LastDispatchNotifyCount;
342 DEBUG ((DEBUG_ERROR,
"ERROR -> NotifyPpi: %g %p\n", NotifyList->Guid, NotifyList->Notify));
343 return EFI_INVALID_PARAMETER;
346 if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK) != 0) {
347 if (CallbackNotifyIndex >= CallbackNotifyListPointer->MaxCount) {
351 ASSERT (CallbackNotifyIndex < CallbackNotifyListPointer->MaxCount);
355 CallbackNotifyIndex++;
356 CallbackNotifyListPointer->CurrentCount++;
358 ASSERT ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK) != 0);
361 DEBUG ((DEBUG_INFO,
"Register PPI Notify: %g\n", NotifyList->Guid));
368 }
else if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) ==
369 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST)
388 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
390 PrivateData->PpiData.
PpiList.CurrentCount,
391 LastCallbackNotifyCount,
392 CallbackNotifyListPointer->CurrentCount
438 IN INTN InstallStartIndex,
450 for (Index1 = NotifyStartIndex; Index1 < NotifyStopIndex; Index1++) {
451 if (NotifyType == EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK) {
452 NotifyDescriptor = PrivateData->PpiData.CallbackNotifyList.NotifyPtrs[Index1].
Notify;
454 NotifyDescriptor = PrivateData->PpiData.DispatchNotifyList.NotifyPtrs[Index1].
Notify;
457 CheckGuid = NotifyDescriptor->
Guid;
459 for (Index2 = InstallStartIndex; Index2 < InstallStopIndex; Index2++) {
460 SearchGuid = PrivateData->PpiData.PpiList.PpiPtrs[Index2].Ppi->Guid;
466 if ((((INT32 *)SearchGuid)[0] == ((INT32 *)CheckGuid)[0]) &&
467 (((INT32 *)SearchGuid)[1] == ((INT32 *)CheckGuid)[1]) &&
468 (((INT32 *)SearchGuid)[2] == ((INT32 *)CheckGuid)[2]) &&
469 (((INT32 *)SearchGuid)[3] == ((INT32 *)CheckGuid)[3]))
473 "Notify: PPI Guid: %g, Peim notify entry point: %p\n",
477 NotifyDescriptor->
Notify (
480 (PrivateData->PpiData.PpiList.PpiPtrs[Index2].Ppi)->Ppi
CONST EFI_PEI_SERVICES **EFIAPI GetPeiServicesTablePointer(VOID)
#define DEBUG(Expression)
#define PEI_CORE_INSTANCE_FROM_PS_THIS(a)
EFI_STATUS InternalPeiNotifyPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList, IN BOOLEAN Single)
VOID ProcessNotify(IN PEI_CORE_INSTANCE *PrivateData, IN UINTN NotifyType, IN INTN InstallStartIndex, IN INTN InstallStopIndex, IN INTN NotifyStartIndex, IN INTN NotifyStopIndex)
EFI_STATUS EFIAPI UnitTestInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI UnitTestNotifyPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI UnitTestLocatePpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI UnitTestReInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
EFI_STATUS InternalPeiInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, IN BOOLEAN Single)
EFI_PEIM_NOTIFY_ENTRY_POINT Notify
PEI_PPI_LIST_POINTERS * NotifyPtrs
PEI_CALLBACK_NOTIFY_LIST CallbackNotifyList
PEI_DISPATCH_NOTIFY_LIST DispatchNotifyList
PEI_PPI_LIST_POINTERS * PpiPtrs