From nobody Fri Apr 26 17:38:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70177+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70177+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1610500470; cv=none; d=zohomail.com; s=zohoarc; b=Nuj7GsyLxm4i0Skft8C8l5whlzkZJ9SIAGq1MkcgO/PRZNtdvSVpmDAq3m8ZR6Ur+6O86ThCMoe6YYRObrpWCXED8TXJVn6L9IA9cYYiOJr5G80dyyDn0Xcwv7iaIvSh97Hvab5AkRfJBtuDIfGB3B5cWeIZRIrcBIDlnbdKGi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610500470; h=Content-Type:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=RVq2GNh5z35bOtdf6D3pxVExfqVqsKdHFOXOS8JvPRc=; b=V3CsY8cAQ1MOKkaJwJNo3g15GabWyAsuUYrWr08vUJPSrSqXVEOpEbqJCGD1CTLd3wTzelJKrzxZbn9/SfjwteQeGNA4BOGnhS3mDjV4zLqNVOVFl6OYUeW9du0O4By369+cYZFdn9FM1uKU8sd+j37rTg9M4x5RU1+QKVX9CPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70177+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610500469727372.0371024039522; Tue, 12 Jan 2021 17:14:29 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id h5LnYY1788612x8hIdDvxqvp; Tue, 12 Jan 2021 17:14:29 -0800 X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.1635.1610500465779731733 for ; Tue, 12 Jan 2021 17:14:28 -0800 X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 13 Jan 2021 09:14:19 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , "'Michael D Kinney'" , "'Liming Gao'" , "'Zhiguang Liu'" References: <20210105185935.3769-1-kun.q@outlook.com>,<16576B256B69BE5C.24224@groups.io> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyIDEwLzE2XSBNZGVQa2c6IFVlZmlEZXZpY2VQYXRoTGliOiBTdXBwb3J0IFVlZmlEZXZpY2VQYXRoTGliIHVuZGVyIFN0YW5kYWxvbmVNbQ==?= Date: Wed, 13 Jan 2021 09:14:21 +0800 Message-ID: <004401d6e949$6c94bde0$45be39a0$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQDiFYvRGBjddr93CbtoxNEjfCpvnAHwo7StAPq2tqqr9wzEAA== Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn X-Gm-Message-State: HWKIcYd6k0tgiyoEcCnai9TXx1787277AA= Content-Type: multipart/alternative; boundary="----=_NextPart_000_0045_01D6E98C.7AB9F9B0" Content-Language: zh-cn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610500469; bh=ZKg2n837Z/x25/E80lcEHF763Wzdo2Byt99M0ZORnmw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Jb6X/FySErEXszk2F6pJw8ElB1NpmuC/OVlly2w2hWDFd22uUkbIjsY90lVB5JdXsn/ VYWcSsngDUZ6KL/9e0IgHki1wRUpCpumVp8kDQHf2hyLdHyeSuc1kKscMHdC+yUzwYs5n wsCUwXnknetENpwzqGFcBkwWJTkFAweQnLc= X-ZohoMail-DKIM: pass (identity @groups.io) ------=_NextPart_000_0045_01D6E98C.7AB9F9B0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Kun: I am OK for this patch. Reviewed-by: Liming Gao =20 Thanks Liming =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+70137+4905953+8761045@groups.io =E4=BB=A3=E8=A1=A8 Kun Qin =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B41=E6=9C=8812=E6=97=A5 11= :27 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; Michael D Kinney ; 'Liming Gao' ; Zhiguang Liu =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePat= hLib: Support UefiDevicePathLib under StandaloneMm =20 Hi Michael/Liming/Zhiguang, =20 Do you have any suggestions/feedback on this specific patch? It would be helpful if I can coalesce the changes before sending out v3 patch. =20 Thanks in advance. =20 Regards, Kun =20 From: Kun Qin =20 Sent: Tuesday, January 5, 2021 11:00 To: devel@edk2.groups.io =20 Cc: Michael D Kinney ; Liming Gao ; Zhiguang Liu =20 Subject: [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under StandaloneMm =20 This change added an instance of UefiDevicePathLib for StandaloneMm. It abstracts DevicePathFromHandle function into different files for Standalone MM and other instances to avoid linking gBS into MM_STANDALONE drivers. Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Kun Qin > --- Notes: v2: - No review, no change. MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c | 33 ------------- MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c | 51 ++++++++++++++++++++ MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c | 40 +++++++++++++++ MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf | 1 + =20 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol .inf | 1 + MdePkg/Library/UefiDevicePathLib/{UefiDevicePathLib.inf =3D> UefiDevicePathLibStandaloneMm.inf} | 11 +++-- MdePkg/MdePkg.dsc | 1 + 7 files changed, 100 insertions(+), 38 deletions(-) diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c index 9274ef8dda98..7d5fb18d2516 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c @@ -806,39 +806,6 @@ UefiDevicePathLibIsDevicePathMultiInstance ( } =20 =20 -/** - 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 - ) -{ - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - EFI_STATUS Status; - - Status =3D gBS->HandleProtocol ( - Handle, - &gEfiDevicePathProtocolGuid, - (VOID *) &DevicePath - ); - if (EFI_ERROR (Status)) { - DevicePath =3D NULL; - } - return DevicePath; -} - /** Allocates a device path for a file and appends it to an existing device path. =20 diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c new file mode 100644 index 000000000000..7f3b6076ef34 --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c @@ -0,0 +1,51 @@ +/** @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 + ) +{ + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_STATUS Status; + + Status =3D gBS->HandleProtocol ( + Handle, + &gEfiDevicePathProtocolGuid, + (VOID *) &DevicePath + ); + if (EFI_ERROR (Status)) { + DevicePath =3D NULL; + } + return DevicePath; +} diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c new file mode 100644 index 000000000000..930e778d373a --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c @@ -0,0 +1,40 @@ +/** @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/UefiDevicePathLib.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf index 3c41c0695a72..eb85a54a74c3 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf @@ -26,6 +26,7 @@ [Defines] =20 [Sources] DevicePathUtilities.c + DevicePathUtilitiesDxeSmm.c DevicePathToText.c DevicePathFromText.c UefiDevicePathLib.c diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtoc ol.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtoc ol.inf index e812e3e1d41e..81323bc70061 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtoc ol.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtoc ol.inf @@ -29,6 +29,7 @@ [Defines] =20 [Sources] DevicePathUtilities.c + DevicePathUtilitiesDxeSmm.c DevicePathToText.c DevicePathFromText.c UefiDevicePathLibOptionalDevicePathProtocol.c diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf similarity index 79% copy from MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf copy to MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf index 3c41c0695a72..23fedf38b7eb 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf @@ -4,6 +4,7 @@ # 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 # @@ -14,10 +15,11 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D UefiDevicePathLib MODULE_UNI_FILE =3D UefiDevicePathLib.uni - FILE_GUID =3D 91c1677a-e57f-4191-8b8e-eb7711a716e0 - MODULE_TYPE =3D UEFI_DRIVER + FILE_GUID =3D D8E58437-44D3-4154-B7A7-EB794923EF12 + MODULE_TYPE =3D MM_STANDALONE + PI_SPECIFICATION_VERSION =3D 0x00010032 VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D DevicePathLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE MM_STANDALONE + LIBRARY_CLASS =3D DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE =20 =20 # @@ -26,6 +28,7 @@ [Defines] =20 [Sources] DevicePathUtilities.c + DevicePathUtilitiesStandaloneMm.c DevicePathToText.c DevicePathFromText.c UefiDevicePathLib.c @@ -34,7 +37,6 @@ [Sources] [Packages] MdePkg/MdePkg.dec =20 - [LibraryClasses] BaseLib MemoryAllocationLib @@ -71,4 +73,3 @@ [Protocols] =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdMaximumDevicePathNodeCount ## SOMETIMES_CONSUMES - diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 8d1a5b20c9cd..ce009086815f 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -109,6 +109,7 @@ [Components] =20 MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.i nf MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf =20 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol .inf =20 MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePa thProtocol.inf MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf --=20 2.30.0.windows.1 =20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70177): https://edk2.groups.io/g/devel/message/70177 Mute This Topic: https://groups.io/mt/79640756/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- ------=_NextPart_000_0045_01D6E98C.7AB9F9B0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Kun:

 I am OK for this p= atch. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Thanks<= /o:p>

Liming

=B7=A2=BC=FE=C8=CB= : bounce+27952+70137+4905953+8761045@groups.io <bounce+27952= +70137+4905953+8761045@groups.io> =B4=FA=B1=ED Kun Qin
=B7=A2=CB= = =CD=CA=B1=BC=E4: 2021=C4=EA1=D4=C212=C8= =D5 11:27
=CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; Michael D Kinney= <michael.d.kinney@intel.com>; 'Liming Gao' <liming.gao@intel.com&= gt;; Zhiguang Liu <zhiguang.liu@intel.com>
=D6=F7=CC=E2<= span lang=3DEN-US>:
Re: [edk2-devel] [PATCH v= 2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under Standal= oneMm

 

Hi Michael/Liming/Zhiguang,

<= span lang=3DEN-US> 

Do you have any suggestions/feedback on this specific patch? It = would be helpful if I can coalesce the changes before sending out v3 patch.=

 

Thanks in advance.

 

Regards,

Kun

 

=

From: Kun Qin
Sent: Tuesda= y, January 5, 2021 11:00
To: devel@edk2.groups.io
Cc: Michael D Kinney; Liming Gao; Zhiguang Liu=
Subject: [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePat= hLib: Support UefiDevicePathLib under StandaloneMm

 

This cha= nge added an instance of UefiDevicePathLib for StandaloneMm. It
abstract= s DevicePathFromHandle function into different files for
Standalone MM a= nd other instances to avoid linking gBS into MM_STANDALONE
drivers.
<= br>Cc: Michael D Kinney <m= ichael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang L= iu <zhiguang.liu@intel.com= >

Signed-off-by: Kun Qin <kun.q@outlook.com>
---

Notes:
    v2:    - No review, no change.

 MdePkg/Library/Ue= fiDevicePathLib/DevicePathUtilities.c      &n= bsp;            = ;            &n= bsp;        | 33 -------------
 = MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c  &nb= sp;            =             &nb= sp;      | 51 ++++++++++++++++++++
 MdePkg= /Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c  &nb= sp;            =              | = 40 +++++++++++++++
 MdePkg/Library/UefiDevicePathLib/UefiDevicePath= Lib.inf           &n= bsp;            = ;            &n= bsp;   |  1 +
 MdePkg/Library/UefiDevicePathLib/Uefi= DevicePathLibOptionalDevicePathProtocol.inf     &n= bsp;        |  1 +
 MdePkg/= Library/UefiDevicePathLib/{UefiDevicePathLib.inf =3D> UefiDevicePathLibS= tandaloneMm.inf} | 11 +++--
 MdePkg/MdePkg.dsc   &nb= sp;            =             &nb= sp;            =             &nb= sp;            =            |  1 + 7 files changed, 100 insertions(+), 38 deletions(-)

diff --gi= t a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c b/MdePkg/Library= /UefiDevicePathLib/DevicePathUtilities.c
index 9274ef8dda98..7d5fb18d251= 6 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c
@@ -806,39= +806,6 @@ UefiDevicePathLibIsDevicePathMultiInstance (
 }
 = ;
 
-/**
-  Retrieves the device path protocol from a ha= ndle.
-
-  This function returns the device path protocol from t= he handle specified by Handle.
-  If Handle is NULL or Handle does = not contain a device path protocol, then NULL
-  is returned.
-<= br>-  @param  Handle       &nb= sp;            = The handle from which to retrieve the device
-    &= nbsp;           &nbs= p;            &= nbsp;       path protocol.
-
-  @r= eturn The device path protocol from the handle specified by Handle.
--**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-DevicePathFromHandle (<= br>-  IN EFI_HANDLE        &nb= sp;            = Handle
-  )
-{
-  EFI_DEVICE_PATH_PROTOCOL  *Devic= ePath;
-  EFI_STATUS        = ;        Status;
-
-  Status = = =3D gBS->HandleProtocol (
-       = ;           Handle,
-&= nbsp;           &nbs= p;     &gEfiDevicePathProtocolGuid,
-  = ;            &n= bsp;   (VOID *) &DevicePath
-     = ;             )= ;
-  if (EFI_ERROR (Status)) {
-    DevicePath = =3D NULL;
-  }
-  return DevicePath;
-}
-
 /= **
   Allocates a device path for a file and appends it to an = existing device path.
 
diff --git a/MdePkg/Library/UefiDevicePa= thLib/DevicePathUtilitiesDxeSmm.c b/MdePkg/Library/UefiDevicePathLib/Device= PathUtilitiesDxeSmm.c
new file mode 100644
index 000000000000..7f3b60= 76ef34
--- /dev/null
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePat= hUtilitiesDxeSmm.c
@@ -0,0 +1,51 @@
+/** @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
+&n= bsp; sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EF= I_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 Cor= poration. All rights reserved.<BR>
+  Copyright (c) Microsoft= Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+<= br>+**/
+
+#include "UefiDevicePathLib.h"
+
+
+/**=
+  Retrieves the device path protocol from a handle.
+
+&nbs= p; This function returns the device path protocol from the handle specified= by Handle.
+  If Handle is NULL or Handle does not contain a devic= e path protocol, then NULL
+  is returned.
+
+  @param&n= bsp; Handle          &nbs= p;          The handle from wh= ich to retrieve the device
+       &n= bsp;            = ;            &n= bsp;    path protocol.
+
+  @return The device pa= th protocol from the handle specified by Handle.
+
+**/
+EFI_DEVIC= E_PATH_PROTOCOL *
+EFIAPI
+DevicePathFromHandle (
+  IN EFI_H= ANDLE           &nbs= p;          Handle
+  = )
+{
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
+  E= FI_STATUS           =      Status;
+
+  Status =3D gBS->HandleP= rotocol (
+          &= nbsp;       Handle,
+   &nb= sp;            =   &gEfiDevicePathProtocolGuid,
+     &= nbsp;            (VO= ID *) &DevicePath
+        &= nbsp;         );
+  if (EFI= _ERROR (Status)) {
+    DevicePath =3D NULL;
+  }=
+  return DevicePath;
+}
diff --git a/MdePkg/Library/UefiDev= icePathLib/DevicePathUtilitiesStandaloneMm.c b/MdePkg/Library/UefiDevicePat= hLib/DevicePathUtilitiesStandaloneMm.c
new file mode 100644
index 000= 000000000..930e778d373a
--- /dev/null
+++ b/MdePkg/Library/UefiDevice= PathLib/DevicePathUtilitiesStandaloneMm.c
@@ -0,0 +1,40 @@
+/** @file=
+  Device Path services. The thing to remember is device paths are= built out of
+  nodes. The device path is terminated by an end nod= e that is length
+  sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be= why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
+  all over this fil= e.
+
+  The only place where multi-instance device paths are sup= ported is in
+  environment varibles. Multi-instance device paths s= hould never be placed
+  on a Handle.
+
+  Copyright (c)= 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+  = Copyright (c) Microsoft Corporation.
+  SPDX-License-Identifier: BS= D-2-Clause-Patent
+
+**/
+
+#include "UefiDevicePathLib.h&= quot;
+
+
+/**
+  Retrieves the device path protocol from = a handle.
+
+  This function returns the device path protocol fr= om the handle specified by Handle.
+  If Handle is NULL or Handle d= oes not contain a device path protocol, then NULL
+  is returned.+
+  @param  Handle       = ;            &n= bsp; The handle from which to retrieve the device
+   &nb= sp;            =             &nb= sp;        path protocol.
+
+ = ; @return The device path protocol from the handle specified by Handle.
= +
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+EFIAPI
+DevicePathFromHandl= e (
+  IN EFI_HANDLE        = ;            &n= bsp; Handle
+  )
+{
+  return NULL;
+}
diff --git = a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf b/MdePkg/Library/U= efiDevicePathLib/UefiDevicePathLib.inf
index 3c41c0695a72..eb85a54a74c3 = 100644
--- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+= ++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
@@ -26,6 +26= ,7 @@ [Defines]
 
 [Sources]
   DevicePathUtil= ities.c
+  DevicePathUtilitiesDxeSmm.c
   DevicePathTo= Text.c
   DevicePathFromText.c
   UefiDevicePathL= ib.c
diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOpti= onalDevicePathProtocol.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePat= hLibOptionalDevicePathProtocol.inf
index e812e3e1d41e..81323bc70061 1006= 44
--- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevic= ePathProtocol.inf
+++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathL= ibOptionalDevicePathProtocol.inf
@@ -29,6 +29,7 @@ [Defines]
  [Sources]
   DevicePathUtilities.c
+  DevicePa= thUtilitiesDxeSmm.c
   DevicePathToText.c
   Devi= cePathFromText.c
   UefiDevicePathLibOptionalDevicePathProtoco= l.c
diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf = b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
sim= ilarity index 79%
copy from MdePkg/Library/UefiDevicePathLib/UefiDeviceP= athLib.inf
copy to MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibSta= ndaloneMm.inf
index 3c41c0695a72..23fedf38b7eb 100644
--- a/MdePkg/Li= brary/UefiDevicePathLib/UefiDevicePathLib.inf
+++ b/MdePkg/Library/UefiD= evicePathLib/UefiDevicePathLibStandaloneMm.inf
@@ -4,6 +4,7 @@
 = # Device Path Library that layers on top of the Memory Allocation Library.<= br> #
 # Copyright (c) 2007 - 2018, Intel Corporation. All rig= hts reserved.<BR>
+# Copyright (c) Microsoft Corporation.
 = ;#
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #=
@@ -14,10 +15,11 @@ [Defines]
   INF_VERSION  &n= bsp;            = ;     =3D 0x00010005
   BASE_NAME &nb= sp;            =         =3D UefiDevicePathLib
 &= nbsp; MODULE_UNI_FILE         =        =3D UefiDevicePathLib.uni
-  F= ILE_GUID           &= nbsp;          =3D 91c1677a-e5= 7f-4191-8b8e-eb7711a716e0
-  MODULE_TYPE    &nb= sp;            =    =3D UEFI_DRIVER
+  FILE_GUID    &n= bsp;            = ;     =3D D8E58437-44D3-4154-B7A7-EB794923EF12
+&nbs= p; MODULE_TYPE          &= nbsp;         =3D MM_STANDALONE
= +  PI_SPECIFICATION_VERSION       =3D 0x= 00010032
   VERSION_STRING      =            =3D 1.0
-&n= bsp; LIBRARY_CLASS         &nb= sp;        =3D DevicePathLib|DXE_CORE DX= E_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM= _CORE MM_STANDALONE
+  LIBRARY_CLASS     &= nbsp;            =3D= DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE
 
 
&n= bsp;#
@@ -26,6 +28,7 @@ [Defines]
 
 [Sources]
 =   DevicePathUtilities.c
+  DevicePathUtilitiesStandaloneMm.c   DevicePathToText.c
   DevicePathFromText.c
&= nbsp;  UefiDevicePathLib.c
@@ -34,7 +37,6 @@ [Sources]
 [Pa= ckages]
   MdePkg/MdePkg.dec
 
-
 [LibraryC= lasses]
   BaseLib
   MemoryAllocationLib
@@ -= 71,4 +73,3 @@ [Protocols]
 
 [Pcd]
   gEfiMdeP= kgTokenSpaceGuid.PcdMaximumDevicePathNodeCount    ## SOMETIM= ES_CONSUMES
-
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
i= ndex 8d1a5b20c9cd..ce009086815f 100644
--- a/MdePkg/MdePkg.dsc
+++ b/= MdePkg/MdePkg.dsc
@@ -109,6 +109,7 @@ [Components]
   MdePk= g/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf   MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
=    MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+&nb= sp; MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
&= nbsp;  MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevic= ePathProtocol.inf
   MdePkg/Library/UefiDevicePathLibDevicePat= hProtocol/UefiDevicePathLibDevicePathProtocol.inf
   MdePkg/Li= brary/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
--
2.30.0.window= s.1




 

_._,_._,_

Gr= oups.io Links:

You receive all messages sent to this group.

Vie= w/Reply Online (#70177) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [importer@patchew.org]

_._,_._,_
=20 ------=_NextPart_000_0045_01D6E98C.7AB9F9B0--