OvmfPkg: add library to track boot option loading/starting on the console

Introduce the Platform Boot Manager Print Status Code Library (for short,
PlatformBmPrintScLib) class for catching and printing the LoadImage() /
StartImage() preparations, and return statuses, that are reported by
UefiBootManagerLib.

In the primary library instance, catch only such status codes that
UefiBootManagerLib reports from the same module that contains
PlatformBmPrintScLib. The intent is to establish a reporting-printing
channel within BdsDxe, between UefiBootManagerLib and
PlatformBmPrintScLib. Ignore status codes originating elsewhence, e.g.
from UiApp's copy of UefiBootManagerLib.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Ray Ni <ray.ni@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Laszlo Ersek
2017-11-22 21:37:07 +01:00
parent 5cc67962ec
commit 77874ceebb
7 changed files with 425 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
## @file
# Register a status code handler for printing the Boot Manager's LoadImage()
# and StartImage() preparations, and return codes, to the UEFI console.
#
# This feature enables users that are not accustomed to analyzing the firmware
# log to glean some information about UEFI boot option processing (loading and
# starting).
#
# This library instance filters out (ignores) status codes that are not
# reported by the containing firmware module. The intent is to link this
# library instance into BdsDxe via PlatformBootManagerLib (which BdsDxe depends
# upon), then catch only those status codes that BdsDxe reports (which happens
# via UefiBootManagerLib). Status codes reported by other modules (such as
# UiApp), via UefiBootManagerLib or otherwise, are meant to be ignored.
#
# Copyright (C) 2019, Red Hat, Inc.
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
##
[Defines]
INF_VERSION = 1.27
BASE_NAME = PlatformBmPrintScLib
FILE_GUID = 3417c705-903e-41a7-9485-3fafebf60917
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = PlatformBmPrintScLib|DXE_DRIVER
[Sources]
StatusCodeHandler.c
[Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
[LibraryClasses]
BaseMemoryLib
DebugLib
DevicePathLib
MemoryAllocationLib
PcdLib
PrintLib
UefiBootManagerLib
UefiBootServicesTableLib
UefiLib
UefiRuntimeServicesTableLib
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart ## CONSUMES
[Protocols]
gEfiRscHandlerProtocolGuid ## CONSUMES
[Guids]
gEfiGlobalVariableGuid ## CONSUMES
gEfiStatusCodeSpecificDataGuid ## CONSUMES
[Depex.common.DXE_DRIVER]
gEfiRscHandlerProtocolGuid AND gEfiVariableArchProtocolGuid