]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/ResetRuntimeDxe/Reset.c
remove Bmp.h and ShellFile.h From MdeModulePkg to IntelFrameworkPkg
[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
7492c63d 41VOID\r
804405e7 42EFIAPI\r
43UnixResetSystem (\r
44 IN EFI_RESET_TYPE ResetType,\r
45 IN EFI_STATUS ResetStatus,\r
46 IN UINTN DataSize,\r
7646204c 47 IN VOID *ResetData OPTIONAL\r
804405e7 48 );\r
49\r
50EFI_STATUS\r
51EFIAPI\r
52InitializeUnixReset (\r
53 IN EFI_HANDLE ImageHandle,\r
54 IN EFI_SYSTEM_TABLE *SystemTable\r
55 )\r
56/*++\r
57\r
58Routine Description:\r
59\r
60\r
61Arguments:\r
62\r
63 ImageHandle of the loaded driver\r
64 Pointer to the System Table\r
65\r
66Returns:\r
67\r
68 Status\r
69--*/\r
70// TODO: SystemTable - add argument and description to function comment\r
71{\r
72 EFI_STATUS Status;\r
73 EFI_HANDLE Handle;\r
74\r
75 SystemTable->RuntimeServices->ResetSystem = UnixResetSystem;\r
76\r
77 Handle = NULL;\r
78 Status = gBS->InstallMultipleProtocolInterfaces (\r
79 &Handle,\r
80 &gEfiResetArchProtocolGuid,\r
81 NULL,\r
82 NULL\r
83 );\r
84 ASSERT_EFI_ERROR (Status);\r
85\r
86 return Status;\r
87}\r
88\r
7492c63d 89VOID\r
804405e7 90EFIAPI\r
91UnixResetSystem (\r
92 IN EFI_RESET_TYPE ResetType,\r
93 IN EFI_STATUS ResetStatus,\r
94 IN UINTN DataSize,\r
7646204c 95 IN VOID *ResetData OPTIONAL\r
804405e7 96 )\r
97/*++\r
98\r
99Routine Description:\r
100\r
101 TODO: Add function description\r
102\r
103Arguments:\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
110Returns:\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 gUnix->Exit (0);\r
123\r
124 //\r
125 // Should never go here\r
126 //\r
127 while (1)
128 ;
129}\r