summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2013-07-26 03:00:21 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-26 03:00:21 +0000
commit4d0a30a494599226450bf69ad9d6fc689f61712e (patch)
treea5b8f92e8ef899771952d4d0b9b215b7113906c4 /MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
parent1fd4578528e62646025f3eabb3d059c308516e71 (diff)
downloadedk2-4d0a30a494599226450bf69ad9d6fc689f61712e.zip
edk2-4d0a30a494599226450bf69ad9d6fc689f61712e.tar.gz
edk2-4d0a30a494599226450bf69ad9d6fc689f61712e.tar.bz2
Add 4 APIs to DevicePathLib: ConvertDeviceNodeToText, ConvertDevicePathToText, ConvertTextToDeviceNode and ConvertTextToDevicePath.
Add a new instance of DevicePathLib which tries to locate the protocol and if it's not found, it uses the internal functions. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14504 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DevicePathDxe/DevicePath.c')
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePath.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
index 716aa60..70f03bd 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
@@ -2,7 +2,7 @@
Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol
and DevPathToText Protocol.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -13,19 +13,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include "DevicePath.h"
-
-EFI_HANDLE mDevicePathHandle = NULL;
+#include <Uefi.h>
+#include <Protocol/DevicePathUtilities.h>
+#include <Protocol/DevicePathToText.h>
+#include <Protocol/DevicePathFromText.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/PcdLib.h>
GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {
- GetDevicePathSizeProtocolInterface,
- DuplicateDevicePathProtocolInterface,
- AppendDevicePathProtocolInterface,
- AppendDeviceNodeProtocolInterface,
- AppendDevicePathInstanceProtocolInterface,
- GetNextDevicePathInstanceProtocolInterface,
- IsDevicePathMultiInstanceProtocolInterface,
- CreateDeviceNodeProtocolInterface
+ GetDevicePathSize,
+ DuplicateDevicePath,
+ AppendDevicePath,
+ AppendDevicePathNode,
+ AppendDevicePathInstance,
+ GetNextDevicePathInstance,
+ IsDevicePathMultiInstance,
+ CreateDeviceNode
};
GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {
@@ -38,11 +43,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePa
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;
-
-
-
/**
The user Entry Point for DevicePath module.
@@ -64,12 +64,14 @@ DevicePathEntryPoint (
)
{
EFI_STATUS Status;
+ EFI_HANDLE Handle;
+ Handle = NULL;
Status = EFI_UNSUPPORTED;
if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {
if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
Status = gBS->InstallMultipleProtocolInterfaces (
- &mDevicePathHandle,
+ &Handle,
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
&gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
&gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
@@ -77,7 +79,7 @@ DevicePathEntryPoint (
);
} else {
Status = gBS->InstallMultipleProtocolInterfaces (
- &mDevicePathHandle,
+ &Handle,
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
&gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
NULL
@@ -86,14 +88,14 @@ DevicePathEntryPoint (
} else {
if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
Status = gBS->InstallMultipleProtocolInterfaces (
- &mDevicePathHandle,
+ &Handle,
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
&gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
NULL
);
} else {
Status = gBS->InstallMultipleProtocolInterfaces (
- &mDevicePathHandle,
+ &Handle,
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
NULL
);