TianoCore EDK2
master
Loading...
Searching...
No Matches
EmuThunk.c
1
/*++ @file
2
3
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4
Portions copyright (c) 2011, Apple Inc. All rights reserved.
5
SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
**/
9
#include <
PiDxe.h
>
10
11
#include <
Protocol/DevicePath.h
>
12
#include <
Protocol/EmuThunk.h
>
13
14
#include <
Library/DebugLib.h
>
15
#include <
Library/UefiLib.h
>
16
#include <
Library/UefiDriverEntryPoint.h
>
17
#include <Library/EmuThunkLib.h>
18
#include <
Library/MemoryAllocationLib.h
>
19
#include <
Library/UefiBootServicesTableLib.h
>
20
#include <
Library/DevicePathLib.h
>
21
22
//
23
// EmuThunk Device Path Protocol Instance
24
//
25
EMU_THUNK_DEVICE_PATH
mEmuThunkDevicePath = {
26
{
27
{
28
{
29
HARDWARE_DEVICE_PATH
,
30
HW_VENDOR_DP
,
31
{
32
(UINT8)(
sizeof
(
EMU_VENDOR_DEVICE_PATH_NODE
)),
33
(UINT8)((
sizeof
(
EMU_VENDOR_DEVICE_PATH_NODE
)) >> 8)
34
}
35
},
36
EMU_THUNK_PROTOCOL_GUID
37
},
38
0
39
},
40
{
41
END_DEVICE_PATH_TYPE,
42
END_ENTIRE_DEVICE_PATH_SUBTYPE,
43
{
44
END_DEVICE_PATH_LENGTH,
45
0
46
}
47
}
48
};
49
50
EFI_STATUS
51
EFIAPI
52
InitializeEmuThunk (
53
IN
EFI_HANDLE
ImageHandle,
54
IN
EFI_SYSTEM_TABLE
*SystemTable
55
)
56
57
/*++
58
59
Routine Description:
60
Install UnixThunk Protocol and it's associated Device Path protocol
61
62
Arguments:
63
(Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
64
65
Returns:
66
EFI_SUCEESS - UnixThunk protocol is added or error status from
67
gBS->InstallMultiProtocolInterfaces().
68
69
**/
70
{
71
EFI_STATUS
Status;
72
EFI_HANDLE
Handle;
73
74
Handle =
NULL
;
75
Status =
gBS
->InstallMultipleProtocolInterfaces (
76
&Handle,
77
&gEmuThunkProtocolGuid,
78
gEmuThunk,
79
&gEfiDevicePathProtocolGuid,
80
&mEmuThunkDevicePath,
81
NULL
82
);
83
84
return
Status;
85
}
DevicePath.h
HARDWARE_DEVICE_PATH
#define HARDWARE_DEVICE_PATH
Definition:
DevicePath.h:68
HW_VENDOR_DP
#define HW_VENDOR_DP
Definition:
DevicePath.h:133
DevicePathLib.h
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
DebugLib.h
MemoryAllocationLib.h
PiDxe.h
EmuThunk.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_HANDLE
VOID * EFI_HANDLE
Definition:
UefiBaseType.h:33
UefiBootServicesTableLib.h
gBS
EFI_BOOT_SERVICES * gBS
Definition:
UefiBootServicesTableLib.c:17
UefiDriverEntryPoint.h
UefiLib.h
EFI_SYSTEM_TABLE
Definition:
UefiSpec.h:2028
EMU_THUNK_DEVICE_PATH
Definition:
EmuThunk.h:30
EMU_VENDOR_DEVICE_PATH_NODE
Definition:
EmuThunk.h:25
EmulatorPkg
EmuThunkDxe
EmuThunk.c
Generated on Fri Nov 15 2024 18:01:07 for TianoCore EDK2 by
1.9.6