]>
Commit | Line | Data |
---|---|---|
8681bee2 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | Reset.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Reset Architectural Protocol as defined in Tiano under NT Emulation\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
f2569572 A |
22 | #include <PiDxe.h>\r |
23 | #include <WinNtDxe.h>\r | |
24 | #include <Protocol/Reset.h>\r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/UefiDriverEntryPoint.h>\r | |
27 | #include <Library/WinNtLib.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
8681bee2 | 29 | \r |
30 | \r | |
8681bee2 | 31 | EFI_STATUS\r |
32 | EFIAPI\r | |
33 | InitializeNtReset (\r | |
34 | IN EFI_HANDLE ImageHandle,\r | |
35 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
36 | );\r | |
37 | \r | |
38 | STATIC\r | |
39 | EFI_STATUS\r | |
40 | EFIAPI\r | |
41 | WinNtResetSystem (\r | |
42 | IN EFI_RESET_TYPE ResetType,\r | |
43 | IN EFI_STATUS ResetStatus,\r | |
44 | IN UINTN DataSize,\r | |
45 | IN CHAR16 *ResetData OPTIONAL\r | |
46 | );\r | |
47 | \r | |
48 | \r | |
49 | EFI_STATUS\r | |
50 | EFIAPI\r | |
51 | InitializeNtReset (\r | |
52 | IN EFI_HANDLE ImageHandle,\r | |
53 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
54 | )\r | |
55 | /*++\r | |
56 | \r | |
57 | Routine Description:\r | |
58 | \r | |
59 | \r | |
60 | Arguments:\r | |
61 | \r | |
62 | ImageHandle of the loaded driver\r | |
63 | Pointer to the System Table\r | |
64 | \r | |
65 | Returns:\r | |
66 | \r | |
67 | Status\r | |
68 | --*/\r | |
69 | // TODO: SystemTable - add argument and description to function comment\r | |
70 | {\r | |
71 | EFI_STATUS Status;\r | |
72 | EFI_HANDLE Handle;\r | |
73 | \r | |
74 | SystemTable->RuntimeServices->ResetSystem = WinNtResetSystem;\r | |
75 | \r | |
76 | Handle = NULL;\r | |
77 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
78 | &Handle,\r | |
79 | &gEfiResetArchProtocolGuid,\r | |
80 | NULL,\r | |
81 | NULL\r | |
82 | );\r | |
83 | ASSERT_EFI_ERROR (Status);\r | |
84 | \r | |
85 | return Status;\r | |
86 | }\r | |
87 | \r | |
88 | STATIC\r | |
89 | EFI_STATUS\r | |
90 | EFIAPI\r | |
91 | WinNtResetSystem (\r | |
92 | IN EFI_RESET_TYPE ResetType,\r | |
93 | IN EFI_STATUS ResetStatus,\r | |
94 | IN UINTN DataSize,\r | |
95 | IN CHAR16 *ResetData OPTIONAL\r | |
96 | )\r | |
97 | /*++\r | |
98 | \r | |
99 | Routine Description:\r | |
100 | \r | |
101 | TODO: Add function description\r | |
102 | \r | |
103 | Arguments:\r | |
104 | \r | |
105 | ResetType - TODO: add argument description\r | |
106 | ResetStatus - TODO: add argument description\r | |
107 | DataSize - TODO: add argument description\r | |
108 | ResetData - TODO: add argument description\r | |
109 | \r | |
110 | Returns:\r | |
111 | \r | |
112 | EFI_SUCCESS - TODO: Add description for return value\r | |
113 | \r | |
114 | --*/\r | |
115 | {\r | |
116 | //\r | |
117 | // BUGBUG Need to kill all console windows later\r | |
118 | //\r | |
119 | //\r | |
120 | // Discard ResetType, always return 0 as exit code\r | |
121 | //\r | |
122 | gWinNt->ExitProcess (0);\r | |
123 | \r | |
124 | //\r | |
125 | // Should never go here\r | |
126 | //\r | |
127 | return EFI_SUCCESS;\r | |
128 | }\r |