From c2cf8720a5aad74230767a1f11bade2d86de3745 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Feb 19 2019 08:15:05 +0000 Subject: MdeModulePkg/BmBoot: Report status when fail to load/start boot option REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1398 According to PI1.7 Spec, report extended data describing an EFI_STATUS return value along with EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR and EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED status code when fail to load or start boot option image. Cc: Jian J Wang Cc: Hao Wu Cc: Ruiyu Ni Cc: Laszlo Ersek Cc: Sean Brogan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Laszlo Ersek Reviewed-by: Ray Ni --- diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 6444fb4..9be1633 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1820,11 +1820,16 @@ EfiBootManagerBoot ( if (EFI_ERROR (Status)) { // - // Report Status Code to indicate that the failure to load boot option + // Report Status Code with the failure status to indicate that the failure to load boot option // - REPORT_STATUS_CODE ( + REPORT_STATUS_CODE_EX ( EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR) + (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR), + 0, + NULL, + NULL, + &Status, + sizeof (EFI_STATUS) ); BootOption->Status = Status; // @@ -1904,11 +1909,16 @@ EfiBootManagerBoot ( BootOption->Status = Status; if (EFI_ERROR (Status)) { // - // Report Status Code to indicate that boot failure + // Report Status Code with the failure status to indicate that boot failure // - REPORT_STATUS_CODE ( + REPORT_STATUS_CODE_EX ( EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED) + (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED), + 0, + NULL, + NULL, + &Status, + sizeof (EFI_STATUS) ); } PERF_END_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber);