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