]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / PeiResetSystemLib / PeiResetSystemLib.c
CommitLineData
ce3cd892
MK
1/** @file\r
2 PEI Reset System Library instance that calls the ResetSystem2() PEI Service.\r
3\r
4 Copyright (c) 2017 - 2018, 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 <PiPei.h>\r
16#include <Library/ResetSystemLib.h>\r
17#include <Library/PeiServicesLib.h>\r
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
27VOID\r
28EFIAPI\r
29ResetCold (\r
30 VOID\r
31 )\r
32{\r
33 PeiServicesResetSystem2 (EfiResetCold, EFI_SUCCESS, 0, NULL);\r
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
42VOID\r
43EFIAPI\r
44ResetWarm (\r
45 VOID\r
46 )\r
47{\r
48 PeiServicesResetSystem2 (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
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
57VOID\r
58EFIAPI\r
59ResetShutdown (\r
60 VOID\r
61 )\r
62{\r
63 PeiServicesResetSystem2 (EfiResetShutdown, EFI_SUCCESS, 0, NULL);\r
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
71VOID\r
72EFIAPI\r
73EnterS3WithImmediateWake (\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
90VOID\r
91EFIAPI\r
92ResetPlatformSpecific (\r
93 IN UINTN DataSize,\r
94 IN VOID *ResetData\r
95 )\r
96{\r
97 PeiServicesResetSystem2 (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);\r
98}\r