--- /dev/null
+/** @file\r
+ \r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#include <Uefi.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/WinNtLib.h>\r
+\r
+/**\r
+ This function causes a system-wide reset (cold reset), in which\r
+ all circuitry within the system returns to its initial state. This type of reset \r
+ is asynchronous to system operation and operates without regard to\r
+ cycle boundaries.\r
+\r
+ If this function returns, it means that the system does not support cold reset. \r
+**/\r
+VOID\r
+EFIAPI\r
+ResetCold (\r
+ VOID\r
+ )\r
+{\r
+ gWinNt->ExitProcess (0);\r
+ ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+ This function causes a system-wide initialization (warm reset), in which all processors \r
+ are set to their initial state. Pending cycles are not corrupted.\r
+\r
+ If this function returns, it means that the system does not support warm reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetWarm (\r
+ VOID\r
+ )\r
+{\r
+ ResetCold ();\r
+}\r
+\r
+/**\r
+ This function causes the system to enter a power state equivalent \r
+ to the ACPI G2/S5 or G3 states.\r
+\r
+ If this function returns, it means that the system does not support shut down reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetShutdown (\r
+ VOID\r
+ )\r
+{\r
+ ResetCold ();\r
+}\r
+\r
+/**\r
+ This function causes the system to enter S3 and then wake up immediately.\r
+\r
+ If this function returns, it means that the system does not support S3 feature.\r
+**/\r
+VOID\r
+EFIAPI\r
+EnterS3WithImmediateWake (\r
+ VOID\r
+ )\r
+{\r
+ ResetCold ();\r
+}\r
+\r
+/**\r
+ This function causes a systemwide reset. The exact type of the reset is\r
+ defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r
+ into ResetData. If the platform does not recognize the EFI_GUID in ResetData\r
+ the platform must pick a supported reset type to perform.The platform may\r
+ optionally log the parameters from any non-normal reset that occurs.\r
+\r
+ @param[in] DataSize The size, in bytes, of ResetData.\r
+ @param[in] ResetData The data buffer starts with a Null-terminated string,\r
+ followed by the EFI_GUID.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetPlatformSpecific (\r
+ IN UINTN DataSize,\r
+ IN VOID *ResetData\r
+ )\r
+{\r
+ ResetCold ();\r
+}\r
--- /dev/null
+## @file\r
+# \r
+# Copyright (c) 2017, 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
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = Nt32ResetSystemLib\r
+ FILE_GUID = A7EBA1F6-5505-4fba-8895-386EE02B2FAC\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = ResetSystemLib\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32\r
+#\r
+\r
+[Sources]\r
+ ResetSystemLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ Nt32Pkg/Nt32Pkg.dec\r
+\r
+[LibraryClasses]\r
+ WinNtLib\r
+ DebugLib\r
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf\r
+ ResetSystemLib|Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf\r
!if $(TLS_ENABLE) == TRUE\r
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf\r
!else\r
}\r
Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
- Nt32Pkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
+ MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {\r
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
INF Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
INF Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
-INF Nt32Pkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
+INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf\r
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
+++ /dev/null
-## @file\r
-# NT Emulation Reset Architectural Protocol Driver as defined in TIANO\r
-#\r
-# This Reset module simulates system reset by process exit on NT.\r
-# Copyright (c) 2006 - 2010, 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
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = Reset\r
- FILE_GUID = BA929954-35B0-4dd3-90CD-9634BD7E1CF1\r
- MODULE_TYPE = DXE_DRIVER\r
- VERSION_STRING = 1.0\r
-\r
- ENTRY_POINT = InitializeNtReset\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-# VALID_ARCHITECTURES = IA32\r
-#\r
-\r
-[Sources]\r
- reset.c\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
- UefiBootServicesTableLib\r
- WinNtLib\r
- UefiDriverEntryPoint\r
- DebugLib\r
-\r
-[Protocols]\r
- gEfiResetArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[Depex]\r
- TRUE\r
-\r
+++ /dev/null
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- Reset.c\r
-\r
-Abstract:\r
-\r
- Reset Architectural Protocol as defined in Tiano under NT Emulation\r
-\r
-**/\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/Reset.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeNtReset (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- );\r
-\r
-VOID\r
-EFIAPI\r
-WinNtResetSystem (\r
- IN EFI_RESET_TYPE ResetType,\r
- IN EFI_STATUS ResetStatus,\r
- IN UINTN DataSize,\r
- IN VOID *ResetData OPTIONAL\r
- );\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeNtReset (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-\r
-Arguments:\r
-\r
- ImageHandle of the loaded driver\r
- Pointer to the System Table\r
-\r
-Returns:\r
-\r
- Status\r
---*/\r
-// TODO: SystemTable - add argument and description to function comment\r
-{\r
- EFI_STATUS Status;\r
- EFI_HANDLE Handle;\r
-\r
- SystemTable->RuntimeServices->ResetSystem = WinNtResetSystem;\r
-\r
- Handle = NULL;\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Handle,\r
- &gEfiResetArchProtocolGuid,\r
- NULL,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return Status;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-WinNtResetSystem (\r
- IN EFI_RESET_TYPE ResetType,\r
- IN EFI_STATUS ResetStatus,\r
- IN UINTN DataSize,\r
- IN VOID *ResetData OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- TODO: Add function description\r
-\r
-Arguments:\r
-\r
- ResetType - TODO: add argument description\r
- ResetStatus - TODO: add argument description\r
- DataSize - TODO: add argument description\r
- ResetData - TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
- //\r
- // BUGBUG Need to kill all console windows later\r
- //\r
- //\r
- // Discard ResetType, always return 0 as exit code\r
- //\r
- gWinNt->ExitProcess (0);\r
-\r
- //\r
- // Should never go here\r
- //\r
- ASSERT (FALSE);\r
-}\r