]>
Commit | Line | Data |
---|---|---|
ce3cd892 MK |
1 | /** @file\r |
2 | DXE Reset System Library instance that calls gRT->ResetSystem().\r | |
3 | \r | |
6b20fd3d | 4 | Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>\r |
ce3cd892 MK |
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 <PiDxe.h>\r | |
16 | #include <Library/ResetSystemLib.h>\r | |
6c252691 | 17 | #include <Library/UefiRuntimeServicesTableLib.h>\r |
ce3cd892 MK |
18 | \r |
19 | /**\r | |
20 | This function causes a system-wide reset (cold reset), in which\r | |
d1102dba | 21 | all circuitry within the system returns to its initial state. This type of reset\r |
ce3cd892 MK |
22 | is asynchronous to system operation and operates without regard to\r |
23 | cycle boundaries.\r | |
24 | \r | |
d1102dba | 25 | If this function returns, it means that the system does not support cold reset.\r |
ce3cd892 MK |
26 | **/\r |
27 | VOID\r | |
28 | EFIAPI\r | |
29 | ResetCold (\r | |
30 | VOID\r | |
31 | )\r | |
32 | {\r | |
6c252691 | 33 | gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);\r |
ce3cd892 MK |
34 | }\r |
35 | \r | |
36 | /**\r | |
d1102dba | 37 | This function causes a system-wide initialization (warm reset), in which all processors\r |
ce3cd892 MK |
38 | are set to their initial state. Pending cycles are not corrupted.\r |
39 | \r | |
40 | If this function returns, it means that the system does not support warm reset.\r | |
41 | **/\r | |
42 | VOID\r | |
43 | EFIAPI\r | |
44 | ResetWarm (\r | |
45 | VOID\r | |
46 | )\r | |
47 | {\r | |
6c252691 | 48 | gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r |
ce3cd892 MK |
49 | }\r |
50 | \r | |
51 | /**\r | |
d1102dba | 52 | This function causes the system to enter a power state equivalent\r |
ce3cd892 MK |
53 | to the ACPI G2/S5 or G3 states.\r |
54 | \r | |
55 | If this function returns, it means that the system does not support shut down reset.\r | |
56 | **/\r | |
57 | VOID\r | |
58 | EFIAPI\r | |
59 | ResetShutdown (\r | |
60 | VOID\r | |
61 | )\r | |
62 | {\r | |
6c252691 | 63 | gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);\r |
ce3cd892 MK |
64 | }\r |
65 | \r | |
66 | /**\r | |
67 | This function causes the system to enter S3 and then wake up immediately.\r | |
68 | \r | |
69 | If this function returns, it means that the system does not support S3 feature.\r | |
70 | **/\r | |
71 | VOID\r | |
72 | EFIAPI\r | |
73 | EnterS3WithImmediateWake (\r | |
74 | VOID\r | |
75 | )\r | |
76 | {\r | |
77 | }\r | |
78 | \r | |
79 | /**\r | |
80 | This function causes a systemwide reset. The exact type of the reset is\r | |
81 | defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r | |
82 | into ResetData. If the platform does not recognize the EFI_GUID in ResetData\r | |
83 | the platform must pick a supported reset type to perform.The platform may\r | |
84 | optionally log the parameters from any non-normal reset that occurs.\r | |
85 | \r | |
86 | @param[in] DataSize The size, in bytes, of ResetData.\r | |
87 | @param[in] ResetData The data buffer starts with a Null-terminated string,\r | |
88 | followed by the EFI_GUID.\r | |
89 | **/\r | |
90 | VOID\r | |
91 | EFIAPI\r | |
92 | ResetPlatformSpecific (\r | |
93 | IN UINTN DataSize,\r | |
94 | IN VOID *ResetData\r | |
95 | )\r | |
96 | {\r | |
6c252691 | 97 | gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);\r |
ce3cd892 | 98 | }\r |
6b20fd3d ZG |
99 | \r |
100 | /**\r | |
101 | The ResetSystem function resets the entire platform.\r | |
102 | \r | |
103 | @param[in] ResetType The type of reset to perform.\r | |
104 | @param[in] ResetStatus The status code for the reset.\r | |
105 | @param[in] DataSize The size, in bytes, of ResetData.\r | |
106 | @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r | |
107 | the data buffer starts with a Null-terminated string, optionally\r | |
108 | followed by additional binary data. The string is a description\r | |
109 | that the caller may use to further indicate the reason for the\r | |
110 | system reset. ResetData is only valid if ResetStatus is something\r | |
111 | other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific\r | |
112 | where a minimum amount of ResetData is always required.\r | |
113 | **/\r | |
114 | VOID\r | |
115 | EFIAPI\r | |
116 | ResetSystem (\r | |
117 | IN EFI_RESET_TYPE ResetType,\r | |
118 | IN EFI_STATUS ResetStatus,\r | |
119 | IN UINTN DataSize,\r | |
120 | IN VOID *ResetData OPTIONAL\r | |
121 | )\r | |
122 | {\r | |
123 | gRT->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);\r | |
124 | }\r |