--- /dev/null
+/** @file\r
+ Reset System Library functions for OVMF\r
+\r
+ Copyright (c) 2006 - 2011, 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
+\r
+#include <Base.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/IoLib.h>\r
+\r
+VOID\r
+AcpiPmControl (\r
+ UINTN SuspendType\r
+ )\r
+{\r
+ ASSERT (SuspendType < 6);\r
+\r
+ IoAndThenOr16 (0x404, ~0x3c00, SuspendType << 10);\r
+ IoOr16 (0x404, BIT13);\r
+ CpuDeadLoop ();\r
+}\r
+\r
+/**\r
+ Calling this function causes a system-wide reset. This sets\r
+ all circuitry within the system to its initial state. This type of reset\r
+ is asynchronous to system operation and operates without regard to\r
+ cycle boundaries.\r
+\r
+ System reset should not return, if it returns, it means the system does\r
+ not support cold reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetCold (\r
+ VOID\r
+ )\r
+{\r
+ IoWrite8 (0x64, 0xfe);\r
+}\r
+\r
+/**\r
+ Calling this function causes a system-wide initialization. The processors\r
+ are set to their initial state, and pending cycles are not corrupted.\r
+\r
+ System reset should not return, if it returns, it means the system does\r
+ not support warm reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetWarm (\r
+ VOID\r
+ )\r
+{\r
+ IoWrite8 (0x64, 0xfe);\r
+}\r
+\r
+/**\r
+ Calling this function causes the system to enter a power state equivalent\r
+ to the ACPI G2/S5 or G3 states.\r
+\r
+ System shutdown should not return, if it returns, it means the system does\r
+ not support shut down reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetShutdown (\r
+ VOID\r
+ )\r
+{\r
+ AcpiPmControl (0);\r
+ ASSERT (FALSE);\r
+}\r
+\r
+\r
+/**\r
+ Calling this function causes the system to enter a power state for capsule\r
+ update.\r
+\r
+ Reset update should not return, if it returns, it means the system does\r
+ not support capsule update.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnterS3WithImmediateWake (\r
+ VOID\r
+ )\r
+{\r
+ AcpiPmControl (1);\r
+ ASSERT (FALSE);\r
+}\r
--- /dev/null
+## @file\r
+# Library instance for ResetSystem library class for OVMF\r
+#\r
+# Copyright (c) 2006 - 2011, 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
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = ResetSystemLib\r
+ FILE_GUID = 66564872-21d4-4d2a-a68b-1e844f980820\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 X64 IPF\r
+#\r
+\r
+[Sources]\r
+ ResetSystemLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+ DebugLib\r
+ IoLib\r
+\r
## @file\r
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform\r
#\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, 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
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
!endif\r
\r
- ResetSystemLib|PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
+ ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
\r
[LibraryClasses.common.SEC]\r
## @file\r
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform\r
#\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, 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
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
!endif\r
\r
- ResetSystemLib|PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
+ ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
\r
[LibraryClasses.common.SEC]\r
## @file\r
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform\r
#\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, 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
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
!endif\r
\r
- ResetSystemLib|PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
+ ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
\r
[LibraryClasses.common.SEC]\r