From 02f7ecbbb2da356585f5c4df4a5e7aa64a6b985d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 25 Jul 2024 12:27:08 +0200 Subject: EmbeddedPkg: Retire EfiResetSystemLib and ResetRuntimeDxe Retire the ancient reset runtime DXE in EmbeddedPkg, and the associated EfiResetSystemLib library class and template implementation. These are incomplete and have been superseded by a generic implementation in MdeModulePkg. Signed-off-by: Ard Biesheuvel --- EmbeddedPkg/EmbeddedPkg.dec | 1 - EmbeddedPkg/EmbeddedPkg.dsc | 3 - EmbeddedPkg/Include/Library/EfiResetSystemLib.h | 48 ------------ .../TemplateResetSystemLib/ResetSystemLib.c | 91 ---------------------- .../TemplateResetSystemLib.inf | 30 ------- EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf | 45 ----------- EmbeddedPkg/ResetRuntimeDxe/reset.c | 64 --------------- 7 files changed, 282 deletions(-) delete mode 100644 EmbeddedPkg/Include/Library/EfiResetSystemLib.h delete mode 100644 EmbeddedPkg/Library/TemplateResetSystemLib/ResetSystemLib.c delete mode 100644 EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf delete mode 100644 EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf delete mode 100644 EmbeddedPkg/ResetRuntimeDxe/reset.c diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 3497fa1df7..bb0b677bdc 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -33,7 +33,6 @@ [LibraryClasses.common] PrePiLib|Include/Library/PrePiLib.h RealTimeClockLib|Include/Library/RealTimeClockLib.h - EfiResetSystemLib|Include/Library/EfiResetSystemLib.h GdbSerialLib|Include/Library/GdbSerialLib.h DebugAgentTimerLib|Include/Library/DebugAgentTimerLib.h NorFlashInfoLib|Include/Library/NorFlashInfoLib.h diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc index ef66aea29d..e89bfae72c 100644 --- a/EmbeddedPkg/EmbeddedPkg.dsc +++ b/EmbeddedPkg/EmbeddedPkg.dsc @@ -66,7 +66,6 @@ SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf - EfiResetSystemLib|EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf GdbSerialLib|EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.inf @@ -211,7 +210,6 @@ EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.inf EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf EmbeddedPkg/Library/PrePiLib/PrePiLib.inf - EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf @@ -220,7 +218,6 @@ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf - EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf { diff --git a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h b/EmbeddedPkg/Include/Library/EfiResetSystemLib.h deleted file mode 100644 index 5bfebfc638..0000000000 --- a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h +++ /dev/null @@ -1,48 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __EFI_RESET_SYSTEM_LIB_H___ -#define __EFI_RESET_SYSTEM_LIB_H___ - -/** - Resets the entire platform. - - @param ResetType The type of reset to perform. - @param ResetStatus The status code for the reset. - @param DataSize The size, in bytes, of WatchdogData. - @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or - EfiResetShutdown the data buffer starts with a Null-terminated - Unicode string, optionally followed by additional binary data. - -**/ -EFI_STATUS -EFIAPI -LibResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN CHAR16 *ResetData OPTIONAL - ); - -/** - Initialize any infrastructure required for LibResetSystem () to function. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -LibInitializeResetSystem ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - -#endif diff --git a/EmbeddedPkg/Library/TemplateResetSystemLib/ResetSystemLib.c b/EmbeddedPkg/Library/TemplateResetSystemLib/ResetSystemLib.c deleted file mode 100644 index 60bbaeb6a8..0000000000 --- a/EmbeddedPkg/Library/TemplateResetSystemLib/ResetSystemLib.c +++ /dev/null @@ -1,91 +0,0 @@ -/** @file - Template library implementation to support ResetSystem Runtime call. - - Fill in the templates with what ever makes you system reset. - - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include - -#include -#include -#include - -/** - Resets the entire platform. - - @param ResetType The type of reset to perform. - @param ResetStatus The status code for the reset. - @param DataSize The size, in bytes, of WatchdogData. - @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or - EfiResetShutdown the data buffer starts with a Null-terminated - Unicode string, optionally followed by additional binary data. - -**/ -EFI_STATUS -EFIAPI -LibResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN CHAR16 *ResetData OPTIONAL - ) -{ - UINTN Address; - UINT8 Data; - - switch (ResetType) { - case EfiResetCold: - // system power cycle - - // Example using IoLib functions to do IO. - Address = 0x12345678; - Data = MmioRead8 (Address); - MmioWrite8 (Address, Data | 0x01); - - // Note this is a bad example asa MmioOr8 (Address, 0x01) does the same thing - break; - - case EfiResetWarm: - // not a full power cycle, maybe memory stays around. - // if not support do the same thing as EfiResetCold. - break; - - case EfiResetShutdown: - // turn off the system. - // if not support do the same thing as EfiResetCold. - break; - - default: - return EFI_INVALID_PARAMETER; - } - - // - // If we reset, we would not have returned... - // - return EFI_DEVICE_ERROR; -} - -/** - Initialize any infrastructure required for LibResetSystem () to function. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -LibInitializeResetSystem ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - return EFI_SUCCESS; -} diff --git a/EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf b/EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf deleted file mode 100644 index cd7a9f845d..0000000000 --- a/EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf +++ /dev/null @@ -1,30 +0,0 @@ -#/** @file -# Memory Status Code Library for UEFI drivers -# -# Lib to provide memory journal status code reporting Routines -# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = TemplateResetSystemLib - FILE_GUID = 40BAFDE5-4CC8-4FBE-A8BA-071890076E50 - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = EfiResetSystemLib - - -[Sources.common] - ResetSystemLib.c - -[Packages] - MdePkg/MdePkg.dec - EmbeddedPkg/EmbeddedPkg.dec - -[LibraryClasses] - IoLib - DebugLib diff --git a/EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf b/EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf deleted file mode 100644 index fdb93bf179..0000000000 --- a/EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf +++ /dev/null @@ -1,45 +0,0 @@ -#/** @file -# Reset Architectural Protocol Driver as defined in PI -# -# This Reset module simulates system reset by process exit on NT. -# Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = Reset - FILE_GUID = 16036A73-E8EF-46D0-953C-9B8E96527D13 - MODULE_TYPE = DXE_RUNTIME_DRIVER - VERSION_STRING = 1.0 - - ENTRY_POINT = InitializeReset - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 -# - -[Sources.common] - reset.c - -[Packages] - MdePkg/MdePkg.dec - EmbeddedPkg/EmbeddedPkg.dec - -[LibraryClasses] - UefiBootServicesTableLib - UefiDriverEntryPoint - DebugLib - EfiResetSystemLib - -[Protocols] - gEfiResetArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED - -[Depex] - TRUE - diff --git a/EmbeddedPkg/ResetRuntimeDxe/reset.c b/EmbeddedPkg/ResetRuntimeDxe/reset.c deleted file mode 100644 index 213963b519..0000000000 --- a/EmbeddedPkg/ResetRuntimeDxe/reset.c +++ /dev/null @@ -1,64 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include - -/** - Resets the entire platform. - - @param ResetType The type of reset to perform. - @param ResetStatus The status code for the reset. - @param DataSize The size, in bytes, of WatchdogData. - @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or - EfiResetShutdown the data buffer starts with a Null-terminated - Unicode string, optionally followed by additional binary data. - -**/ -VOID -EFIAPI -ResetSystemViaLib ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN VOID *ResetData OPTIONAL - ) -{ - LibResetSystem (ResetType, ResetStatus, DataSize, ResetData); - return; -} - -EFI_STATUS -EFIAPI -InitializeReset ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - EFI_HANDLE Handle; - - LibInitializeResetSystem (ImageHandle, SystemTable); - - SystemTable->RuntimeServices->ResetSystem = ResetSystemViaLib; - - Handle = NULL; - Status = gBS->InstallMultipleProtocolInterfaces ( - &Handle, - &gEfiResetArchProtocolGuid, - NULL, - NULL - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} -- cgit v1.2.3