]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c
ed4129d46b788bc49d71cf18dae618498078cf0d
[mirror_edk2.git] / Nt32Pkg / Library / ResetSystemLib / ResetSystemLib.c
1 /** @file
2
3 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 **/
7 #include <Uefi.h>
8 #include <Library/DebugLib.h>
9 #include <Library/WinNtLib.h>
10
11 /**
12 This function causes a system-wide reset (cold reset), in which
13 all circuitry within the system returns to its initial state. This type of reset
14 is asynchronous to system operation and operates without regard to
15 cycle boundaries.
16
17 If this function returns, it means that the system does not support cold reset.
18 **/
19 VOID
20 EFIAPI
21 ResetCold (
22 VOID
23 )
24 {
25 gWinNt->ExitProcess (0);
26 ASSERT (FALSE);
27 }
28
29 /**
30 This function causes a system-wide initialization (warm reset), in which all processors
31 are set to their initial state. Pending cycles are not corrupted.
32
33 If this function returns, it means that the system does not support warm reset.
34 **/
35 VOID
36 EFIAPI
37 ResetWarm (
38 VOID
39 )
40 {
41 ResetCold ();
42 }
43
44 /**
45 This function causes the system to enter a power state equivalent
46 to the ACPI G2/S5 or G3 states.
47
48 If this function returns, it means that the system does not support shut down reset.
49 **/
50 VOID
51 EFIAPI
52 ResetShutdown (
53 VOID
54 )
55 {
56 ResetCold ();
57 }
58
59 /**
60 This function causes the system to enter S3 and then wake up immediately.
61
62 If this function returns, it means that the system does not support S3 feature.
63 **/
64 VOID
65 EFIAPI
66 EnterS3WithImmediateWake (
67 VOID
68 )
69 {
70 ResetCold ();
71 }
72
73 /**
74 This function causes a systemwide reset. The exact type of the reset is
75 defined by the EFI_GUID that follows the Null-terminated Unicode string passed
76 into ResetData. If the platform does not recognize the EFI_GUID in ResetData
77 the platform must pick a supported reset type to perform.The platform may
78 optionally log the parameters from any non-normal reset that occurs.
79
80 @param[in] DataSize The size, in bytes, of ResetData.
81 @param[in] ResetData The data buffer starts with a Null-terminated string,
82 followed by the EFI_GUID.
83 **/
84 VOID
85 EFIAPI
86 ResetPlatformSpecific (
87 IN UINTN DataSize,
88 IN VOID *ResetData
89 )
90 {
91 ResetCold ();
92 }