diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-19 19:14:02 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-19 19:14:02 +0000 |
commit | e99aa5a2113a275c2e16cf049ce8e66642e6c64c (patch) | |
tree | 7ea18e2b77a8935e219a77511fb718b669e4d1a3 /EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c | |
parent | c7823a8f8a1f6662662117558a8c6f06c7a07a71 (diff) | |
download | edk2-platforms-e99aa5a2113a275c2e16cf049ce8e66642e6c64c.tar.xz |
Update Device Path Module to use PCD Feature Flags to determine of the Device Path To Text and Text To Device Path Protocols are produced or not.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1572 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c')
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c | 95 |
1 files changed, 60 insertions, 35 deletions
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c index 78c5defe3a..6117a3245e 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c @@ -22,10 +22,31 @@ Abstract: #include "DevicePath.h" -DEVICE_PATH_DRIVER_PRIVATE_DATA mPrivateData; - -EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; -EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; +EFI_HANDLE mDevicePathHandle = NULL; + +GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {
+ GetDevicePathSizeProtocolInterface, + DuplicateDevicePathProtocolInterface, + AppendDevicePathProtocolInterface, + AppendDeviceNodeProtocolInterface, + AppendDevicePathInstanceProtocolInterface, + GetNextDevicePathInstanceProtocolInterface, + IsDevicePathMultiInstanceProtocolInterface, + CreateDeviceNodeProtocolInterface +};
+
+GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {
+ ConvertDeviceNodeToText, + ConvertDevicePathToText +};
+
+GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {
+ ConvertTextToDeviceNode,
+ ConvertTextToDevicePath
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; +GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; EFI_STATUS EFIAPI @@ -49,36 +70,40 @@ DevicePathEntryPoint ( --*/ { EFI_STATUS Status; - - mPrivateData.Signature = DEVICE_PATH_DRIVER_SIGNATURE; - - mPrivateData.DevicePathUtilities.GetDevicePathSize = GetDevicePathSizeProtocolInterface; - mPrivateData.DevicePathUtilities.DuplicateDevicePath = DuplicateDevicePathProtocolInterface; - mPrivateData.DevicePathUtilities.AppendDevicePath = AppendDevicePathProtocolInterface; - mPrivateData.DevicePathUtilities.AppendDeviceNode = AppendDeviceNodeProtocolInterface; - mPrivateData.DevicePathUtilities.AppendDevicePathInstance = AppendDevicePathInstanceProtocolInterface; - mPrivateData.DevicePathUtilities.GetNextDevicePathInstance = GetNextDevicePathInstanceProtocolInterface; - mPrivateData.DevicePathUtilities.IsDevicePathMultiInstance = IsDevicePathMultiInstanceProtocolInterface; - mPrivateData.DevicePathUtilities.CreateDeviceNode = CreateDeviceNodeProtocolInterface; - - mPrivateData.DevicePathToText.ConvertDeviceNodeToText = ConvertDeviceNodeToText; - mPrivateData.DevicePathToText.ConvertDevicePathToText = ConvertDevicePathToText; - - mPrivateData.DevicePathFromText.ConvertTextToDeviceNode = ConvertTextToDeviceNode; - mPrivateData.DevicePathFromText.ConvertTextToDevicePath = ConvertTextToDevicePath; - - mPrivateData.Handle = NULL; - - Status = gBS->InstallMultipleProtocolInterfaces ( - &mPrivateData.Handle, - &gEfiDevicePathUtilitiesProtocolGuid, - &mPrivateData.DevicePathUtilities, - &gEfiDevicePathToTextProtocolGuid, - &mPrivateData.DevicePathToText, - &gEfiDevicePathFromTextProtocolGuid, - &mPrivateData.DevicePathFromText, - NULL - ); - + + Status = EFI_UNSUPPORTED; + if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {
+ if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
+ Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, + &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, + NULL + ); + } else {
+ Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, + NULL + ); + }
+ } else {
+ if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
+ Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, + NULL + ); + } else {
+ Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + NULL + ); + }
+ }
return Status; } |