From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) 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 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQDiFYvRGBjddr93CbtoxNEjfCpvnAHwo7StAPq2tqqr9wzEAA== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0045_01D6E98C.7AB9F9B0" Content-Language: zh-cn ------=_NextPart_000_0045_01D6E98C.7AB9F9B0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Kun: I am OK for this patch. Reviewed-by: Liming Gao =20 Thanks Liming =B7=A2=BC=FE=C8=CB: 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 ; 'Liming Gao' ; Zhiguang Liu =D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePathLib:= 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/UefiDevicePathLibOptionalDevicePathProtoc= ol .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 specifie= d by Handle. - If Handle is NULL or Handle does not contain a device path protocol, th= en NULL - is returned. - - @param Handle The handle from which to retrieve th= e 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 o= ut 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 place= d + 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 specifie= d by Handle. + If Handle is NULL or Handle does not contain a device path protocol, th= en NULL + is returned. + + @param Handle The handle from which to retrieve th= e 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 o= ut 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 place= d + 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 specifie= d by Handle. + If Handle is NULL or Handle does not contain a device path protocol, th= en NULL + is returned. + + @param Handle The handle from which to retrieve th= e 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/UefiDevicePathLibOptionalDevicePathProt= oc ol.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProt= oc ol.inf index e812e3e1d41e..81323bc70061 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProt= oc ol.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProt= oc 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/UefiDevicePathLibOptionalDevicePathProtoc= ol .inf =20 MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevice= Pa thProtocol.inf MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf --=20 2.30.0.windows.1 =20 ------=_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




 

------=_NextPart_000_0045_01D6E98C.7AB9F9B0--