]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/ResetRuntimeDxe/reset.c
a4df52f19a3538b4f2d00814a6d6637fe1b87510
[mirror_edk2.git] / Nt32Pkg / ResetRuntimeDxe / reset.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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 Module Name:
13
14 Reset.c
15
16 Abstract:
17
18 Reset Architectural Protocol as defined in Tiano under NT Emulation
19
20 --*/
21
22
23
24 //
25 // Include common header file for this module.
26 //
27 #include "CommonHeader.h"
28
29 EFI_STATUS
30 EFIAPI
31 InitializeNtReset (
32 IN EFI_HANDLE ImageHandle,
33 IN EFI_SYSTEM_TABLE *SystemTable
34 );
35
36 STATIC
37 EFI_STATUS
38 EFIAPI
39 WinNtResetSystem (
40 IN EFI_RESET_TYPE ResetType,
41 IN EFI_STATUS ResetStatus,
42 IN UINTN DataSize,
43 IN CHAR16 *ResetData OPTIONAL
44 );
45
46
47 EFI_STATUS
48 EFIAPI
49 InitializeNtReset (
50 IN EFI_HANDLE ImageHandle,
51 IN EFI_SYSTEM_TABLE *SystemTable
52 )
53 /*++
54
55 Routine Description:
56
57
58 Arguments:
59
60 ImageHandle of the loaded driver
61 Pointer to the System Table
62
63 Returns:
64
65 Status
66 --*/
67 // TODO: SystemTable - add argument and description to function comment
68 {
69 EFI_STATUS Status;
70 EFI_HANDLE Handle;
71
72 SystemTable->RuntimeServices->ResetSystem = WinNtResetSystem;
73
74 Handle = NULL;
75 Status = gBS->InstallMultipleProtocolInterfaces (
76 &Handle,
77 &gEfiResetArchProtocolGuid,
78 NULL,
79 NULL
80 );
81 ASSERT_EFI_ERROR (Status);
82
83 return Status;
84 }
85
86 STATIC
87 EFI_STATUS
88 EFIAPI
89 WinNtResetSystem (
90 IN EFI_RESET_TYPE ResetType,
91 IN EFI_STATUS ResetStatus,
92 IN UINTN DataSize,
93 IN CHAR16 *ResetData OPTIONAL
94 )
95 /*++
96
97 Routine Description:
98
99 TODO: Add function description
100
101 Arguments:
102
103 ResetType - TODO: add argument description
104 ResetStatus - TODO: add argument description
105 DataSize - TODO: add argument description
106 ResetData - TODO: add argument description
107
108 Returns:
109
110 EFI_SUCCESS - TODO: Add description for return value
111
112 --*/
113 {
114 //
115 // BUGBUG Need to kill all console windows later
116 //
117 //
118 // Discard ResetType, always return 0 as exit code
119 //
120 gWinNt->ExitProcess (0);
121
122 //
123 // Should never go here
124 //
125 return EFI_SUCCESS;
126 }