X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FLibrary%2FPlatformIntelBdsLib%2FIntelBdsPlatform.c;fp=ArmPlatformPkg%2FLibrary%2FPlatformIntelBdsLib%2FIntelBdsPlatform.c;h=5632b5da7500a2ce57d2b8309b7a8ce5eee14a8e;hp=8858668543294830a193985847043f2dc6de018f;hb=3858b4a1ff09d3243fea8d07bd135478237cb8f7;hpb=f1bbd4e3cc57c59a5d0efc9bf4f27cbc80810b36 diff --git a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c index 8858668543..5632b5da75 100644 --- a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c +++ b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c @@ -148,12 +148,23 @@ InitializeConsolePipe ( Status = BdsLibConnectDevicePath (DevicePath); if (!EFI_ERROR (Status)) { + // - // If BdsLibConnectDevicePath () succeeded, *Handle must have a non-NULL - // value. So ASSERT that this is the case. + // We connect all supplied console device paths, but only return the first + // one that connects successfully via *Handle/*Interface. Note that this + // may imply that *Handle/*Interface are not updated at all if they have + // been connected already, e.g., by the console splitter driver. // - gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, Handle); - ASSERT (*Handle != NULL); + if (*Interface == NULL) { + // + // 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); + + gBS->HandleProtocol (*Handle, Protocol, Interface); + } } DEBUG_CODE_BEGIN(); if (EFI_ERROR(Status)) { @@ -172,12 +183,6 @@ InitializeConsolePipe ( } } DEBUG_CODE_END(); - - // If the console splitter driver is not supported by the platform then use the first Device Path - // instance for the console interface. - if (!EFI_ERROR(Status) && (*Interface == NULL)) { - Status = gBS->HandleProtocol (*Handle, Protocol, Interface); - } } // No Device Path has been defined for this console interface. We take the first protocol implementation