From 6fa0057f8953a7077362901128be14171ed705b8 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Thu, 13 Nov 2025 18:51:39 +0000 Subject: [PATCH] libefivar: Support UefiDevicePathLib under StandaloneMm 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. No functional change intended, as this function and its invocation are ifdefd out. Obtained from: https://github.com/tianocore/edk2/commit/14a746bb6a92d59669c67a970479558734cf2383 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894 --- lib/libefivar/uefi-dputil.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/lib/libefivar/uefi-dputil.c b/lib/libefivar/uefi-dputil.c index 3a9cf7f374b..c557d7426fc 100644 --- a/lib/libefivar/uefi-dputil.c +++ b/lib/libefivar/uefi-dputil.c @@ -856,39 +856,6 @@ UefiDevicePathLibIsDevicePathMultiInstance ( } -/** - 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 = gBS->HandleProtocol ( - Handle, - &gEfiDevicePathProtocolGuid, - (VOID *) &DevicePath - ); - if (EFI_ERROR (Status)) { - DevicePath = NULL; - } - return DevicePath; -} - /** Allocates a device path for a file and appends it to an existing device path.