]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/UnixThunkDxe/UnixThunk.c
Update the copyright notice format
[mirror_edk2.git] / UnixPkg / UnixThunkDxe / UnixThunk.c
1 /*++
2
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
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 UnixThunk.c
15
16 Abstract:
17
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
21 driver.
22
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.
26
27 --*/
28 #include "PiDxe.h"
29 #include "UnixDxe.h"
30 #include "UnixThunk.h"
31 #include <Protocol/DevicePath.h>
32
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>
40
41 //
42 // WinNtThunk Device Path Protocol Instance
43 //
44 UNIX_THUNK_DEVICE_PATH mUnixThunkDevicePath = {
45 {
46 {
47 HARDWARE_DEVICE_PATH,
48 HW_VENDOR_DP,
49 {
50 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
51 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
52 }
53 },
54 EFI_UNIX_THUNK_PROTOCOL_GUID,
55 },
56 {
57 END_DEVICE_PATH_TYPE,
58 END_ENTIRE_DEVICE_PATH_SUBTYPE,
59 {
60 END_DEVICE_PATH_LENGTH,
61 0
62 }
63 }
64 };
65
66
67 EFI_STATUS
68 EFIAPI
69 InitializeUnixThunk (
70 IN EFI_HANDLE ImageHandle,
71 IN EFI_SYSTEM_TABLE *SystemTable
72 )
73 /*++
74
75 Routine Description:
76 Install UnixThunk Protocol and it's associated Device Path protocol
77
78 Arguments:
79 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
80
81 Returns:
82 EFI_SUCEESS - UnixThunk protocol is added or error status from
83 gBS->InstallMultiProtocolInterfaces().
84
85 --*/
86 // TODO: ImageHandle - add argument and description to function comment
87 // TODO: SystemTable - add argument and description to function comment
88 {
89 EFI_STATUS Status;
90 EFI_HANDLE ControllerHandle;
91
92 ControllerHandle = NULL;
93 Status = gBS->InstallMultipleProtocolInterfaces (
94 &ControllerHandle,
95 &gEfiUnixThunkProtocolGuid,
96 gUnix,
97 &gEfiDevicePathProtocolGuid,
98 &mUnixThunkDevicePath,
99 NULL
100 );
101
102 return Status;
103 }