diff options
| author | kx <kx@radix.pro> | 2024-06-04 06:43:08 +0300 |
|---|---|---|
| committer | kx <kx@radix.pro> | 2024-06-04 06:43:08 +0300 |
| commit | 7e2ccccace24636f29ddc210b94606abd4c7e42b (patch) | |
| tree | 545d43ea12671048956cafeb12303e84d601e571 /MdeModulePkg/Universal/ResetSystemRuntimeDxe | |
| parent | 27b044605cd5f6b33a3d231576003850b3fe305b (diff) | |
| download | edk2-trunk.tar.xz | |
Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305btrunk
Diffstat (limited to 'MdeModulePkg/Universal/ResetSystemRuntimeDxe')
5 files changed, 520 insertions, 520 deletions
diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c index 72bb1d2be6..ae1e763a7a 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c @@ -1,335 +1,335 @@ -/** @file
- Reset Architectural and Reset Notification protocols implementation.
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "ResetSystem.h"
-
-GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {
- L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
-};
-
-//
-// The current ResetSystem() notification recursion depth
-//
-UINTN mResetNotifyDepth = 0;
-
-/**
- Register a notification function to be called when ResetSystem() is called.
-
- The RegisterResetNotify() function registers a notification function that is called when
- ResetSystem()is called and prior to completing the reset of the platform.
- The registered functions must not perform a platform reset themselves. These
- notifications are intended only for the notification of components which may need some
- special-purpose maintenance prior to the platform resetting.
- The list of registered reset notification functions are processed if ResetSystem()is called
- before ExitBootServices(). The list of registered reset notification functions is ignored if
- ResetSystem()is called after ExitBootServices().
-
- @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
- @param[in] ResetFunction Points to the function to be called when a ResetSystem() is executed.
-
- @retval EFI_SUCCESS The reset notification function was successfully registered.
- @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register the reset notification function.
- @retval EFI_ALREADY_STARTED The reset notification function specified by ResetFunction has already been registered.
-
-**/
-EFI_STATUS
-EFIAPI
-RegisterResetNotify (
- IN EFI_RESET_NOTIFICATION_PROTOCOL *This,
- IN EFI_RESET_SYSTEM ResetFunction
- )
-{
- RESET_NOTIFICATION_INSTANCE *Instance;
- LIST_ENTRY *Link;
- RESET_NOTIFY_ENTRY *Entry;
-
- if (ResetFunction == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);
-
- for ( Link = GetFirstNode (&Instance->ResetNotifies)
- ; !IsNull (&Instance->ResetNotifies, Link)
- ; Link = GetNextNode (&Instance->ResetNotifies, Link)
- )
- {
- Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
- if (Entry->ResetNotify == ResetFunction) {
- return EFI_ALREADY_STARTED;
- }
- }
-
- ASSERT (IsNull (&Instance->ResetNotifies, Link));
- Entry = AllocatePool (sizeof (*Entry));
- if (Entry == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Entry->Signature = RESET_NOTIFY_ENTRY_SIGNATURE;
- Entry->ResetNotify = ResetFunction;
- InsertTailList (&Instance->ResetNotifies, &Entry->Link);
- return EFI_SUCCESS;
-}
-
-/**
- Unregister a notification function.
-
- The UnregisterResetNotify() function removes the previously registered
- notification using RegisterResetNotify().
-
- @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
- @param[in] ResetFunction The pointer to the ResetFunction being unregistered.
-
- @retval EFI_SUCCESS The reset notification function was unregistered.
- @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
- @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously
- registered using RegisterResetNotify().
-
-**/
-EFI_STATUS
-EFIAPI
-UnregisterResetNotify (
- IN EFI_RESET_NOTIFICATION_PROTOCOL *This,
- IN EFI_RESET_SYSTEM ResetFunction
- )
-{
- RESET_NOTIFICATION_INSTANCE *Instance;
- LIST_ENTRY *Link;
- RESET_NOTIFY_ENTRY *Entry;
-
- if (ResetFunction == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);
-
- for ( Link = GetFirstNode (&Instance->ResetNotifies)
- ; !IsNull (&Instance->ResetNotifies, Link)
- ; Link = GetNextNode (&Instance->ResetNotifies, Link)
- )
- {
- Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
- if (Entry->ResetNotify == ResetFunction) {
- RemoveEntryList (&Entry->Link);
- FreePool (Entry);
- return EFI_SUCCESS;
- }
- }
-
- return EFI_INVALID_PARAMETER;
-}
-
-RESET_NOTIFICATION_INSTANCE mResetNotification = {
- RESET_NOTIFICATION_INSTANCE_SIGNATURE,
- {
- RegisterResetNotify,
- UnregisterResetNotify
- },
- INITIALIZE_LIST_HEAD_VARIABLE (mResetNotification.ResetNotifies)
-};
-
-RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetFilter = {
- RESET_NOTIFICATION_INSTANCE_SIGNATURE,
- {
- RegisterResetNotify,
- UnregisterResetNotify
- },
- INITIALIZE_LIST_HEAD_VARIABLE (mPlatformSpecificResetFilter.ResetNotifies)
-};
-
-RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetHandler = {
- RESET_NOTIFICATION_INSTANCE_SIGNATURE,
- {
- RegisterResetNotify,
- UnregisterResetNotify
- },
- INITIALIZE_LIST_HEAD_VARIABLE (mPlatformSpecificResetHandler.ResetNotifies)
-};
-
-/**
- The driver's entry point.
-
- It initializes the Reset Architectural Protocol.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @retval other Cannot install ResetArch protocol.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeResetSystem (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- //
- // Make sure the Reset Architectural Protocol is not already installed in the system
- //
- ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiResetArchProtocolGuid);
-
- //
- // Hook the runtime service table
- //
- gRT->ResetSystem = RuntimeServiceResetSystem;
-
- //
- // Now install the Reset RT AP on a new handle
- //
- Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Handle,
- &gEfiResetArchProtocolGuid,
- NULL,
- &gEfiResetNotificationProtocolGuid,
- &mResetNotification.ResetNotification,
- &gEdkiiPlatformSpecificResetFilterProtocolGuid,
- &mPlatformSpecificResetFilter.ResetNotification,
- &gEdkiiPlatformSpecificResetHandlerProtocolGuid,
- &mPlatformSpecificResetHandler.ResetNotification,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- Resets the entire platform.
-
- @param[in] ResetType The type of reset to perform.
- @param[in] ResetStatus The status code for the reset.
- @param[in] DataSize The size, in bytes, of ResetData.
- @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
- EfiResetShutdown the data buffer starts with a Null-terminated
- string, optionally followed by additional binary data.
- The string is a description that the caller may use to further
- indicate the reason for the system reset.
- For a ResetType of EfiResetPlatformSpecific the data buffer
- also starts with a Null-terminated string that is followed
- by an EFI_GUID that describes the specific type of reset to perform.
-**/
-VOID
-EFIAPI
-RuntimeServiceResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN VOID *ResetData OPTIONAL
- )
-{
- LIST_ENTRY *Link;
- RESET_NOTIFY_ENTRY *Entry;
-
- //
- // Only do REPORT_STATUS_CODE() on first call to RuntimeServiceResetSystem()
- //
- if (mResetNotifyDepth == 0) {
- //
- // Indicate reset system runtime service is called.
- //
- REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_RS_PC_RESET_SYSTEM));
- }
-
- mResetNotifyDepth++;
- DEBUG ((
- DEBUG_INFO,
- "DXE ResetSystem2: ResetType %s, Call Depth = %d.\n",
- mResetTypeStr[ResetType],
- mResetNotifyDepth
- ));
-
- if ((ResetData != NULL) && (DataSize != 0)) {
- DEBUG ((
- DEBUG_INFO,
- "DXE ResetSystem2: ResetData: %s\n",
- ResetData
- ));
- }
-
- if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {
- if (!EfiAtRuntime ()) {
- //
- // Call reset notification functions registered through the
- // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
- //
- for ( Link = GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies)
- ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link)
- ; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link)
- )
- {
- Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
- Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
- }
-
- //
- // Call reset notification functions registered through the
- // EFI_RESET_NOTIFICATION_PROTOCOL.
- //
- for ( Link = GetFirstNode (&mResetNotification.ResetNotifies)
- ; !IsNull (&mResetNotification.ResetNotifies, Link)
- ; Link = GetNextNode (&mResetNotification.ResetNotifies, Link)
- )
- {
- Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
- Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
- }
-
- //
- // call reset notification functions registered through the
- // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.
- //
- for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies)
- ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)
- ; 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) {
- case EfiResetWarm:
-
- ResetWarm ();
- break;
-
- case EfiResetCold:
- ResetCold ();
- break;
-
- case EfiResetShutdown:
- ResetShutdown ();
- return;
-
- case EfiResetPlatformSpecific:
- ResetPlatformSpecific (DataSize, ResetData);
- return;
-
- default:
- return;
- }
-
- //
- // Given we should have reset getting here would be bad
- //
- ASSERT (FALSE);
-}
+/** @file + Reset Architectural and Reset Notification protocols implementation. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "ResetSystem.h" + +GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = { + L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific" +}; + +// +// The current ResetSystem() notification recursion depth +// +UINTN mResetNotifyDepth = 0; + +/** + Register a notification function to be called when ResetSystem() is called. + + The RegisterResetNotify() function registers a notification function that is called when + ResetSystem()is called and prior to completing the reset of the platform. + The registered functions must not perform a platform reset themselves. These + notifications are intended only for the notification of components which may need some + special-purpose maintenance prior to the platform resetting. + The list of registered reset notification functions are processed if ResetSystem()is called + before ExitBootServices(). The list of registered reset notification functions is ignored if + ResetSystem()is called after ExitBootServices(). + + @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance. + @param[in] ResetFunction Points to the function to be called when a ResetSystem() is executed. + + @retval EFI_SUCCESS The reset notification function was successfully registered. + @retval EFI_INVALID_PARAMETER ResetFunction is NULL. + @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register the reset notification function. + @retval EFI_ALREADY_STARTED The reset notification function specified by ResetFunction has already been registered. + +**/ +EFI_STATUS +EFIAPI +RegisterResetNotify ( + IN EFI_RESET_NOTIFICATION_PROTOCOL *This, + IN EFI_RESET_SYSTEM ResetFunction + ) +{ + RESET_NOTIFICATION_INSTANCE *Instance; + LIST_ENTRY *Link; + RESET_NOTIFY_ENTRY *Entry; + + if (ResetFunction == NULL) { + return EFI_INVALID_PARAMETER; + } + + Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This); + + for ( Link = GetFirstNode (&Instance->ResetNotifies) + ; !IsNull (&Instance->ResetNotifies, Link) + ; Link = GetNextNode (&Instance->ResetNotifies, Link) + ) + { + Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); + if (Entry->ResetNotify == ResetFunction) { + return EFI_ALREADY_STARTED; + } + } + + ASSERT (IsNull (&Instance->ResetNotifies, Link)); + Entry = AllocatePool (sizeof (*Entry)); + if (Entry == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Entry->Signature = RESET_NOTIFY_ENTRY_SIGNATURE; + Entry->ResetNotify = ResetFunction; + InsertTailList (&Instance->ResetNotifies, &Entry->Link); + return EFI_SUCCESS; +} + +/** + Unregister a notification function. + + The UnregisterResetNotify() function removes the previously registered + notification using RegisterResetNotify(). + + @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance. + @param[in] ResetFunction The pointer to the ResetFunction being unregistered. + + @retval EFI_SUCCESS The reset notification function was unregistered. + @retval EFI_INVALID_PARAMETER ResetFunction is NULL. + @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously + registered using RegisterResetNotify(). + +**/ +EFI_STATUS +EFIAPI +UnregisterResetNotify ( + IN EFI_RESET_NOTIFICATION_PROTOCOL *This, + IN EFI_RESET_SYSTEM ResetFunction + ) +{ + RESET_NOTIFICATION_INSTANCE *Instance; + LIST_ENTRY *Link; + RESET_NOTIFY_ENTRY *Entry; + + if (ResetFunction == NULL) { + return EFI_INVALID_PARAMETER; + } + + Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This); + + for ( Link = GetFirstNode (&Instance->ResetNotifies) + ; !IsNull (&Instance->ResetNotifies, Link) + ; Link = GetNextNode (&Instance->ResetNotifies, Link) + ) + { + Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); + if (Entry->ResetNotify == ResetFunction) { + RemoveEntryList (&Entry->Link); + FreePool (Entry); + return EFI_SUCCESS; + } + } + + return EFI_INVALID_PARAMETER; +} + +RESET_NOTIFICATION_INSTANCE mResetNotification = { + RESET_NOTIFICATION_INSTANCE_SIGNATURE, + { + RegisterResetNotify, + UnregisterResetNotify + }, + INITIALIZE_LIST_HEAD_VARIABLE (mResetNotification.ResetNotifies) +}; + +RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetFilter = { + RESET_NOTIFICATION_INSTANCE_SIGNATURE, + { + RegisterResetNotify, + UnregisterResetNotify + }, + INITIALIZE_LIST_HEAD_VARIABLE (mPlatformSpecificResetFilter.ResetNotifies) +}; + +RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetHandler = { + RESET_NOTIFICATION_INSTANCE_SIGNATURE, + { + RegisterResetNotify, + UnregisterResetNotify + }, + INITIALIZE_LIST_HEAD_VARIABLE (mPlatformSpecificResetHandler.ResetNotifies) +}; + +/** + The driver's entry point. + + It initializes the Reset Architectural Protocol. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Cannot install ResetArch protocol. + +**/ +EFI_STATUS +EFIAPI +InitializeResetSystem ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + // + // Make sure the Reset Architectural Protocol is not already installed in the system + // + ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiResetArchProtocolGuid); + + // + // Hook the runtime service table + // + gRT->ResetSystem = RuntimeServiceResetSystem; + + // + // Now install the Reset RT AP on a new handle + // + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiResetArchProtocolGuid, + NULL, + &gEfiResetNotificationProtocolGuid, + &mResetNotification.ResetNotification, + &gEdkiiPlatformSpecificResetFilterProtocolGuid, + &mPlatformSpecificResetFilter.ResetNotification, + &gEdkiiPlatformSpecificResetHandlerProtocolGuid, + &mPlatformSpecificResetHandler.ResetNotification, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} + +/** + Resets the entire platform. + + @param[in] ResetType The type of reset to perform. + @param[in] ResetStatus The status code for the reset. + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or + EfiResetShutdown the data buffer starts with a Null-terminated + string, optionally followed by additional binary data. + The string is a description that the caller may use to further + indicate the reason for the system reset. + For a ResetType of EfiResetPlatformSpecific the data buffer + also starts with a Null-terminated string that is followed + by an EFI_GUID that describes the specific type of reset to perform. +**/ +VOID +EFIAPI +RuntimeServiceResetSystem ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL + ) +{ + LIST_ENTRY *Link; + RESET_NOTIFY_ENTRY *Entry; + + // + // Only do REPORT_STATUS_CODE() on first call to RuntimeServiceResetSystem() + // + if (mResetNotifyDepth == 0) { + // + // Indicate reset system runtime service is called. + // + REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_RS_PC_RESET_SYSTEM)); + } + + mResetNotifyDepth++; + DEBUG (( + DEBUG_INFO, + "DXE ResetSystem2: ResetType %s, Call Depth = %d.\n", + mResetTypeStr[ResetType], + mResetNotifyDepth + )); + + if ((ResetData != NULL) && (DataSize != 0)) { + DEBUG (( + DEBUG_INFO, + "DXE ResetSystem2: ResetData: %s\n", + ResetData + )); + } + + if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) { + if (!EfiAtRuntime ()) { + // + // Call reset notification functions registered through the + // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL. + // + for ( Link = GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies) + ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link) + ; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link) + ) + { + Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + } + + // + // Call reset notification functions registered through the + // EFI_RESET_NOTIFICATION_PROTOCOL. + // + for ( Link = GetFirstNode (&mResetNotification.ResetNotifies) + ; !IsNull (&mResetNotification.ResetNotifies, Link) + ; Link = GetNextNode (&mResetNotification.ResetNotifies, Link) + ) + { + Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + } + + // + // call reset notification functions registered through the + // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL. + // + for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies) + ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link) + ; 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) { + case EfiResetWarm: + + ResetWarm (); + break; + + case EfiResetCold: + ResetCold (); + break; + + case EfiResetShutdown: + ResetShutdown (); + return; + + case EfiResetPlatformSpecific: + ResetPlatformSpecific (DataSize, ResetData); + return; + + default: + return; + } + + // + // Given we should have reset getting here would be bad + // + ASSERT (FALSE); +} diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h index 238d8a39ad..6cd18a8dc5 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h @@ -1,97 +1,97 @@ -/** @file
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _RESET_SYSTEM_H_
-#define _RESET_SYSTEM_H_
-
-#include <PiDxe.h>
-
-#include <Protocol/Reset.h>
-#include <Protocol/ResetNotification.h>
-#include <Protocol/PlatformSpecificResetFilter.h>
-#include <Protocol/PlatformSpecificResetHandler.h>
-#include <Guid/CapsuleVendor.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiRuntimeLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/ResetSystemLib.h>
-#include <Library/ReportStatusCodeLib.h>
-#include <Library/MemoryAllocationLib.h>
-
-//
-// The maximum recurstion depth to ResetSystem() by reset notification handlers
-//
-#define MAX_RESET_NOTIFY_DEPTH 10
-
-typedef struct {
- UINT32 Signature;
- LIST_ENTRY Link;
- EFI_RESET_SYSTEM ResetNotify;
-} RESET_NOTIFY_ENTRY;
-#define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')
-#define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)
-
-typedef struct {
- UINT32 Signature;
- EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification;
- LIST_ENTRY ResetNotifies;
-} RESET_NOTIFICATION_INSTANCE;
-#define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')
-#define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \
- CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)
-
-/**
- The driver's entry point.
-
- It initializes the Reset Architectural Protocol.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @retval other Cannot install ResetArch protocol.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeResetSystem (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Resets the entire platform.
-
- @param[in] ResetType The type of reset to perform.
- @param[in] ResetStatus The status code for the reset.
- @param[in] DataSize The size, in bytes, of ResetData.
- @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
- EfiResetShutdown the data buffer starts with a Null-terminated
- string, optionally followed by additional binary data.
- The string is a description that the caller may use to further
- indicate the reason for the system reset.
- For a ResetType of EfiResetPlatformSpecific the data buffer
- also starts with a Null-terminated string that is followed
- by an EFI_GUID that describes the specific type of reset to perform.
-
-**/
-VOID
-EFIAPI
-RuntimeServiceResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN VOID *ResetData OPTIONAL
- );
-
-#endif
+/** @file + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _RESET_SYSTEM_H_ +#define _RESET_SYSTEM_H_ + +#include <PiDxe.h> + +#include <Protocol/Reset.h> +#include <Protocol/ResetNotification.h> +#include <Protocol/PlatformSpecificResetFilter.h> +#include <Protocol/PlatformSpecificResetHandler.h> +#include <Guid/CapsuleVendor.h> + +#include <Library/BaseLib.h> +#include <Library/DebugLib.h> +#include <Library/UefiLib.h> +#include <Library/UefiDriverEntryPoint.h> +#include <Library/UefiBootServicesTableLib.h> +#include <Library/UefiRuntimeLib.h> +#include <Library/UefiRuntimeServicesTableLib.h> +#include <Library/ResetSystemLib.h> +#include <Library/ReportStatusCodeLib.h> +#include <Library/MemoryAllocationLib.h> + +// +// The maximum recurstion depth to ResetSystem() by reset notification handlers +// +#define MAX_RESET_NOTIFY_DEPTH 10 + +typedef struct { + UINT32 Signature; + LIST_ENTRY Link; + EFI_RESET_SYSTEM ResetNotify; +} RESET_NOTIFY_ENTRY; +#define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n') +#define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE) + +typedef struct { + UINT32 Signature; + EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification; + LIST_ENTRY ResetNotifies; +} RESET_NOTIFICATION_INSTANCE; +#define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i') +#define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \ + CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE) + +/** + The driver's entry point. + + It initializes the Reset Architectural Protocol. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Cannot install ResetArch protocol. + +**/ +EFI_STATUS +EFIAPI +InitializeResetSystem ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + +/** + Resets the entire platform. + + @param[in] ResetType The type of reset to perform. + @param[in] ResetStatus The status code for the reset. + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or + EfiResetShutdown the data buffer starts with a Null-terminated + string, optionally followed by additional binary data. + The string is a description that the caller may use to further + indicate the reason for the system reset. + For a ResetType of EfiResetPlatformSpecific the data buffer + also starts with a Null-terminated string that is followed + by an EFI_GUID that describes the specific type of reset to perform. + +**/ +VOID +EFIAPI +RuntimeServiceResetSystem ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL + ); + +#endif diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf index a11e38b5b6..00f081a3b5 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf @@ -1,60 +1,60 @@ -## @file
-# This driver implements Reset Architectural and Reset Notification protocols.
-#
-# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = ResetSystemRuntimeDxe
- MODULE_UNI_FILE = ResetSystemRuntimeDxe.uni
- FILE_GUID = 4B28E4C7-FF36-4e10-93CF-A82159E777C5
- MODULE_TYPE = DXE_RUNTIME_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeResetSystem
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- ResetSystem.h
- ResetSystem.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- ResetSystemLib
- UefiRuntimeServicesTableLib
- UefiRuntimeLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- UefiLib
- DebugLib
- BaseLib
- ReportStatusCodeLib
- MemoryAllocationLib
-
-[Guids]
- gEfiCapsuleVendorGuid ## SOMETIMES_CONSUMES ## Variable:L"CapsuleUpdateData"
-
-
-[Protocols]
- gEfiResetArchProtocolGuid ## PRODUCES
- gEfiResetNotificationProtocolGuid ## PRODUCES
- gEdkiiPlatformSpecificResetFilterProtocolGuid ## PRODUCES
- gEdkiiPlatformSpecificResetHandlerProtocolGuid ## PRODUCES
-
-[Depex]
- TRUE
-
-[UserExtensions.TianoCore."ExtraFiles"]
- ResetSystemRuntimeDxeExtra.uni
+## @file +# This driver implements Reset Architectural and Reset Notification protocols. +# +# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ResetSystemRuntimeDxe + MODULE_UNI_FILE = ResetSystemRuntimeDxe.uni + FILE_GUID = 4B28E4C7-FF36-4e10-93CF-A82159E777C5 + MODULE_TYPE = DXE_RUNTIME_DRIVER + VERSION_STRING = 1.0 + + ENTRY_POINT = InitializeResetSystem + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + ResetSystem.h + ResetSystem.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + ResetSystemLib + UefiRuntimeServicesTableLib + UefiRuntimeLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + DebugLib + BaseLib + ReportStatusCodeLib + MemoryAllocationLib + +[Guids] + gEfiCapsuleVendorGuid ## SOMETIMES_CONSUMES ## Variable:L"CapsuleUpdateData" + + +[Protocols] + gEfiResetArchProtocolGuid ## PRODUCES + gEfiResetNotificationProtocolGuid ## PRODUCES + gEdkiiPlatformSpecificResetFilterProtocolGuid ## PRODUCES + gEdkiiPlatformSpecificResetHandlerProtocolGuid ## PRODUCES + +[Depex] + TRUE + +[UserExtensions.TianoCore."ExtraFiles"] + ResetSystemRuntimeDxeExtra.uni diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.uni b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.uni index 504029da62..d2ee552d69 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.uni +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.uni @@ -1,14 +1,14 @@ -// /** @file
-// This driver implements Reset Architectural and Reset Notification protocols.
-//
-// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Implements Reset Architectural and Reset Notification protocols"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This driver implements Reset Architectural and Reset Notification protocols."
-
+// /** @file +// This driver implements Reset Architectural and Reset Notification protocols. +// +// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Implements Reset Architectural and Reset Notification protocols" + +#string STR_MODULE_DESCRIPTION #language en-US "This driver implements Reset Architectural and Reset Notification protocols." + diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxeExtra.uni b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxeExtra.uni index f799dad2b4..1c469c98e3 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxeExtra.uni +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxeExtra.uni @@ -1,14 +1,14 @@ -// /** @file
-// ResetSystemRuntimeDxe Localized Strings and Content
-//
-// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// **/
-
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
-"Reset System DXE Driver"
-
-
+// /** @file +// ResetSystemRuntimeDxe Localized Strings and Content +// +// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR> +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + +#string STR_PROPERTIES_MODULE_NAME +#language en-US +"Reset System DXE Driver" + + |
