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