]>
Commit | Line | Data |
---|---|---|
6ae81428 | 1 | /**@file\r |
869f8e34 | 2 | \r |
8f2a5f80 HT |
3 | Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
869f8e34 | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | WinNtThunk.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Produce WinNtThunk protocol and it's associated device path and controller \r | |
19 | state protocols. WinNtThunk is to the NT emulation environment as \r | |
20 | PCI_ROOT_BRIGE is to real hardware. The WinNtBusDriver 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 WinNtThunk protocol\r | |
25 | in the system, since the device path is hard coded.\r | |
26 | \r | |
6ae81428 | 27 | **/\r |
869f8e34 | 28 | \r |
29 | //\r | |
3747c59b | 30 | // The package level header files this module uses\r |
869f8e34 | 31 | //\r |
60c93673 | 32 | #include <Uefi.h>\r |
3747c59b | 33 | #include <WinNtDxe.h>\r |
34 | //\r | |
35 | // The protocols, PPI and GUID defintions for this module\r | |
36 | //\r | |
37 | #include <Protocol/WinNtThunk.h>\r | |
38 | #include <Protocol/DevicePath.h>\r | |
39 | //\r | |
40 | // The Library classes this module consumes\r | |
41 | //\r | |
3747c59b | 42 | #include <Library/UefiDriverEntryPoint.h>\r |
43 | #include <Library/WinNtLib.h>\r | |
44 | #include <Library/UefiBootServicesTableLib.h>\r | |
008698ab | 45 | #include <Library/DevicePathLib.h>\r |
869f8e34 | 46 | \r |
47 | #include "WinNtThunk.h"\r | |
48 | \r | |
49 | //\r | |
50 | // WinNtThunk Device Path Protocol Instance\r | |
51 | //\r | |
78e570b6 | 52 | WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath = {\r |
869f8e34 | 53 | {\r |
54 | HARDWARE_DEVICE_PATH,\r | |
55 | HW_VENDOR_DP,\r | |
56 | (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r | |
57 | (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r | |
58 | EFI_WIN_NT_THUNK_PROTOCOL_GUID,\r | |
59 | },\r | |
60 | {\r | |
61 | END_DEVICE_PATH_TYPE,\r | |
62 | END_ENTIRE_DEVICE_PATH_SUBTYPE,\r | |
63 | END_DEVICE_PATH_LENGTH,\r | |
64 | 0\r | |
65 | }\r | |
66 | };\r | |
67 | \r | |
68 | \r | |
69 | EFI_STATUS\r | |
70 | EFIAPI\r | |
71 | InitializeWinNtThunk (\r | |
72 | IN EFI_HANDLE ImageHandle,\r | |
73 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
74 | )\r | |
75 | /*++\r | |
76 | \r | |
77 | Routine Description:\r | |
78 | Install WinNtThunk Protocol and it's associated Device Path protocol\r | |
79 | \r | |
80 | Arguments:\r | |
81 | (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r | |
82 | \r | |
83 | Returns:\r | |
84 | EFI_SUCEESS - WinNtThunk protocol is added or error status from \r | |
85 | gBS->InstallMultiProtocolInterfaces().\r | |
86 | \r | |
87 | --*/\r | |
88 | // TODO: ImageHandle - add argument and description to function comment\r | |
89 | // TODO: SystemTable - add argument and description to function comment\r | |
90 | {\r | |
91 | EFI_STATUS Status;\r | |
92 | EFI_HANDLE ControllerHandle;\r | |
93 | \r | |
94 | ControllerHandle = NULL;\r | |
95 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
96 | &ControllerHandle,\r | |
97 | &gEfiWinNtThunkProtocolGuid,\r | |
98 | gWinNt,\r | |
99 | &gEfiDevicePathProtocolGuid,\r | |
100 | &mWinNtThunkDevicePath,\r | |
101 | NULL\r | |
102 | );\r | |
103 | \r | |
104 | return Status;\r | |
105 | }\r |