/** @file\r
\r
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#include <PiDxe.h>\r
\r
#include <Protocol/Reset.h>\r
+#include <Protocol/ResetNotification.h>\r
+#include <Protocol/PlatformSpecificResetFilter.h>\r
+#include <Protocol/PlatformSpecificResetHandler.h>\r
#include <Guid/CapsuleVendor.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/UefiRuntimeLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/ResetSystemLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+//\r
+// The maximum recurstion depth to ResetSystem() by reset notification handlers\r
+//\r
+#define MAX_RESET_NOTIFY_DEPTH 10\r
+\r
+typedef struct {\r
+ UINT32 Signature;\r
+ LIST_ENTRY Link;\r
+ EFI_RESET_SYSTEM ResetNotify;\r
+} RESET_NOTIFY_ENTRY;\r
+#define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')\r
+#define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)\r
+\r
+typedef struct {\r
+ UINT32 Signature;\r
+ EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification;\r
+ LIST_ENTRY ResetNotifies;\r
+} RESET_NOTIFICATION_INSTANCE;\r
+#define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')\r
+#define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \\r
+ CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)\r
\r
/**\r
The driver's entry point.\r
\r
It initializes the Reset Architectural Protocol.\r
\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image. \r
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
@param[in] SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The entry point is executed successfully.\r
@retval other Cannot install ResetArch protocol.\r
\r
\r
@param[in] ResetType The type of reset to perform.\r
@param[in] ResetStatus The status code for the reset.\r
- @param[in] DataSize The size, in bytes, of WatchdogData.\r
+ @param[in] DataSize The size, in bytes, of ResetData.\r
@param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
EfiResetShutdown the data buffer starts with a Null-terminated\r
string, optionally followed by additional binary data.\r
+ The string is a description that the caller may use to further\r
+ indicate the reason for the system reset. ResetData is only\r
+ valid if ResetStatus is something other than EFI_SUCCESS\r
+ unless the ResetType is EfiResetPlatformSpecific\r
+ where a minimum amount of ResetData is always required.\r
+ For a ResetType of EfiResetPlatformSpecific the data buffer\r
+ also starts with a Null-terminated string that is followed\r
+ by an EFI_GUID that describes the specific type of reset to perform.\r
\r
**/\r
VOID\r