fix some minor warning for unix package
[mirror_edk2.git] / EdkUnixPkg / Dxe / UnixThunk / UnixThunk / UnixThunk.c
CommitLineData
c9093a06 1/*++\r
2\r
3Copyright (c) 2006, 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 UnixThunk.c\r
15\r
16Abstract:\r
17\r
18 Produce UnixThunk protocol and it's associated device path and controller \r
19 state protocols. UnixThunk is to the emulation environment as \r
20 PCI_ROOT_BRIGE is to real hardware. The UnixBusDriver is the child of this\r
21 driver.\r
22\r
23 Since we are a root hardware abstraction we do not install a Driver Binding\r
24 protocol on this handle. This driver can only support one one UnixThunk protocol\r
25 in the system, since the device path is hard coded.\r
26\r
27--*/\r
28\r
29#include "UnixThunk.h"\r
30\r
31//\r
32// WinNtThunk Device Path Protocol Instance\r
33//\r
34static UNIX_THUNK_DEVICE_PATH mUnixThunkDevicePath = {\r
35 {\r
8ef571df 36 {\r
37 HARDWARE_DEVICE_PATH,\r
38 HW_VENDOR_DP,\r
39 {\r
40 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
41 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
42 }\r
43 },\r
c9093a06 44 EFI_UNIX_THUNK_PROTOCOL_GUID,\r
45 },\r
46 {\r
47 END_DEVICE_PATH_TYPE,\r
48 END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
8ef571df 49 {\r
50 END_DEVICE_PATH_LENGTH,\r
51 0\r
52 }\r
c9093a06 53 }\r
54};\r
55\r
56\r
57EFI_STATUS\r
58EFIAPI\r
59InitializeUnixThunk (\r
60 IN EFI_HANDLE ImageHandle,\r
61 IN EFI_SYSTEM_TABLE *SystemTable\r
62 )\r
63/*++\r
64\r
65Routine Description:\r
66 Install UnixThunk Protocol and it's associated Device Path protocol\r
67\r
68Arguments:\r
69 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
70\r
71Returns:\r
72 EFI_SUCEESS - UnixThunk protocol is added or error status from \r
73 gBS->InstallMultiProtocolInterfaces().\r
74\r
75--*/\r
76// TODO: ImageHandle - add argument and description to function comment\r
77// TODO: SystemTable - add argument and description to function comment\r
78{\r
79 EFI_STATUS Status;\r
80 EFI_HANDLE ControllerHandle;\r
81\r
82 ControllerHandle = NULL;\r
83 Status = gBS->InstallMultipleProtocolInterfaces (\r
84 &ControllerHandle,\r
85 &gEfiUnixThunkProtocolGuid,\r
86 gUnix,\r
87 &gEfiDevicePathProtocolGuid,\r
88 &mUnixThunkDevicePath,\r
89 NULL\r
90 );\r
91\r
92 return Status;\r
93}\r