summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2018-01-02 10:40:07 -0800
committerMichael D Kinney <michael.d.kinney@intel.com>2018-02-11 15:10:03 -0800
commit40070a186a3175c4c034a5cf6d20b41f98d0cbd6 (patch)
treeb42dfcb6189a2a0b86e5302874b2a0b7ce7974fa /MdePkg/Include
parent6ef394ffe29bbc67038fc16ed540bfe6eed10e16 (diff)
downloadedk2-40070a186a3175c4c034a5cf6d20b41f98d0cbd6.tar.gz
edk2-40070a186a3175c4c034a5cf6d20b41f98d0cbd6.tar.bz2
edk2-40070a186a3175c4c034a5cf6d20b41f98d0cbd6.zip
MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
https://bugzilla.tianocore.org/show_bug.cgi?id=838 Add new API to the UefiLib that locates and returns an array of protocols instances that match a given protocol. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/UefiLib.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h
index 0b14792a0a..54bc2cc5a3 100644
--- a/MdePkg/Include/Library/UefiLib.h
+++ b/MdePkg/Include/Library/UefiLib.h
@@ -12,7 +12,7 @@
of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
defined, then debug and assert related macros wrapped by it are the NULL implementations.
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, 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 that accompanies this distribution.
The full text of the license may be found at
@@ -1490,4 +1490,34 @@ CatSPrint (
...
);
+/**
+ Returns an array of protocol instance that matches the given protocol.
+
+ @param[in] Protocol Provides the protocol to search for.
+ @param[out] NoProtocols The number of protocols returned in Buffer.
+ @param[out] Buffer A pointer to the buffer to return the requested
+ array of protocol instances that match Protocol.
+ The returned buffer is allocated using
+ EFI_BOOT_SERVICES.AllocatePool(). The caller is
+ responsible for freeing this buffer with
+ EFI_BOOT_SERVICES.FreePool().
+
+ @retval EFI_SUCCESS The array of protocols was returned in Buffer,
+ and the number of protocols in Buffer was
+ returned in NoProtocols.
+ @retval EFI_NOT_FOUND No protocols found.
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
+ matching results.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER NoProtocols is NULL.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLocateProtocolBuffer (
+ IN EFI_GUID *Protocol,
+ OUT UINTN *NoProtocols,
+ OUT VOID ***Buffer
+ );
#endif