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