public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
@ 2018-02-03  1:06 Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 1/3] " Kinney, Michael D
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Kinney, Michael D @ 2018-02-03  1:06 UTC (permalink / raw)
  To: edk2-devel; +Cc: Sean Brogan, Jiewen Yao, Liming Gao, Michael D Kinney

V2:
* Use gBS->AllocatePool() instead of AllocatePool()
* Use gBS->FreePool() instead of FreePool()
* Add EfiLocateProtocolBuffer() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetVariable2() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetEfiGlobalVariable2 to IntelFrameworkPkg/FrameworkUefiLib

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.

Branch for review:

https://github.com/mdkinney/edk2/tree/Bug_838_EfiLocateProtocolBuffer_V4

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>

Kinney, Michael D (2):
  IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
  IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib

Michael D Kinney (1):
  MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

 .../Library/FrameworkUefiLib/UefiLib.c             | 214 ++++++++++++++++++++-
 MdePkg/Include/Library/UefiLib.h                   |  32 ++-
 MdePkg/Library/UefiLib/UefiLib.c                   | 112 ++++++++++-
 3 files changed, 355 insertions(+), 3 deletions(-)

-- 
2.14.2.windows.3



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch V2 1/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
  2018-02-03  1:06 [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Kinney, Michael D
@ 2018-02-03  1:06 ` Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 2/3] IntelFrameworkPkg/FrameworkUefiLib: " Kinney, Michael D
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Kinney, Michael D @ 2018-02-03  1:06 UTC (permalink / raw)
  To: edk2-devel; +Cc: Michael D Kinney, Sean Brogan, Jiewen Yao, Liming Gao

From: Michael D Kinney <michael.d.kinney@intel.com>

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>
---
 MdePkg/Include/Library/UefiLib.h |  32 ++++++++++-
 MdePkg/Library/UefiLib/UefiLib.c | 112 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 142 insertions(+), 2 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
diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c
index a7eee01240..f1a3f1c7af 100644
--- a/MdePkg/Library/UefiLib/UefiLib.c
+++ b/MdePkg/Library/UefiLib/UefiLib.c
@@ -5,7 +5,7 @@
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 
   and print messages on the console output and standard error devices.
 
-  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
   which accompanies this distribution.  The full text of the license may be found at
@@ -1605,3 +1605,113 @@ GetBestLanguage (
   //
   return NULL;
 }
+
+/**
+  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
+  )
+{
+  EFI_STATUS  Status;
+  UINTN       NoHandles;
+  EFI_HANDLE  *HandleBuffer;
+  UINTN       Index;
+
+  //
+  // Check input parameters
+  //
+  if (Protocol == NULL || NoProtocols == NULL || Buffer == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Initialze output parameters
+  //
+  *NoProtocols = 0;
+  *Buffer = NULL;
+
+  //
+  // Retrieve the array of handles that support Protocol
+  //
+  Status = gBS->LocateHandleBuffer (
+                  ByProtocol,
+                  Protocol,
+                  NULL,
+                  &NoHandles,
+                  &HandleBuffer
+                  );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  //
+  // Allocate array of protocol instances
+  //
+  Status = gBS->AllocatePool (
+                  EfiBootServicesData,
+                  NoHandles * sizeof (VOID *),
+                  (VOID **)Buffer
+                  );
+  if (EFI_ERROR (Status)) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+  ZeroMem (*Buffer, NoHandles * sizeof (VOID *));
+
+  //
+  // Lookup Protocol on each handle in HandleBuffer to fill in the array of
+  // protocol instances.  Handle case where protocol instance was present when
+  // LocateHandleBuffer() was called, but is not present when HandleProtocol()
+  // is called.
+  //
+  for (Index = 0, *NoProtocols = 0; Index < NoHandles; Index++) {
+    Status = gBS->HandleProtocol (
+                    HandleBuffer[Index],
+                    Protocol,
+                    &((*Buffer)[*NoProtocols])
+                    );
+    if (!EFI_ERROR (Status)) {
+      (*NoProtocols)++;
+    }
+  }
+
+  //
+  // Free the handle buffer
+  //
+  gBS->FreePool (HandleBuffer);
+
+  //
+  // Make sure at least one protocol instance was found
+  //
+  if (*NoProtocols == 0) {
+    gBS->FreePool (*Buffer);
+    *Buffer = NULL;
+    return EFI_NOT_FOUND;
+  }
+
+  return EFI_SUCCESS;
+}
-- 
2.14.2.windows.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch V2 2/3] IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
  2018-02-03  1:06 [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 1/3] " Kinney, Michael D
@ 2018-02-03  1:06 ` Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 3/3] IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib Kinney, Michael D
  2018-02-04  7:05 ` [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Zeng, Star
  3 siblings, 0 replies; 7+ messages in thread
From: Kinney, Michael D @ 2018-02-03  1:06 UTC (permalink / raw)
  To: edk2-devel; +Cc: Sean Brogan, Jiewen Yao, Liming Gao, Michael D Kinney

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>
---
 .../Library/FrameworkUefiLib/UefiLib.c             | 112 ++++++++++++++++++++-
 1 file changed, 111 insertions(+), 1 deletion(-)

diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
index 30b6dc9218..845f6ea173 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
@@ -5,7 +5,7 @@
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 
   and print messages on the console output and standard error devices.
 
-  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
   which accompanies this distribution.  The full text of the license may be found at
@@ -1475,3 +1475,113 @@ GetBestLanguage (
   //
   return NULL;
 }
+
+/**
+  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
+  )
+{
+  EFI_STATUS  Status;
+  UINTN       NoHandles;
+  EFI_HANDLE  *HandleBuffer;
+  UINTN       Index;
+
+  //
+  // Check input parameters
+  //
+  if (Protocol == NULL || NoProtocols == NULL || Buffer == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Initialze output parameters
+  //
+  *NoProtocols = 0;
+  *Buffer = NULL;
+
+  //
+  // Retrieve the array of handles that support Protocol
+  //
+  Status = gBS->LocateHandleBuffer (
+                  ByProtocol,
+                  Protocol,
+                  NULL,
+                  &NoHandles,
+                  &HandleBuffer
+                  );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  //
+  // Allocate array of protocol instances
+  //
+  Status = gBS->AllocatePool (
+                  EfiBootServicesData,
+                  NoHandles * sizeof (VOID *),
+                  (VOID **)Buffer
+                  );
+  if (EFI_ERROR (Status)) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+  ZeroMem (*Buffer, NoHandles * sizeof (VOID *));
+
+  //
+  // Lookup Protocol on each handle in HandleBuffer to fill in the array of
+  // protocol instances.  Handle case where protocol instance was present when
+  // LocateHandleBuffer() was called, but is not present when HandleProtocol()
+  // is called.
+  //
+  for (Index = 0, *NoProtocols = 0; Index < NoHandles; Index++) {
+    Status = gBS->HandleProtocol (
+                    HandleBuffer[Index],
+                    Protocol,
+                    &((*Buffer)[*NoProtocols])
+                    );
+    if (!EFI_ERROR (Status)) {
+      (*NoProtocols)++;
+    }
+  }
+
+  //
+  // Free the handle buffer
+  //
+  gBS->FreePool (HandleBuffer);
+
+  //
+  // Make sure at least one protocol instance was found
+  //
+  if (*NoProtocols == 0) {
+    gBS->FreePool (*Buffer);
+    *Buffer = NULL;
+    return EFI_NOT_FOUND;
+  }
+
+  return EFI_SUCCESS;
+}
-- 
2.14.2.windows.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch V2 3/3] IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib
  2018-02-03  1:06 [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 1/3] " Kinney, Michael D
  2018-02-03  1:06 ` [Patch V2 2/3] IntelFrameworkPkg/FrameworkUefiLib: " Kinney, Michael D
@ 2018-02-03  1:06 ` Kinney, Michael D
  2018-02-04  7:05 ` [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Zeng, Star
  3 siblings, 0 replies; 7+ messages in thread
From: Kinney, Michael D @ 2018-02-03  1:06 UTC (permalink / raw)
  To: edk2-devel; +Cc: Sean Brogan, Jiewen Yao, Liming Gao, Michael D Kinney

Add functions that have been added to MdePkg/UefiLib.

* GetVariable2()
* GetEfiGlobalVariable2

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>
---
 .../Library/FrameworkUefiLib/UefiLib.c             | 102 +++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
index 845f6ea173..895ff39fc1 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
@@ -1338,6 +1338,108 @@ GetEfiGlobalVariable (
   return GetVariable (Name, &gEfiGlobalVariableGuid);
 }
 
+/**
+  Returns the status whether get the variable success. The function retrieves
+  variable  through the UEFI Runtime Service GetVariable().  The
+  returned buffer is allocated using AllocatePool().  The caller is responsible
+  for freeing this buffer with FreePool().
+
+  If Name  is NULL, then ASSERT().
+  If Guid  is NULL, then ASSERT().
+  If Value is NULL, then ASSERT().
+
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.
+  @param[in]  Guid  The pointer to an EFI_GUID structure
+  @param[out] Value The buffer point saved the variable info.
+  @param[out] Size  The buffer size of the variable.
+
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.
+  @return EFI_SUCCESS               Find the specified variable.
+  @return Others Errors             Return errors from call to gRT->GetVariable.
+
+**/
+EFI_STATUS
+EFIAPI
+GetVariable2 (
+  IN CONST CHAR16    *Name,
+  IN CONST EFI_GUID  *Guid,
+  OUT VOID           **Value,
+  OUT UINTN          *Size OPTIONAL
+  )
+{
+  EFI_STATUS  Status;
+  UINTN       BufferSize;
+
+  ASSERT (Name != NULL && Guid != NULL && Value != NULL);
+
+  //
+  // Try to get the variable size.
+  //
+  BufferSize = 0;
+  *Value     = NULL;
+  if (Size != NULL) {
+    *Size  = 0;
+  }
+
+  Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
+  if (Status != EFI_BUFFER_TOO_SMALL) {
+    return Status;
+  }
+
+  //
+  // Allocate buffer to get the variable.
+  //
+  *Value = AllocatePool (BufferSize);
+  ASSERT (*Value != NULL);
+  if (*Value == NULL) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  //
+  // Get the variable data.
+  //
+  Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
+  if (EFI_ERROR (Status)) {
+    FreePool(*Value);
+    *Value = NULL;
+  }
+
+  if (Size != NULL) {
+    *Size = BufferSize;
+  }
+
+  return Status;
+}
+
+/**
+  Returns a pointer to an allocated buffer that contains the contents of a
+  variable retrieved through the UEFI Runtime Service GetVariable().  This
+  function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
+  The returned buffer is allocated using AllocatePool().  The caller is
+  responsible for freeing this buffer with FreePool().
+
+  If Name is NULL, then ASSERT().
+  If Value is NULL, then ASSERT().
+
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.
+  @param[out] Value The buffer point saved the variable info.
+  @param[out] Size  The buffer size of the variable.
+
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.
+  @return EFI_SUCCESS               Find the specified variable.
+  @return Others Errors             Return errors from call to gRT->GetVariable.
+
+**/
+EFI_STATUS
+EFIAPI
+GetEfiGlobalVariable2 (
+  IN CONST CHAR16    *Name,
+  OUT VOID           **Value,
+  OUT UINTN          *Size OPTIONAL
+  )
+{
+  return GetVariable2 (Name, &gEfiGlobalVariableGuid, Value, Size);
+}
 
 /**
   Returns a pointer to an allocated buffer that contains the best matching language 
-- 
2.14.2.windows.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
  2018-02-03  1:06 [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Kinney, Michael D
                   ` (2 preceding siblings ...)
  2018-02-03  1:06 ` [Patch V2 3/3] IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib Kinney, Michael D
@ 2018-02-04  7:05 ` Zeng, Star
  2018-02-11  0:17   ` Bret Barkelew
  2018-02-11  0:19   ` Bret Barkelew
  3 siblings, 2 replies; 7+ messages in thread
From: Zeng, Star @ 2018-02-04  7:05 UTC (permalink / raw)
  To: Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Kinney, Michael D, Yao, Jiewen, Gao, Liming, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com> to the patch series.

Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Kinney, Michael D
Sent: Saturday, February 3, 2018 9:07 AM
To: edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

V2:
* Use gBS->AllocatePool() instead of AllocatePool()
* Use gBS->FreePool() instead of FreePool()
* Add EfiLocateProtocolBuffer() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetVariable2() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetEfiGlobalVariable2 to IntelFrameworkPkg/FrameworkUefiLib

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.

Branch for review:

https://github.com/mdkinney/edk2/tree/Bug_838_EfiLocateProtocolBuffer_V4

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>

Kinney, Michael D (2):
  IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
  IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib

Michael D Kinney (1):
  MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

 .../Library/FrameworkUefiLib/UefiLib.c             | 214 ++++++++++++++++++++-
 MdePkg/Include/Library/UefiLib.h                   |  32 ++-
 MdePkg/Library/UefiLib/UefiLib.c                   | 112 ++++++++++-
 3 files changed, 355 insertions(+), 3 deletions(-)

--
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
  2018-02-04  7:05 ` [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Zeng, Star
@ 2018-02-11  0:17   ` Bret Barkelew
  2018-02-11  0:19   ` Bret Barkelew
  1 sibling, 0 replies; 7+ messages in thread
From: Bret Barkelew @ 2018-02-11  0:17 UTC (permalink / raw)
  To: Zeng, Star, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Kinney, Michael D, Yao, Jiewen, Zeng, Star, Gao, Liming

Approved.
Reviewd-By: Bret Barkelew Bret.Barkelew@microsoft.com

- Bret

From: Zeng, Star<mailto:star.zeng@intel.com>
Sent: Saturday, February 3, 2018 11:05 PM
To: Kinney, Michael D<mailto:michael.d.kinney@intel.com>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Kinney, Michael D<mailto:michael.d.kinney@intel.com>; Yao, Jiewen<mailto:jiewen.yao@intel.com>; Zeng, Star<mailto:star.zeng@intel.com>; Gao, Liming<mailto:liming.gao@intel.com>
Subject: Re: [edk2] [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

Reviewed-by: Star Zeng <star.zeng@intel.com> to the patch series.

Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Kinney, Michael D
Sent: Saturday, February 3, 2018 9:07 AM
To: edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

V2:
* Use gBS->AllocatePool() instead of AllocatePool()
* Use gBS->FreePool() instead of FreePool()
* Add EfiLocateProtocolBuffer() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetVariable2() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetEfiGlobalVariable2 to IntelFrameworkPkg/FrameworkUefiLib

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D838&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=GyqRTPAngLULHtzB0M%2FCp9lVbAarxSzLTwKUgCvoCQU%3D&reserved=0

Add new API to the UefiLib that locates and returns an array of protocols instances that match a given protocol.

Branch for review:

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmdkinney%2Fedk2%2Ftree%2FBug_838_EfiLocateProtocolBuffer_V4&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=aS5Jw32IzIf6B%2FLt%2BN6IsvbA%2B60YnsQT%2FgYiy%2BA5AVQ%3D&reserved=0

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>

Kinney, Michael D (2):
  IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
  IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib

Michael D Kinney (1):
  MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

 .../Library/FrameworkUefiLib/UefiLib.c             | 214 ++++++++++++++++++++-
 MdePkg/Include/Library/UefiLib.h                   |  32 ++-
 MdePkg/Library/UefiLib/UefiLib.c                   | 112 ++++++++++-
 3 files changed, 355 insertions(+), 3 deletions(-)

--
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-devel&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=pYocyCMvStgafQBnGHy0bWPZ%2B9y4ZCIZ%2BaYG7q%2FfpZU%3D&reserved=0
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-devel&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=pYocyCMvStgafQBnGHy0bWPZ%2B9y4ZCIZ%2BaYG7q%2FfpZU%3D&reserved=0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
  2018-02-04  7:05 ` [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Zeng, Star
  2018-02-11  0:17   ` Bret Barkelew
@ 2018-02-11  0:19   ` Bret Barkelew
  1 sibling, 0 replies; 7+ messages in thread
From: Bret Barkelew @ 2018-02-11  0:19 UTC (permalink / raw)
  To: Zeng, Star, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Kinney, Michael D, Yao, Jiewen, Zeng, Star, Gao, Liming

Approved.
Reviewed-By: Bret Barkelew Bret.Barkelew@microsoft.com


- Bret

From: Zeng, Star<mailto:star.zeng@intel.com>
Sent: Saturday, February 3, 2018 11:05 PM
To: Kinney, Michael D<mailto:michael.d.kinney@intel.com>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Kinney, Michael D<mailto:michael.d.kinney@intel.com>; Yao, Jiewen<mailto:jiewen.yao@intel.com>; Zeng, Star<mailto:star.zeng@intel.com>; Gao, Liming<mailto:liming.gao@intel.com>
Subject: Re: [edk2] [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

Reviewed-by: Star Zeng <star.zeng@intel.com> to the patch series.

Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Kinney, Michael D
Sent: Saturday, February 3, 2018 9:07 AM
To: edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

V2:
* Use gBS->AllocatePool() instead of AllocatePool()
* Use gBS->FreePool() instead of FreePool()
* Add EfiLocateProtocolBuffer() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetVariable2() to IntelFrameworkPkg/FrameworkUefiLib
* Add GetEfiGlobalVariable2 to IntelFrameworkPkg/FrameworkUefiLib

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D838&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=GyqRTPAngLULHtzB0M%2FCp9lVbAarxSzLTwKUgCvoCQU%3D&reserved=0

Add new API to the UefiLib that locates and returns an array of protocols instances that match a given protocol.

Branch for review:

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmdkinney%2Fedk2%2Ftree%2FBug_838_EfiLocateProtocolBuffer_V4&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=aS5Jw32IzIf6B%2FLt%2BN6IsvbA%2B60YnsQT%2FgYiy%2BA5AVQ%3D&reserved=0

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>

Kinney, Michael D (2):
  IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
  IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib

Michael D Kinney (1):
  MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

 .../Library/FrameworkUefiLib/UefiLib.c             | 214 ++++++++++++++++++++-
 MdePkg/Include/Library/UefiLib.h                   |  32 ++-
 MdePkg/Library/UefiLib/UefiLib.c                   | 112 ++++++++++-
 3 files changed, 355 insertions(+), 3 deletions(-)

--
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-devel&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=pYocyCMvStgafQBnGHy0bWPZ%2B9y4ZCIZ%2BaYG7q%2FfpZU%3D&reserved=0
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-devel&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cf7010dc9f4544f4b151008d56b9da29e%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C1%7C636533247176865805&sdata=pYocyCMvStgafQBnGHy0bWPZ%2B9y4ZCIZ%2BaYG7q%2FfpZU%3D&reserved=0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-11  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-03  1:06 [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Kinney, Michael D
2018-02-03  1:06 ` [Patch V2 1/3] " Kinney, Michael D
2018-02-03  1:06 ` [Patch V2 2/3] IntelFrameworkPkg/FrameworkUefiLib: " Kinney, Michael D
2018-02-03  1:06 ` [Patch V2 3/3] IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib Kinney, Michael D
2018-02-04  7:05 ` [Patch V2 0/3] MdePkg/UefiLib: Add EfiLocateProtocolBuffer() Zeng, Star
2018-02-11  0:17   ` Bret Barkelew
2018-02-11  0:19   ` Bret Barkelew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox