3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 Produce UnixThunk protocol and it's associated device path and controller
19 state protocols. UnixThunk is to the emulation environment as
20 PCI_ROOT_BRIGE is to real hardware. The UnixBusDriver is the child of this
23 Since we are a root hardware abstraction we do not install a Driver Binding
24 protocol on this handle. This driver can only support one one UnixThunk protocol
25 in the system, since the device path is hard coded.
30 #include "UnixThunk.h"
31 #include <Protocol/DevicePath.h>
33 #include <Library/DebugLib.h>
34 #include <Library/UefiLib.h>
35 #include <Library/UefiDriverEntryPoint.h>
36 #include <Library/UnixLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/DevicePathLib.h>
42 // WinNtThunk Device Path Protocol Instance
44 UNIX_THUNK_DEVICE_PATH mUnixThunkDevicePath
= {
50 (UINT8
) (sizeof (VENDOR_DEVICE_PATH
)),
51 (UINT8
) ((sizeof (VENDOR_DEVICE_PATH
)) >> 8)
54 EFI_UNIX_THUNK_PROTOCOL_GUID
,
58 END_ENTIRE_DEVICE_PATH_SUBTYPE
,
60 END_DEVICE_PATH_LENGTH
,
70 IN EFI_HANDLE ImageHandle
,
71 IN EFI_SYSTEM_TABLE
*SystemTable
76 Install UnixThunk Protocol and it's associated Device Path protocol
79 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
82 EFI_SUCEESS - UnixThunk protocol is added or error status from
83 gBS->InstallMultiProtocolInterfaces().
86 // TODO: ImageHandle - add argument and description to function comment
87 // TODO: SystemTable - add argument and description to function comment
90 EFI_HANDLE ControllerHandle
;
92 ControllerHandle
= NULL
;
93 Status
= gBS
->InstallMultipleProtocolInterfaces (
95 &gEfiUnixThunkProtocolGuid
,
97 &gEfiDevicePathProtocolGuid
,
98 &mUnixThunkDevicePath
,