X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ArmPlatformPkg%2FBds%2FBds.c;h=1fab43976f29c0940be607acd85db3a776b99f40;hb=b51cffe12fbea45a1112bffea40a63efc7e79982;hp=d2b62252ede023f2d4c538266460bb45836a5015;hpb=13354807d4881376475c3dfa567df6b515aea9e0;p=mirror_edk2.git diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index d2b62252ed..1fab43976f 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright (c) 2011-2015, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -19,9 +19,9 @@ #include -#define EFI_SET_TIMER_TO_SECOND 10000000 +#include -EFI_HANDLE mImageHandle; +#define EFI_SET_TIMER_TO_SECOND 10000000 STATIC EFI_STATUS @@ -155,8 +155,8 @@ InitializeConsolePipe ( *Handle = Buffer[0]; Status = gBS->HandleProtocol (*Handle, Protocol, Interface); ASSERT_EFI_ERROR(Status); + FreePool (Buffer); } - FreePool (Buffer); } else { Status = EFI_SUCCESS; } @@ -258,7 +258,11 @@ DefineDefaultBootEntries ( ASSERT_EFI_ERROR(Status); DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (BootDevicePath, TRUE, TRUE); - ASSERT (StrCmp ((CHAR16*)PcdGetPtr(PcdDefaultBootDevicePath), DevicePathTxt) == 0); + if (StrCmp ((CHAR16*)PcdGetPtr (PcdDefaultBootDevicePath), DevicePathTxt) != 0) { + DEBUG ((EFI_D_ERROR, "Device Path given: '%s' Device Path expected: '%s'\n", + (CHAR16*)PcdGetPtr (PcdDefaultBootDevicePath), DevicePathTxt)); + ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER); + } FreePool (DevicePathTxt); DEBUG_CODE_END(); @@ -337,7 +341,7 @@ DefineDefaultBootEntries ( if (DefaultBootArgument == (CHAR16*)PcdGetPtr (PcdDefaultBootArgument)) { FreePool (AsciiDefaultBootArgument); - } else { + } else if (DefaultBootArgument != NULL) { FreePool (DefaultBootArgument); } } else { @@ -345,7 +349,7 @@ DefineDefaultBootEntries ( } } - return EFI_SUCCESS; + return Status; } EFI_STATUS @@ -393,7 +397,7 @@ StartDefaultBootOnTimeout ( } // Discard key in the buffer do { - Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); + Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); } while(!EFI_ERROR(Status)); gBS->CloseEvent (WaitList[0]); Print(L"\n\r"); @@ -408,8 +412,8 @@ StartDefaultBootOnTimeout ( UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BootOrder[Index]); Status = BdsStartBootOption (BootVariableName); if(!EFI_ERROR(Status)){ - // Boot option returned successfully, hence don't need to start next boot option - break; + // Boot option returned successfully, hence don't need to start next boot option + break; } // In case of success, we should not return from this call. } @@ -419,6 +423,24 @@ StartDefaultBootOnTimeout ( return EFI_SUCCESS; } +/** + An empty function to pass error checking of CreateEventEx (). + + @param Event Event whose notification function is being invoked. + @param Context Pointer to the notification function's context, + which is implementation-dependent. + +**/ +VOID +EFIAPI +EmptyCallbackFunction ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + return; +} + /** This function uses policy data from the platform to determine what operating system or system utility should be loaded and invoked. This function call @@ -451,6 +473,22 @@ BdsEntry ( UINT16 *BootNext; UINTN BootNextSize; CHAR16 BootVariableName[9]; + EFI_EVENT EndOfDxeEvent; + + // + // Signal EndOfDxe PI Event + // + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + EmptyCallbackFunction, + NULL, + &gEfiEndOfDxeEventGroupGuid, + &EndOfDxeEvent + ); + if (!EFI_ERROR (Status)) { + gBS->SignalEvent (EndOfDxeEvent); + } PERF_END (NULL, "DXE", NULL, 0); @@ -542,8 +580,6 @@ BdsInitialize ( { EFI_STATUS Status; - mImageHandle = ImageHandle; - Status = gBS->InstallMultipleProtocolInterfaces ( &ImageHandle, &gEfiBdsArchProtocolGuid, &gBdsProtocol,