MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message

The patch adds more debug message in ResetSystem().
It also removes unnecessary check of mResetNotifyDepth.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
(cherry picked from commit 4bf95a9f36)
This commit is contained in:
Ruiyu Ni
2017-09-05 11:29:00 +08:00
parent e21ccea66d
commit 917cb49e14

View File

@ -15,6 +15,10 @@
#include "ResetSystem.h" #include "ResetSystem.h"
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {
L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
};
// //
// The current ResetSystem() notification recursion depth // The current ResetSystem() notification recursion depth
// //
@ -251,16 +255,6 @@ ResetSystem (
LIST_ENTRY *Link; LIST_ENTRY *Link;
RESET_NOTIFY_ENTRY *Entry; RESET_NOTIFY_ENTRY *Entry;
//
// Above the maximum recursion depth, so do the smallest amount of
// work to perform a cold reset.
//
if (mResetNotifyDepth >= MAX_RESET_NOTIFY_DEPTH) {
ResetCold ();
ASSERT (FALSE);
return;
}
// //
// Only do REPORT_STATUS_CODE() on first call to ResetSystem() // Only do REPORT_STATUS_CODE() on first call to ResetSystem()
// //
@ -272,40 +266,47 @@ ResetSystem (
} }
mResetNotifyDepth++; mResetNotifyDepth++;
if (!EfiAtRuntime () && mResetNotifyDepth < MAX_RESET_NOTIFY_DEPTH) { DEBUG ((DEBUG_INFO, "DXE ResetSystem2: Reset call depth = %d.\n", mResetNotifyDepth));
//
// Call reset notification functions registered through the if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {
// EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL. if (!EfiAtRuntime ()) {
// //
for ( Link = GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies) // Call reset notification functions registered through the
; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link) // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link) //
) { for ( Link = GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies)
Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link)
Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); ; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link)
} ) {
// Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
// Call reset notification functions registered through the Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
// EFI_RESET_NOTIFICATION_PROTOCOL. }
// //
for ( Link = GetFirstNode (&mResetNotification.ResetNotifies) // Call reset notification functions registered through the
; !IsNull (&mResetNotification.ResetNotifies, Link) // EFI_RESET_NOTIFICATION_PROTOCOL.
; Link = GetNextNode (&mResetNotification.ResetNotifies, Link) //
) { for ( Link = GetFirstNode (&mResetNotification.ResetNotifies)
Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); ; !IsNull (&mResetNotification.ResetNotifies, Link)
Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); ; Link = GetNextNode (&mResetNotification.ResetNotifies, Link)
} ) {
// Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
// call reset notification functions registered through the Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
// EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL. }
// //
for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies) // call reset notification functions registered through the
; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link) // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.
; Link = GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link) //
) { for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies)
Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)
Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); ; Link = GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link)
) {
Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
}
} }
} else {
ASSERT (ResetType < ARRAY_SIZE (mResetTypeStr));
DEBUG ((DEBUG_ERROR, "DXE ResetSystem2: Maximum reset call depth is met. Use the current reset type: %s!\n", mResetTypeStr[ResetType]));
} }
switch (ResetType) { switch (ResetType) {
@ -331,7 +332,6 @@ ResetSystem (
} }
ResetWarm (); ResetWarm ();
break; break;
case EfiResetCold: case EfiResetCold: