2 Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol
3 and DevPathToText Protocol.
5 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Protocol/DevicePathUtilities.h>
12 #include <Protocol/DevicePathToText.h>
13 #include <Protocol/DevicePathFromText.h>
14 #include <Library/UefiDriverEntryPoint.h>
15 #include <Library/UefiBootServicesTableLib.h>
16 #include <Library/DevicePathLib.h>
17 #include <Library/PcdLib.h>
19 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities
= {
24 AppendDevicePathInstance
,
25 GetNextDevicePathInstance
,
26 IsDevicePathMultiInstance
,
30 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText
= {
31 ConvertDeviceNodeToText
,
32 ConvertDevicePathToText
35 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText
= {
36 ConvertTextToDeviceNode
,
37 ConvertTextToDevicePath
41 The user Entry Point for DevicePath module.
43 This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
44 optionally the Device Path to Text and Device Path from Text protocols based on feature flags.
46 @param[in] ImageHandle The firmware allocated handle for the EFI image.
47 @param[in] SystemTable A pointer to the EFI System Table.
49 @retval EFI_SUCCESS The entry point is executed successfully.
50 @retval Others Some error occurs when executing this entry point.
55 DevicePathEntryPoint (
56 IN EFI_HANDLE ImageHandle
,
57 IN EFI_SYSTEM_TABLE
*SystemTable
64 Status
= EFI_UNSUPPORTED
;
65 if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText
)) {
66 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText
)) {
67 Status
= gBS
->InstallMultipleProtocolInterfaces (
69 &gEfiDevicePathUtilitiesProtocolGuid
, &mDevicePathUtilities
,
70 &gEfiDevicePathToTextProtocolGuid
, &mDevicePathToText
,
71 &gEfiDevicePathFromTextProtocolGuid
, &mDevicePathFromText
,
75 Status
= gBS
->InstallMultipleProtocolInterfaces (
77 &gEfiDevicePathUtilitiesProtocolGuid
, &mDevicePathUtilities
,
78 &gEfiDevicePathToTextProtocolGuid
, &mDevicePathToText
,
83 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText
)) {
84 Status
= gBS
->InstallMultipleProtocolInterfaces (
86 &gEfiDevicePathUtilitiesProtocolGuid
, &mDevicePathUtilities
,
87 &gEfiDevicePathFromTextProtocolGuid
, &mDevicePathFromText
,
91 Status
= gBS
->InstallMultipleProtocolInterfaces (
93 &gEfiDevicePathUtilitiesProtocolGuid
, &mDevicePathUtilities
,