]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/EblCmdLib: remove dependency on deprecated ARM BdsLib
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 11 Apr 2017 09:12:50 +0000 (10:12 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 11 Apr 2017 09:32:57 +0000 (10:32 +0100)
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>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf

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