]>
Commit | Line | Data |
---|---|---|
c07b2a9f | 1 | /** @file\r |
2 | Reset System Library functions for PCAT platforms\r | |
3 | \r | |
b700a827 | 4 | Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r |
e1d302e5 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
c07b2a9f | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include <Base.h>\r | |
10 | \r | |
b700a827 ZG |
11 | #include <Uefi/UefiBaseType.h>\r |
12 | #include <Uefi/UefiMultiPhase.h>\r | |
13 | \r | |
c07b2a9f | 14 | #include <Library/DebugLib.h>\r |
15 | #include <Library/IoLib.h>\r | |
16 | \r | |
17 | /**\r | |
18 | Calling this function causes a system-wide reset. This sets\r | |
19 | all circuitry within the system to its initial state. This type of reset\r | |
20 | is asynchronous to system operation and operates without regard to\r | |
21 | cycle boundaries.\r | |
22 | \r | |
23 | System reset should not return, if it returns, it means the system does\r | |
24 | not support cold reset.\r | |
25 | **/\r | |
26 | VOID\r | |
27 | EFIAPI\r | |
28 | ResetCold (\r | |
29 | VOID\r | |
30 | )\r | |
31 | {\r | |
631c9427 | 32 | IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));\r |
c07b2a9f | 33 | }\r |
34 | \r | |
35 | /**\r | |
36 | Calling this function causes a system-wide initialization. The processors\r | |
37 | are set to their initial state, and pending cycles are not corrupted.\r | |
38 | \r | |
39 | System reset should not return, if it returns, it means the system does\r | |
40 | not support warm reset.\r | |
41 | **/\r | |
42 | VOID\r | |
43 | EFIAPI\r | |
44 | ResetWarm (\r | |
45 | VOID\r | |
46 | )\r | |
47 | {\r | |
631c9427 | 48 | IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));\r |
c07b2a9f | 49 | }\r |
50 | \r | |
51 | /**\r | |
52 | Calling this function causes the system to enter a power state equivalent\r | |
53 | to the ACPI G2/S5 or G3 states.\r | |
54 | \r | |
55 | System shutdown should not return, if it returns, it means the system does\r | |
56 | not support shut down reset.\r | |
57 | **/\r | |
58 | VOID\r | |
59 | EFIAPI\r | |
60 | ResetShutdown (\r | |
61 | VOID\r | |
62 | )\r | |
63 | {\r | |
64 | ASSERT (FALSE);\r | |
65 | }\r | |
66 | \r | |
67 | \r | |
68 | /**\r | |
69 | Calling this function causes the system to enter a power state for capsule\r | |
70 | update.\r | |
71 | \r | |
72 | Reset update should not return, if it returns, it means the system does\r | |
73 | not support capsule update.\r | |
74 | \r | |
75 | **/\r | |
76 | VOID\r | |
77 | EFIAPI\r | |
78 | EnterS3WithImmediateWake (\r | |
79 | VOID\r | |
80 | )\r | |
81 | {\r | |
82 | ASSERT (FALSE);\r | |
83 | }\r | |
1b22c63a RN |
84 | \r |
85 | /**\r | |
86 | This function causes a systemwide reset. The exact type of the reset is\r | |
87 | defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r | |
88 | into ResetData. If the platform does not recognize the EFI_GUID in ResetData\r | |
89 | the platform must pick a supported reset type to perform.The platform may\r | |
90 | optionally log the parameters from any non-normal reset that occurs.\r | |
91 | \r | |
92 | @param[in] DataSize The size, in bytes, of ResetData.\r | |
93 | @param[in] ResetData The data buffer starts with a Null-terminated string,\r | |
94 | followed by the EFI_GUID.\r | |
95 | **/\r | |
96 | VOID\r | |
97 | EFIAPI\r | |
98 | ResetPlatformSpecific (\r | |
99 | IN UINTN DataSize,\r | |
100 | IN VOID *ResetData\r | |
101 | )\r | |
102 | {\r | |
103 | ResetCold ();\r | |
104 | }\r | |
b700a827 ZG |
105 | \r |
106 | /**\r | |
107 | The ResetSystem function resets the entire platform.\r | |
108 | \r | |
109 | @param[in] ResetType The type of reset to perform.\r | |
110 | @param[in] ResetStatus The status code for the reset.\r | |
111 | @param[in] DataSize The size, in bytes, of ResetData.\r | |
112 | @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r | |
113 | the data buffer starts with a Null-terminated string, optionally\r | |
114 | followed by additional binary data. The string is a description\r | |
115 | that the caller may use to further indicate the reason for the\r | |
116 | system reset.\r | |
117 | **/\r | |
118 | VOID\r | |
119 | EFIAPI\r | |
120 | ResetSystem (\r | |
121 | IN EFI_RESET_TYPE ResetType,\r | |
122 | IN EFI_STATUS ResetStatus,\r | |
123 | IN UINTN DataSize,\r | |
124 | IN VOID *ResetData OPTIONAL\r | |
125 | )\r | |
126 | {\r | |
127 | switch (ResetType) {\r | |
128 | case EfiResetWarm:\r | |
129 | ResetWarm ();\r | |
130 | break;\r | |
131 | \r | |
132 | case EfiResetCold:\r | |
133 | ResetCold ();\r | |
134 | break;\r | |
135 | \r | |
136 | case EfiResetShutdown:\r | |
137 | ResetShutdown ();\r | |
138 | return;\r | |
139 | \r | |
140 | case EfiResetPlatformSpecific:\r | |
141 | ResetPlatformSpecific (DataSize, ResetData);\r | |
142 | return;\r | |
143 | \r | |
144 | default:\r | |
145 | return;\r | |
146 | }\r | |
147 | }\r |