EmbeddedPkg: get rid of BdsLib dependency from Android*Boot
authorLeif Lindholm <leif.lindholm@linaro.org>
Sat, 25 Nov 2017 13:16:20 +0000 (13:16 +0000)
committerLeif Lindholm <leif.lindholm@linaro.org>
Sat, 25 Nov 2017 19:01:09 +0000 (19:01 +0000)
The sum use these applications made of BdsLib was one invocation of the
IS_DEVICE_PATH_NODE macro, and (incorrectly) being able to leave out a
dependency on gEfiLoadedImageProtocolGuid.

So expand the macro in place and add the missing dependency.
Then clean up the .dsc, .inf and #includes accordingly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.c
EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.inf
EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c
EmbeddedPkg/EmbeddedPkg.dsc
EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf

index 977167d..e1e45e8 100644 (file)
@@ -15,7 +15,6 @@
 \r
 #include <Library/AndroidBootImgLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
-#include <Library/BdsLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
@@ -35,7 +34,8 @@ ValidateAndroidMediaDevicePath (
   NextNode = DevicePath;\r
   while (NextNode != NULL) {\r
     Node = NextNode;\r
-    if (IS_DEVICE_PATH_NODE (Node, MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP)) {\r
+    if (Node->Type == MEDIA_DEVICE_PATH &&\r
+        Node->SubType == MEDIA_HARDDRIVE_DP) {\r
       return EFI_SUCCESS;\r
     }\r
     NextNode = NextDevicePathNode (Node);\r
index f1ee0bd..c2bc68e 100644 (file)
@@ -28,7 +28,6 @@
   AndroidBootImgLib\r
   BaseLib\r
   BaseMemoryLib\r
-  BdsLib\r
   DebugLib\r
   DevicePathLib\r
   DxeServicesTableLib\r
index 1d9024b..404aa68 100644 (file)
@@ -17,7 +17,6 @@
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/LoadedImage.h>\r
 \r
-#include <Library/BdsLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
index d0af235..5b20176 100644 (file)
 \r
 [Components.ARM, Components.AARCH64]\r
   EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.inf\r
-  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf {\r
-    <LibraryClasses>\r
-      # It depends on BdsLib that depends on TimerLib\r
-      TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-  }\r
+  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf\r
   EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf\r
   EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf\r
 \r
index c92bac0..226b8b2 100644 (file)
@@ -43,6 +43,7 @@
 \r
 [Protocols]\r
   gAndroidBootImgProtocolGuid\r
+  gEfiLoadedImageProtocolGuid\r
 \r
 [Guids]\r
   gFdtTableGuid\r