X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FLibrary%2FPlatformIntelBdsLib%2FIntelBdsPlatform.c;h=8858668543294830a193985847043f2dc6de018f;hp=c07fc0f607d72472726fe0b3fa70136046d62b94;hb=9c8fe63c15d638a1a546ca4592c15d1612e2123e;hpb=43ac100ee416233cb4c3c81b33b2f5e7196d4afe
diff --git a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
index c07fc0f607..8858668543 100644
--- a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
+++ b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
Copyright (c) 2014, ARM Ltd. All rights reserved.
This program and the accompanying materials
@@ -45,6 +45,10 @@ PlatformBdsInit (
VOID
)
{
+ //
+ // Signal EndOfDxe PI Event
+ //
+ EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
}
STATIC
@@ -63,8 +67,11 @@ GetConsoleDevicePathFromVariable (
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 +81,6 @@ GetConsoleDevicePathFromVariable (
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,16 +146,24 @@ InitializeConsolePipe (
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
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;
- CHAR16* DevicePathTxt;
- EFI_STATUS Status;
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToTextProtocol;
+ CHAR16 *DevicePathTxt;
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
- if (!EFI_ERROR(Status)) {
+ DevicePathToTextProtocol = NULL;
+ gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **) &DevicePathToTextProtocol);
+ if (DevicePathToTextProtocol != NULL) {
DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (DevicePath, TRUE, TRUE);
DEBUG((EFI_D_ERROR,"Fail to start the console with the Device Path '%s'. (Error '%r')\n", DevicePathTxt, Status));
@@ -171,7 +184,7 @@ InitializeConsolePipe (
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);
}
@@ -179,8 +192,8 @@ InitializeConsolePipe (
*Handle = Buffer[0];
Status = gBS->HandleProtocol (*Handle, Protocol, Interface);
ASSERT_EFI_ERROR (Status);
+ FreePool (Buffer);
}
- FreePool (Buffer);
} else {
Status = EFI_SUCCESS;
}
@@ -302,6 +315,18 @@ PlatformBdsPolicyBehavior (
Status = PlatformBdsConnectConsole ();
ASSERT_EFI_ERROR (Status);
+
+ //
+ // Show the splash screen.
+ //
+ EnableQuietBoot (PcdGetPtr (PcdLogoFile));
+
+ //
+ // Connect _all_ devices, to pick up plug-in and removable devices
+ // TODO: do this more cleanly, permitting faster boot times when boot config
+ // is known
+ //
+ BdsLibConnectAll ();
}
/**