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