public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib
@ 2017-04-11  9:14 Ard Biesheuvel
  2017-04-11  9:21 ` Leif Lindholm
  2017-04-11 11:18 ` Evan Lloyd
  0 siblings, 2 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-04-11  9:14 UTC (permalink / raw)
  To: edk2-devel, leif.lindholm; +Cc: ryan.harkin, Ard Biesheuvel

The EBL alternative shell depends indirectly on the deprecated ARM
BdsLib via EblCmdLib, which only uses a single helper function that
can easily be cloned. So clone it, and remove the dependency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c   | 49 +++++++++++++++++++-
 ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf |  1 -
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
index 4a5f2be3947e..5bcd750bf9f8 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
@@ -50,6 +50,53 @@ EblDumpFdt (
   );
 
 /**
+  Connect all DXE drivers
+
+  @retval EFI_SUCCESS           All drivers have been connected
+  @retval EFI_NOT_FOUND         No handles match the search.
+  @retval EFI_OUT_OF_RESOURCES  There is not resource pool memory to store the matching results.
+
+**/
+STATIC
+EFI_STATUS
+ConnectAllDrivers (
+  VOID
+  )
+{
+  UINTN                     HandleCount, Index;
+  EFI_HANDLE                *HandleBuffer;
+  EFI_STATUS                Status;
+
+  do {
+    // Locate all the driver handles
+    Status = gBS->LocateHandleBuffer (
+                AllHandles,
+                NULL,
+                NULL,
+                &HandleCount,
+                &HandleBuffer
+                );
+    if (EFI_ERROR (Status)) {
+      break;
+    }
+
+    // Connect every handles
+    for (Index = 0; Index < HandleCount; Index++) {
+      gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
+    }
+
+    if (HandleBuffer != NULL) {
+      FreePool (HandleBuffer);
+    }
+
+    // Check if new handles have been created after the start of the previous handles
+    Status = gDS->Dispatch ();
+  } while (!EFI_ERROR(Status));
+
+  return EFI_SUCCESS;
+}
+
+/**
   Simple arm disassembler via a library
 
   Argv[0] - symboltable
@@ -393,7 +440,7 @@ EblDevicePaths (
   EFI_DEVICE_PATH_PROTOCOL*          DevicePathProtocol;
   EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*  DevicePathToTextProtocol;
 
-  BdsConnectAllDrivers();
+  ConnectAllDrivers();
 
   Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
   if (EFI_ERROR (Status)) {
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
index c4b2ae1f6473..f33456abf3c2 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
@@ -51,7 +51,6 @@ [LibraryClasses]
   ArmDisassemblerLib
   PerformanceLib
   TimerLib
-  BdsLib
   FdtLib
 
 [Protocols]
-- 
2.9.3



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

* Re: [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib
  2017-04-11  9:14 [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib Ard Biesheuvel
@ 2017-04-11  9:21 ` Leif Lindholm
  2017-04-11 11:18 ` Evan Lloyd
  1 sibling, 0 replies; 4+ messages in thread
From: Leif Lindholm @ 2017-04-11  9:21 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel, ryan.harkin

On Tue, Apr 11, 2017 at 10:14:34AM +0100, Ard Biesheuvel wrote:
> The EBL alternative shell depends indirectly on the deprecated ARM
> BdsLib via EblCmdLib, which only uses a single helper function that
> can easily be cloned. So clone it, and remove the dependency.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Looks good, thanks!
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c   | 49 +++++++++++++++++++-
>  ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf |  1 -
>  2 files changed, 48 insertions(+), 2 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> index 4a5f2be3947e..5bcd750bf9f8 100644
> --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> @@ -50,6 +50,53 @@ EblDumpFdt (
>    );
>  
>  /**
> +  Connect all DXE drivers
> +
> +  @retval EFI_SUCCESS           All drivers have been connected
> +  @retval EFI_NOT_FOUND         No handles match the search.
> +  @retval EFI_OUT_OF_RESOURCES  There is not resource pool memory to store the matching results.
> +
> +**/
> +STATIC
> +EFI_STATUS
> +ConnectAllDrivers (
> +  VOID
> +  )
> +{
> +  UINTN                     HandleCount, Index;
> +  EFI_HANDLE                *HandleBuffer;
> +  EFI_STATUS                Status;
> +
> +  do {
> +    // Locate all the driver handles
> +    Status = gBS->LocateHandleBuffer (
> +                AllHandles,
> +                NULL,
> +                NULL,
> +                &HandleCount,
> +                &HandleBuffer
> +                );
> +    if (EFI_ERROR (Status)) {
> +      break;
> +    }
> +
> +    // Connect every handles
> +    for (Index = 0; Index < HandleCount; Index++) {
> +      gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
> +    }
> +
> +    if (HandleBuffer != NULL) {
> +      FreePool (HandleBuffer);
> +    }
> +
> +    // Check if new handles have been created after the start of the previous handles
> +    Status = gDS->Dispatch ();
> +  } while (!EFI_ERROR(Status));
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
>    Simple arm disassembler via a library
>  
>    Argv[0] - symboltable
> @@ -393,7 +440,7 @@ EblDevicePaths (
>    EFI_DEVICE_PATH_PROTOCOL*          DevicePathProtocol;
>    EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*  DevicePathToTextProtocol;
>  
> -  BdsConnectAllDrivers();
> +  ConnectAllDrivers();
>  
>    Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
>    if (EFI_ERROR (Status)) {
> diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> index c4b2ae1f6473..f33456abf3c2 100644
> --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> @@ -51,7 +51,6 @@ [LibraryClasses]
>    ArmDisassemblerLib
>    PerformanceLib
>    TimerLib
> -  BdsLib
>    FdtLib
>  
>  [Protocols]
> -- 
> 2.9.3
> 


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

* Re: [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib
  2017-04-11  9:14 [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib Ard Biesheuvel
  2017-04-11  9:21 ` Leif Lindholm
@ 2017-04-11 11:18 ` Evan Lloyd
  2017-04-11 11:18   ` Ard Biesheuvel
  1 sibling, 1 reply; 4+ messages in thread
From: Evan Lloyd @ 2017-04-11 11:18 UTC (permalink / raw)
  To: ard.biesheuvel@linaro.org, edk2-devel@lists.01.org,
	leif.lindholm@linaro.org
  Cc: ryan.harkin@linaro.org, ard.biesheuvel@linaro.org

Minor typo in title: "deprecared" should probably be deprecated?

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
Sent: 11 April 2017 10:15
To: edk2-devel@lists.01.org; leif.lindholm@linaro.org
Cc: ryan.harkin@linaro.org; ard.biesheuvel@linaro.org
Subject: [edk2] [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib

The EBL alternative shell depends indirectly on the deprecated ARM BdsLib via EblCmdLib, which only uses a single helper function that can easily be cloned. So clone it, and remove the dependency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c   | 49 +++++++++++++++++++-
 ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf |  1 -
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
index 4a5f2be3947e..5bcd750bf9f8 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
@@ -50,6 +50,53 @@ EblDumpFdt (
   );

 /**
+  Connect all DXE drivers
+
+  @retval EFI_SUCCESS           All drivers have been connected
+  @retval EFI_NOT_FOUND         No handles match the search.
+  @retval EFI_OUT_OF_RESOURCES  There is not resource pool memory to store the matching results.
+
+**/
+STATIC
+EFI_STATUS
+ConnectAllDrivers (
+  VOID
+  )
+{
+  UINTN                     HandleCount, Index;
+  EFI_HANDLE                *HandleBuffer;
+  EFI_STATUS                Status;
+
+  do {
+    // Locate all the driver handles
+    Status = gBS->LocateHandleBuffer (
+                AllHandles,
+                NULL,
+                NULL,
+                &HandleCount,
+                &HandleBuffer
+                );
+    if (EFI_ERROR (Status)) {
+      break;
+    }
+
+    // Connect every handles
+    for (Index = 0; Index < HandleCount; Index++) {
+      gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
+    }
+
+    if (HandleBuffer != NULL) {
+      FreePool (HandleBuffer);
+    }
+
+    // Check if new handles have been created after the start of the previous handles
+    Status = gDS->Dispatch ();
+  } while (!EFI_ERROR(Status));
+
+  return EFI_SUCCESS;
+}
+
+/**
   Simple arm disassembler via a library

   Argv[0] - symboltable
@@ -393,7 +440,7 @@ EblDevicePaths (
   EFI_DEVICE_PATH_PROTOCOL*          DevicePathProtocol;
   EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*  DevicePathToTextProtocol;

-  BdsConnectAllDrivers();
+  ConnectAllDrivers();

   Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
   if (EFI_ERROR (Status)) {
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
index c4b2ae1f6473..f33456abf3c2 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
@@ -51,7 +51,6 @@ [LibraryClasses]
   ArmDisassemblerLib
   PerformanceLib
   TimerLib
-  BdsLib
   FdtLib

 [Protocols]
--
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


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

* Re: [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib
  2017-04-11 11:18 ` Evan Lloyd
@ 2017-04-11 11:18   ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-04-11 11:18 UTC (permalink / raw)
  To: Evan Lloyd
  Cc: edk2-devel@lists.01.org, leif.lindholm@linaro.org,
	ryan.harkin@linaro.org

On 11 April 2017 at 12:18, Evan Lloyd <Evan.Lloyd@arm.com> wrote:
> Minor typo in title: "deprecared" should probably be deprecated?
>

Thanks Evan -- I spotted that myself, so I managed to fix it before pushing.


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
> Sent: 11 April 2017 10:15
> To: edk2-devel@lists.01.org; leif.lindholm@linaro.org
> Cc: ryan.harkin@linaro.org; ard.biesheuvel@linaro.org
> Subject: [edk2] [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib
>
> The EBL alternative shell depends indirectly on the deprecated ARM BdsLib via EblCmdLib, which only uses a single helper function that can easily be cloned. So clone it, and remove the dependency.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c   | 49 +++++++++++++++++++-
>  ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf |  1 -
>  2 files changed, 48 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> index 4a5f2be3947e..5bcd750bf9f8 100644
> --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
> @@ -50,6 +50,53 @@ EblDumpFdt (
>    );
>
>  /**
> +  Connect all DXE drivers
> +
> +  @retval EFI_SUCCESS           All drivers have been connected
> +  @retval EFI_NOT_FOUND         No handles match the search.
> +  @retval EFI_OUT_OF_RESOURCES  There is not resource pool memory to store the matching results.
> +
> +**/
> +STATIC
> +EFI_STATUS
> +ConnectAllDrivers (
> +  VOID
> +  )
> +{
> +  UINTN                     HandleCount, Index;
> +  EFI_HANDLE                *HandleBuffer;
> +  EFI_STATUS                Status;
> +
> +  do {
> +    // Locate all the driver handles
> +    Status = gBS->LocateHandleBuffer (
> +                AllHandles,
> +                NULL,
> +                NULL,
> +                &HandleCount,
> +                &HandleBuffer
> +                );
> +    if (EFI_ERROR (Status)) {
> +      break;
> +    }
> +
> +    // Connect every handles
> +    for (Index = 0; Index < HandleCount; Index++) {
> +      gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
> +    }
> +
> +    if (HandleBuffer != NULL) {
> +      FreePool (HandleBuffer);
> +    }
> +
> +    // Check if new handles have been created after the start of the previous handles
> +    Status = gDS->Dispatch ();
> +  } while (!EFI_ERROR(Status));
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
>    Simple arm disassembler via a library
>
>    Argv[0] - symboltable
> @@ -393,7 +440,7 @@ EblDevicePaths (
>    EFI_DEVICE_PATH_PROTOCOL*          DevicePathProtocol;
>    EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*  DevicePathToTextProtocol;
>
> -  BdsConnectAllDrivers();
> +  ConnectAllDrivers();
>
>    Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
>    if (EFI_ERROR (Status)) {
> diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> index c4b2ae1f6473..f33456abf3c2 100644
> --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
> @@ -51,7 +51,6 @@ [LibraryClasses]
>    ArmDisassemblerLib
>    PerformanceLib
>    TimerLib
> -  BdsLib
>    FdtLib
>
>  [Protocols]
> --
> 2.9.3
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


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

end of thread, other threads:[~2017-04-11 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11  9:14 [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib Ard Biesheuvel
2017-04-11  9:21 ` Leif Lindholm
2017-04-11 11:18 ` Evan Lloyd
2017-04-11 11:18   ` Ard Biesheuvel

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