From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.2664.1659667340100306694 for ; Thu, 04 Aug 2022 19:42:20 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=YW3r5yT+; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: yanbo.huang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659667340; x=1691203340; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=u8OBC+vWJqCvr5GKkXyXND6Tjiwg4/ON89NQW53RVqU=; b=YW3r5yT+6T0FLCD2sTMR+KRefdwGdy8ojbU+cbbtNRMchfCVNzvHPos7 evIv37A9bGwMAvsarVs9glV7hXP5iZ5eyBUkLORmC9QGQ0juu4dFkYunl uxqL7bweJbi2au++JLQX4HhwO5Arudz3lbAzBoU+KHbUc7mLneCOW5Gnq TxDAKN3/0Pq2nQchcb6Ihr1ftOcUdlhjszf0mW2kD0CUbIS5U/twFFiUO Qf0d+d+8hEfy65SaVxrX+IJu3Ek+dupY6xapiSh9NGVjcEcr42X/rcgdl 25HLA3gY+i+94NLwkhyLLu6hja8ibPIpJvckfsdpneDHdXhIM7skuhyUv g==; X-IronPort-AV: E=McAfee;i="6400,9594,10429"; a="269878121" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="269878121" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2022 19:42:19 -0700 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="579333290" Received: from shsi505.ccr.corp.intel.com ([10.239.146.206]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2022 19:42:17 -0700 From: "Huang, Yanbo" To: devel@edk2.groups.io Cc: Yanbo Huang , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [PATCH] MdePkg/UefiDevicePathLib: reback the DevicePathUtilitiesStandaloneMm Date: Fri, 5 Aug 2022 10:42:05 +0800 Message-Id: <20220805024205.42844-1-yanbo.huang@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yanbo Huang reback the DevicePathUtilitiesStandaloneMm to unblock the downstream sync Signed-off-by: Yanbo Huang CC: Michael D Kinney CC: Liming Gao CC: Zhiguang Liu --- .../DevicePathUtilitiesStandaloneMm.c | 39 ++++++++++ .../UefiDevicePathLibStandaloneMm.inf | 75 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c new file mode 100644 index 0000000000..096f835b90 --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c @@ -0,0 +1,39 @@ +/** @file + Device Path services. The thing to remember is device paths are built out of + nodes. The device path is terminated by an end node that is length + sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL) + all over this file. + + The only place where multi-instance device paths are supported is in + environment varibles. Multi-instance device paths should never be placed + on a Handle. + + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "UefiDevicePathLib.h" + +/** + Retrieves the device path protocol from a handle. + + This function returns the device path protocol from the handle specified by Handle. + If Handle is NULL or Handle does not contain a device path protocol, then NULL + is returned. + + @param Handle The handle from which to retrieve the device + path protocol. + + @return The device path protocol from the handle specified by Handle. + +**/ +EFI_DEVICE_PATH_PROTOCOL * +EFIAPI +DevicePathFromHandle ( + IN EFI_HANDLE Handle + ) +{ + return NULL; +} diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf new file mode 100644 index 0000000000..23fedf38b7 --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf @@ -0,0 +1,75 @@ +## @file +# Instance of Device Path Library based on Memory Allocation Library. +# +# Device Path Library that layers on top of the Memory Allocation Library. +# +# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = UefiDevicePathLib + MODULE_UNI_FILE = UefiDevicePathLib.uni + FILE_GUID = D8E58437-44D3-4154-B7A7-EB794923EF12 + MODULE_TYPE = MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + VERSION_STRING = 1.0 + LIBRARY_CLASS = DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE + + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + DevicePathUtilities.c + DevicePathUtilitiesStandaloneMm.c + DevicePathToText.c + DevicePathFromText.c + UefiDevicePathLib.c + UefiDevicePathLib.h + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + MemoryAllocationLib + DebugLib + BaseMemoryLib + PcdLib + PrintLib + +[Guids] + ## SOMETIMES_CONSUMES ## GUID + gEfiVTUTF8Guid + ## SOMETIMES_CONSUMES ## GUID + gEfiVT100Guid + ## SOMETIMES_CONSUMES ## GUID + gEfiVT100PlusGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiPcAnsiGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiUartDevicePathGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiSasDevicePathGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiVirtualDiskGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiVirtualCdGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiPersistentVirtualDiskGuid + ## SOMETIMES_CONSUMES ## GUID + gEfiPersistentVirtualCdGuid + +[Protocols] + gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMES + gEfiDebugPortProtocolGuid ## UNDEFINED + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdMaximumDevicePathNodeCount ## SOMETIMES_CONSUMES -- 2.31.1.windows.1