summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-07-25 12:27:08 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-31 10:53:32 +0000
commit02f7ecbbb2da356585f5c4df4a5e7aa64a6b985d (patch)
treeff7629fc412f4ca2826d6e7f966b13d29b894fbb
parentf9b021f84fbb75d3c6f50bc079b49b816a210ec4 (diff)
downloadedk2-02f7ecbbb2da356585f5c4df4a5e7aa64a6b985d.tar.gz
edk2-02f7ecbbb2da356585f5c4df4a5e7aa64a6b985d.tar.bz2
edk2-02f7ecbbb2da356585f5c4df4a5e7aa64a6b985d.zip
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 <ardb@kernel.org>
-rw-r--r--EmbeddedPkg/EmbeddedPkg.dec1
-rw-r--r--EmbeddedPkg/EmbeddedPkg.dsc3
-rw-r--r--EmbeddedPkg/Include/Library/EfiResetSystemLib.h48
-rw-r--r--EmbeddedPkg/Library/TemplateResetSystemLib/ResetSystemLib.c91
-rw-r--r--EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf30
-rw-r--r--EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf45
-rw-r--r--EmbeddedPkg/ResetRuntimeDxe/reset.c64
7 files changed, 0 insertions, 282 deletions
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 {
<LibraryClasses>
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.<BR>
-
- 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.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <PiDxe.h>
-
-#include <Library/BaseLib.h>
-#include <Library/IoLib.h>
-#include <Library/EfiResetSystemLib.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
- )
-{
- 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.<BR>
-#
-# 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.<BR>
-#
-# 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.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <PiDxe.h>
-#include <Protocol/Reset.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/EfiResetSystemLib.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.
-
-**/
-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;
-}