]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
MdeModulePkg/AtaAtapiPassThru: Revert patch to disable Bus Master
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePath.c
... / ...
CommitLineData
1/** @file\r
2 Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol\r
3 and DevPathToText Protocol.\r
4\r
5Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Uefi.h>\r
17#include <Protocol/DevicePathUtilities.h>\r
18#include <Protocol/DevicePathToText.h>\r
19#include <Protocol/DevicePathFromText.h>\r
20#include <Library/UefiDriverEntryPoint.h>\r
21#include <Library/UefiBootServicesTableLib.h>\r
22#include <Library/DevicePathLib.h>\r
23#include <Library/PcdLib.h>\r
24\r
25GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r
26 GetDevicePathSize,\r
27 DuplicateDevicePath,\r
28 AppendDevicePath,\r
29 AppendDevicePathNode,\r
30 AppendDevicePathInstance,\r
31 GetNextDevicePathInstance,\r
32 IsDevicePathMultiInstance,\r
33 CreateDeviceNode\r
34};\r
35\r
36GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {\r
37 ConvertDeviceNodeToText,\r
38 ConvertDevicePathToText\r
39};\r
40\r
41GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r
42 ConvertTextToDeviceNode,\r
43 ConvertTextToDevicePath\r
44};\r
45\r
46/**\r
47 The user Entry Point for DevicePath module.\r
48\r
49 This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and\r
50 optionally the Device Path to Text and Device Path from Text protocols based on feature flags.\r
51\r
52 @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
53 @param[in] SystemTable A pointer to the EFI System Table.\r
54\r
55 @retval EFI_SUCCESS The entry point is executed successfully.\r
56 @retval Others Some error occurs when executing this entry point.\r
57\r
58**/\r
59EFI_STATUS\r
60EFIAPI\r
61DevicePathEntryPoint (\r
62 IN EFI_HANDLE ImageHandle,\r
63 IN EFI_SYSTEM_TABLE *SystemTable\r
64 )\r
65{\r
66 EFI_STATUS Status;\r
67 EFI_HANDLE Handle;\r
68\r
69 Handle = NULL;\r
70 Status = EFI_UNSUPPORTED;\r
71 if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r
72 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
73 Status = gBS->InstallMultipleProtocolInterfaces (\r
74 &Handle,\r
75 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
76 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r
77 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r
78 NULL\r
79 );\r
80 } else {\r
81 Status = gBS->InstallMultipleProtocolInterfaces (\r
82 &Handle,\r
83 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
84 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r
85 NULL\r
86 );\r
87 }\r
88 } else {\r
89 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
90 Status = gBS->InstallMultipleProtocolInterfaces (\r
91 &Handle,\r
92 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
93 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r
94 NULL\r
95 );\r
96 } else {\r
97 Status = gBS->InstallMultipleProtocolInterfaces (\r
98 &Handle,\r
99 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
100 NULL\r
101 );\r
102 }\r
103 }\r
104 return Status;\r
105}\r