]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/ResetRuntimeDxe/reset.c
Removed CommonHeader.h from NT32Pkg. Did not fix BDS as it will get re-written
[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 #include <PiDxe.h>
23 #include <WinNtDxe.h>
24 #include <Protocol/Reset.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/WinNtLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29
30
31 EFI_STATUS
32 EFIAPI
33 InitializeNtReset (
34 IN EFI_HANDLE ImageHandle,
35 IN EFI_SYSTEM_TABLE *SystemTable
36 );
37
38 STATIC
39 EFI_STATUS
40 EFIAPI
41 WinNtResetSystem (
42 IN EFI_RESET_TYPE ResetType,
43 IN EFI_STATUS ResetStatus,
44 IN UINTN DataSize,
45 IN CHAR16 *ResetData OPTIONAL
46 );
47
48
49 EFI_STATUS
50 EFIAPI
51 InitializeNtReset (
52 IN EFI_HANDLE ImageHandle,
53 IN EFI_SYSTEM_TABLE *SystemTable
54 )
55 /*++
56
57 Routine Description:
58
59
60 Arguments:
61
62 ImageHandle of the loaded driver
63 Pointer to the System Table
64
65 Returns:
66
67 Status
68 --*/
69 // TODO: SystemTable - add argument and description to function comment
70 {
71 EFI_STATUS Status;
72 EFI_HANDLE Handle;
73
74 SystemTable->RuntimeServices->ResetSystem = WinNtResetSystem;
75
76 Handle = NULL;
77 Status = gBS->InstallMultipleProtocolInterfaces (
78 &Handle,
79 &gEfiResetArchProtocolGuid,
80 NULL,
81 NULL
82 );
83 ASSERT_EFI_ERROR (Status);
84
85 return Status;
86 }
87
88 STATIC
89 EFI_STATUS
90 EFIAPI
91 WinNtResetSystem (
92 IN EFI_RESET_TYPE ResetType,
93 IN EFI_STATUS ResetStatus,
94 IN UINTN DataSize,
95 IN CHAR16 *ResetData OPTIONAL
96 )
97 /*++
98
99 Routine Description:
100
101 TODO: Add function description
102
103 Arguments:
104
105 ResetType - TODO: add argument description
106 ResetStatus - TODO: add argument description
107 DataSize - TODO: add argument description
108 ResetData - TODO: add argument description
109
110 Returns:
111
112 EFI_SUCCESS - TODO: Add description for return value
113
114 --*/
115 {
116 //
117 // BUGBUG Need to kill all console windows later
118 //
119 //
120 // Discard ResetType, always return 0 as exit code
121 //
122 gWinNt->ExitProcess (0);
123
124 //
125 // Should never go here
126 //
127 return EFI_SUCCESS;
128 }