13 L
"Cold", L
"Warm", L
"Shutdown", L
"PlatformSpecific"
21 &gEdkiiPlatformSpecificResetFilterPpiGuid,
22 &gEdkiiPlatformSpecificResetNotificationPpiGuid,
23 &gEdkiiPlatformSpecificResetHandlerPpiGuid
31 &gEdkiiPlatformSpecificResetFilterPpiGuid
39 &gEdkiiPlatformSpecificResetNotificationPpiGuid
47 &gEdkiiPlatformSpecificResetHandlerPpiGuid
52 EFI_PEI_PPI_DESCRIPTOR_PPI,
53 &gEfiPeiReset2PpiGuid,
57 EFI_PEI_PPI_DESCRIPTOR_PPI,
58 &gEdkiiPlatformSpecificResetFilterPpiGuid,
59 &mResetFilter.ResetFilter
62 EFI_PEI_PPI_DESCRIPTOR_PPI,
63 &gEdkiiPlatformSpecificResetNotificationPpiGuid,
64 &mResetNotification.ResetFilter
67 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
68 &gEdkiiPlatformSpecificResetHandlerPpiGuid,
69 &mResetHandler.ResetFilter
106 if (ResetFunction ==
NULL) {
107 return EFI_INVALID_PARAMETER;
112 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetFilterPpiGuid) ||
113 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetNotificationPpiGuid) ||
114 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetHandlerPpiGuid)
127 return EFI_OUT_OF_RESOURCES;
130 List->Signature = RESET_FILTER_LIST_SIGNATURE;
131 List->Count =
PcdGet32 (PcdMaximumPeiResetNotifies);
133 List->ResetFilters[0] = ResetFunction;
137 ASSERT (List->Signature == RESET_FILTER_LIST_SIGNATURE);
141 for (Index = 0; Index < List->Count; Index++) {
142 if (List->ResetFilters[Index] == ResetFunction) {
147 if (Index != List->Count) {
148 return EFI_ALREADY_STARTED;
154 for (Index = 0; Index < List->Count; Index++) {
155 if (List->ResetFilters[Index] ==
NULL) {
160 if (Index == List->Count) {
161 return EFI_OUT_OF_RESOURCES;
164 List->ResetFilters[Index] = ResetFunction;
196 if (ResetFunction ==
NULL) {
197 return EFI_INVALID_PARAMETER;
202 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetFilterPpiGuid) ||
203 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetNotificationPpiGuid) ||
204 CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetHandlerPpiGuid)
209 return EFI_INVALID_PARAMETER;
213 ASSERT (List->Signature == RESET_FILTER_LIST_SIGNATURE);
214 for (Index = 0; Index < List->Count; Index++) {
215 if (List->ResetFilters[Index] == ResetFunction) {
220 if (Index == List->Count) {
221 return EFI_INVALID_PARAMETER;
224 List->ResetFilters[Index] =
NULL;
252 if (Status != EFI_NOT_FOUND) {
253 return EFI_ALREADY_STARTED;
282 IN VOID *ResetData OPTIONAL
289 UINT8 RecursionDepth;
290 UINT8 *RecursionDepthPointer;
298 RecursionDepthPointer =
BuildGuidDataHob (&gEfiCallerIdGuid, &RecursionDepth,
sizeof (RecursionDepth));
300 RecursionDepthPointer = (UINT8 *)GET_GUID_HOB_DATA (Hob);
306 if (*RecursionDepthPointer == 0) {
316 (*RecursionDepthPointer)++;
317 DEBUG ((DEBUG_INFO,
"PEI ResetSystem2: Reset call depth = %d.\n", *RecursionDepthPointer));
319 if (*RecursionDepthPointer <= MAX_RESET_NOTIFY_DEPTH) {
323 for (OrderIndex = 0; OrderIndex <
ARRAY_SIZE (mProcessingOrder); OrderIndex++) {
327 ASSERT (List->Signature == RESET_FILTER_LIST_SIGNATURE);
329 for (Index = 0; Index < List->Count; Index++) {
330 if (List->ResetFilters[Index] !=
NULL) {
331 List->ResetFilters[Index](ResetType, ResetStatus, DataSize, ResetData);
337 ASSERT (ResetType <
ARRAY_SIZE (mResetTypeStr));
338 DEBUG ((DEBUG_ERROR,
"PEI ResetSystem2: Maximum reset call depth is met. Use the current reset type: %s!\n", mResetTypeStr[ResetType]));
VOID EFIAPI ResetWarm(VOID)
VOID EFIAPI ResetShutdown(VOID)
VOID EFIAPI ResetPlatformSpecific(IN UINTN DataSize, IN VOID *ResetData)
VOID EFIAPI ResetCold(VOID)
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
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)
#define ARRAY_SIZE(Array)
#define GLOBAL_REMOVE_IF_UNREFERENCED
#define DEBUG(Expression)
#define REPORT_STATUS_CODE(Type, Value)
#define PcdGet32(TokenName)
VOID * EFI_PEI_FILE_HANDLE
#define EFI_PROGRESS_CODE
EFI_STATUS EFIAPI RegisterResetNotify(IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
VOID EFIAPI ResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
EFI_STATUS EFIAPI UnregisterResetNotify(IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
EFI_STATUS EFIAPI InitializeResetSystem(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
@ EfiResetPlatformSpecific
VOID(EFIAPI * EFI_RESET_SYSTEM)(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)