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