summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-04-11 10:12:50 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-04-11 10:32:57 +0100
commitddbe62d6aec809f8049c5925e555db2f501b798b (patch)
treee74385fa35775b95c5a5e273f9c4e6f45bf58a7a /ArmPlatformPkg
parentf8c1facf34a1f65082fa22fdbc20a6e0ab8887b4 (diff)
downloadedk2-ddbe62d6aec809f8049c5925e555db2f501b798b.tar.gz
edk2-ddbe62d6aec809f8049c5925e555db2f501b798b.tar.bz2
edk2-ddbe62d6aec809f8049c5925e555db2f501b798b.zip
ArmPlatformPkg/EblCmdLib: remove dependency on deprecated 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> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c49
-rw-r--r--ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf1
2 files changed, 48 insertions, 2 deletions
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
index 4a5f2be394..5bcd750bf9 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 c4b2ae1f64..f33456abf3 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
@@ -51,7 +51,6 @@
ArmDisassemblerLib
PerformanceLib
TimerLib
- BdsLib
FdtLib
[Protocols]