]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
OvmfPkg: report support for the PIIX3 reset register in the FADT
[mirror_edk2.git] / OvmfPkg / Library / ResetSystemLib / ResetSystemLib.c
CommitLineData
7ca30a6a 1/** @file\r
2 Reset System Library functions for OVMF\r
3\r
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <Base.h>\r
16\r
17#include <Library/BaseLib.h>\r
18#include <Library/DebugLib.h>\r
19#include <Library/IoLib.h>\r
20\r
21VOID\r
22AcpiPmControl (\r
23 UINTN SuspendType\r
24 )\r
25{\r
26 ASSERT (SuspendType < 6);\r
27\r
46316448 28 IoAndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10));\r
7ca30a6a 29 IoOr16 (0x404, BIT13);\r
30 CpuDeadLoop ();\r
31}\r
32\r
33/**\r
34 Calling this function causes a system-wide reset. This sets\r
35 all circuitry within the system to its initial state. This type of reset\r
36 is asynchronous to system operation and operates without regard to\r
37 cycle boundaries.\r
38\r
39 System reset should not return, if it returns, it means the system does\r
40 not support cold reset.\r
41**/\r
42VOID\r
43EFIAPI\r
44ResetCold (\r
45 VOID\r
46 )\r
47{\r
48 IoWrite8 (0x64, 0xfe);\r
49}\r
50\r
51/**\r
52 Calling this function causes a system-wide initialization. The processors\r
53 are set to their initial state, and pending cycles are not corrupted.\r
54\r
55 System reset should not return, if it returns, it means the system does\r
56 not support warm reset.\r
57**/\r
58VOID\r
59EFIAPI\r
60ResetWarm (\r
61 VOID\r
62 )\r
63{\r
64 IoWrite8 (0x64, 0xfe);\r
65}\r
66\r
67/**\r
68 Calling this function causes the system to enter a power state equivalent\r
69 to the ACPI G2/S5 or G3 states.\r
70\r
71 System shutdown should not return, if it returns, it means the system does\r
72 not support shut down reset.\r
73**/\r
74VOID\r
75EFIAPI\r
76ResetShutdown (\r
77 VOID\r
78 )\r
79{\r
80 AcpiPmControl (0);\r
81 ASSERT (FALSE);\r
82}\r
83\r
84\r
85/**\r
86 Calling this function causes the system to enter a power state for capsule\r
87 update.\r
88\r
89 Reset update should not return, if it returns, it means the system does\r
90 not support capsule update.\r
91\r
92**/\r
93VOID\r
94EFIAPI\r
95EnterS3WithImmediateWake (\r
96 VOID\r
97 )\r
98{\r
99 AcpiPmControl (1);\r
100 ASSERT (FALSE);\r
101}\r