Revision: 18375
          http://sourceforge.net/p/edk2/code/18375
Author:   abiesheuvel
Date:     2015-09-01 17:28:48 +0000 (Tue, 01 Sep 2015)
Log Message:
-----------
ArmPlatformPkg/PlatformIntelBdsLib: remove ARM BDS dependency

The Intel BDS platform library still depends on the ARM BDS specific
BdsLib. So replace its invocations with GenericBdsLib counterparts,
and fix up where needed, so that we can drop the dependency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
    trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h
    
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf

Modified: 
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
===================================================================
--- trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c    
2015-09-01 08:56:14 UTC (rev 18374)
+++ trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c    
2015-09-01 17:28:48 UTC (rev 18375)
@@ -63,8 +63,11 @@
   CHAR16*                   NextDevicePathStr;
   EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL  *EfiDevicePathFromTextProtocol;
 
-  Status = GetGlobalEnvironmentVariable (ConsoleVarName, NULL, NULL, 
(VOID**)&DevicePathInstances);
-  if (EFI_ERROR(Status)) {
+  Status = EFI_SUCCESS;
+  Size = 0;
+
+  DevicePathInstances = BdsLibGetVariableAndSize (ConsoleVarName, 
&gEfiGlobalVariableGuid, &Size);
+  if (DevicePathInstances == NULL) {
     // In case no default console device path has been defined we assume a 
driver handles the console (eg: SimpleTextInOutSerial)
     if ((DefaultConsolePaths == NULL) || (DefaultConsolePaths[0] == L'\0')) {
       *DevicePaths = NULL;
@@ -74,8 +77,6 @@
     Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, 
(VOID **)&EfiDevicePathFromTextProtocol);
     ASSERT_EFI_ERROR(Status);
 
-    DevicePathInstances = NULL;
-
     // Extract the Device Path instances from the multi-device path string
     while ((DefaultConsolePaths != NULL) && (DefaultConsolePaths[0] != L'\0')) 
{
       NextDevicePathStr = StrStr (DefaultConsolePaths, L";");
@@ -141,7 +142,15 @@
   while (ConsoleDevicePaths != NULL) {
     DevicePath = GetNextDevicePathInstance (&ConsoleDevicePaths, &Size);
 
-    Status = BdsConnectDevicePath (DevicePath, Handle, NULL);
+    Status = BdsLibConnectDevicePath (DevicePath);
+    if (!EFI_ERROR (Status)) {
+      //
+      // If BdsLibConnectDevicePath () succeeded, *Handle must have a non-NULL
+      // value. So ASSERT that this is the case.
+      //
+      gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, Handle);
+      ASSERT (*Handle != NULL);
+    }
     DEBUG_CODE_BEGIN();
       if (EFI_ERROR(Status)) {
         // We convert back to the text representation of the device Path
@@ -171,7 +180,7 @@
   if (*Interface == NULL) {
     Status = gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, &NoHandles, 
&Buffer);
     if (EFI_ERROR (Status)) {
-      BdsConnectAllDrivers ();
+      BdsLibConnectAll ();
       Status = gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, 
&NoHandles, &Buffer);
     }
 

Modified: 
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h
===================================================================
--- trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h    
2015-09-01 08:56:14 UTC (rev 18374)
+++ trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h    
2015-09-01 17:28:48 UTC (rev 18375)
@@ -19,7 +19,6 @@
 #include <Protocol/DevicePathToText.h>
 
 #include <Library/BaseMemoryLib.h>
-#include <Library/BdsLib.h>
 #include <Library/DebugLib.h>
 #include <Library/DevicePathLib.h>
 #include <Library/UefiBootServicesTableLib.h>

Modified: 
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
===================================================================
--- 
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf   
    2015-09-01 08:56:14 UTC (rev 18374)
+++ 
trunk/edk2/ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf   
    2015-09-01 17:28:48 UTC (rev 18375)
@@ -44,7 +44,6 @@
 [LibraryClasses]
   BaseLib
   BaseMemoryLib
-  BdsLib
   DebugLib
   DevicePathLib
   MemoryAllocationLib


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to