13 L
"Cold", L
"Warm", L
"Shutdown", L
"PlatformSpecific"
19UINTN mResetNotifyDepth = 0;
53 if (ResetFunction ==
NULL) {
54 return EFI_INVALID_PARAMETER;
57 Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);
60 ; !
IsNull (&Instance->ResetNotifies, Link)
61 ; Link =
GetNextNode (&Instance->ResetNotifies, Link)
64 Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
65 if (Entry->ResetNotify == ResetFunction) {
66 return EFI_ALREADY_STARTED;
70 ASSERT (
IsNull (&Instance->ResetNotifies, Link));
73 return EFI_OUT_OF_RESOURCES;
76 Entry->Signature = RESET_NOTIFY_ENTRY_SIGNATURE;
77 Entry->ResetNotify = ResetFunction;
108 if (ResetFunction ==
NULL) {
109 return EFI_INVALID_PARAMETER;
112 Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);
115 ; !
IsNull (&Instance->ResetNotifies, Link)
116 ; Link =
GetNextNode (&Instance->ResetNotifies, Link)
119 Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
120 if (Entry->ResetNotify == ResetFunction) {
127 return EFI_INVALID_PARAMETER;
131 RESET_NOTIFICATION_INSTANCE_SIGNATURE,
140 RESET_NOTIFICATION_INSTANCE_SIGNATURE,
149 RESET_NOTIFICATION_INSTANCE_SIGNATURE,
193 Status =
gBS->InstallMultipleProtocolInterfaces (
195 &gEfiResetArchProtocolGuid,
197 &gEfiResetNotificationProtocolGuid,
198 &mResetNotification.ResetNotification,
199 &gEdkiiPlatformSpecificResetFilterProtocolGuid,
200 &mPlatformSpecificResetFilter.ResetNotification,
201 &gEdkiiPlatformSpecificResetHandlerProtocolGuid,
202 &mPlatformSpecificResetHandler.ResetNotification,
231 IN VOID *ResetData OPTIONAL
240 if (mResetNotifyDepth == 0) {
250 "DXE ResetSystem2: ResetType %s, Call Depth = %d.\n",
251 mResetTypeStr[ResetType],
255 if ((ResetData !=
NULL) && (DataSize != 0)) {
258 "DXE ResetSystem2: ResetData: %s\n",
263 if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {
269 for ( Link =
GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies)
270 ; !
IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link)
271 ; Link =
GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link)
274 Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
275 Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
282 for ( Link =
GetFirstNode (&mResetNotification.ResetNotifies)
283 ; !
IsNull (&mResetNotification.ResetNotifies, Link)
284 ; Link =
GetNextNode (&mResetNotification.ResetNotifies, Link)
287 Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
288 Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
295 for ( Link =
GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies)
296 ; !
IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)
297 ; Link =
GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link)
300 Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
301 Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
305 ASSERT (ResetType <
ARRAY_SIZE (mResetTypeStr));
306 DEBUG ((DEBUG_ERROR,
"DXE 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)
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_RUNTIME_SERVICES * gRT
#define ARRAY_SIZE(Array)
#define GLOBAL_REMOVE_IF_UNREFERENCED
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
#define REPORT_STATUS_CODE(Type, Value)
#define EFI_PROGRESS_CODE
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI RegisterResetNotify(IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
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)
VOID EFIAPI RuntimeServiceResetSystem(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
@ EfiResetPlatformSpecific
BOOLEAN EFIAPI EfiAtRuntime(VOID)
VOID(EFIAPI * EFI_RESET_SYSTEM)(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)