#include <Library/PcdLib.h>\r
#include <Library/PlatformBmPrintScLib.h>\r
#include <Library/QemuBootOrderLib.h>\r
+#include <Library/TpmPlatformHierarchyLib.h>\r
#include <Library/UefiBootManagerLib.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/FirmwareVolume2.h>\r
#include <Protocol/PciRootBridgeIo.h>\r
#include <Protocol/VirtioDevice.h>\r
#include <Guid/EventGroup.h>\r
+#include <Guid/GlobalVariable.h>\r
#include <Guid/RootBridgesConnectedEventGroup.h>\r
#include <Guid/SerialPortLibVendor.h>\r
\r
//\r
// This is not an error, just an informative condition.\r
//\r
- DEBUG ((EFI_D_VERBOSE, "%a: %g: %r\n", __FUNCTION__, ProtocolGuid,\r
+ DEBUG ((DEBUG_VERBOSE, "%a: %g: %r\n", __FUNCTION__, ProtocolGuid,\r
Status));\r
return;\r
}\r
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0 /* Offset */,\r
sizeof Pci / sizeof (UINT32), &Pci);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));\r
+ DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));\r
return FALSE;\r
}\r
\r
NULL, // RemainingDevicePath -- produce all children\r
FALSE // Recursive\r
);\r
- DEBUG ((EFI_ERROR (Status) ? EFI_D_ERROR : EFI_D_VERBOSE, "%a: %s: %r\n",\r
+ DEBUG ((EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, "%a: %s: %r\n",\r
__FUNCTION__, ReportText, Status));\r
}\r
\r
\r
DevicePath = DevicePathFromHandle (Handle);\r
if (DevicePath == NULL) {\r
- DEBUG ((EFI_D_ERROR, "%a: %s: handle %p: device path not found\n",\r
+ DEBUG ((DEBUG_ERROR, "%a: %s: handle %p: device path not found\n",\r
__FUNCTION__, ReportText, Handle));\r
return;\r
}\r
\r
Status = EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,\r
+ DEBUG ((DEBUG_ERROR, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,\r
ReportText, Status));\r
return;\r
}\r
\r
Status = EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "%a: %s: adding to ErrOut: %r\n", __FUNCTION__,\r
+ DEBUG ((DEBUG_ERROR, "%a: %s: adding to ErrOut: %r\n", __FUNCTION__,\r
ReportText, Status));\r
return;\r
}\r
\r
- DEBUG ((EFI_D_VERBOSE, "%a: %s: added to ConOut and ErrOut\n", __FUNCTION__,\r
+ DEBUG ((DEBUG_VERBOSE, "%a: %s: added to ConOut and ErrOut\n", __FUNCTION__,\r
ReportText));\r
}\r
\r
//\r
Status = EfiBootManagerDeleteLoadOptionVariable (\r
BootOptions[Index].OptionNumber, LoadOptionTypeBoot);\r
- DEBUG_CODE (\r
+ DEBUG_CODE_BEGIN ();\r
CHAR16 *DevicePathString;\r
\r
DevicePathString = ConvertDevicePathToText(BootOptions[Index].FilePath,\r
FALSE, FALSE);\r
DEBUG ((\r
- EFI_ERROR (Status) ? EFI_D_WARN : EFI_D_VERBOSE,\r
+ EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,\r
"%a: removing stale Boot#%04x %s: %r\n",\r
__FUNCTION__,\r
(UINT32)BootOptions[Index].OptionNumber,\r
if (DevicePathString != NULL) {\r
FreePool (DevicePathString);\r
}\r
- );\r
+ DEBUG_CODE_END ();\r
}\r
\r
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
VOID\r
)\r
{\r
+ UINT16 FrontPageTimeout;\r
RETURN_STATUS PcdStatus;\r
+ EFI_STATUS Status;\r
\r
//\r
// Signal EndOfDxe PI Event\r
//\r
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);\r
\r
+ //\r
+ // Disable the TPM 2 platform hierarchy\r
+ //\r
+ ConfigureTpmPlatformHierarchy ();\r
+\r
//\r
// Dispatch deferred images after EndOfDxe event.\r
//\r
//\r
// Set the front page timeout from the QEMU configuration.\r
//\r
- PcdStatus = PcdSet16S (PcdPlatformBootTimeOut,\r
- GetFrontPageTimeoutFromQemu ());\r
+ FrontPageTimeout = GetFrontPageTimeoutFromQemu ();\r
+ PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout);\r
ASSERT_RETURN_ERROR (PcdStatus);\r
+ //\r
+ // Reflect the PCD in the standard Timeout variable.\r
+ //\r
+ Status = gRT->SetVariable (\r
+ EFI_TIME_OUT_VARIABLE_NAME,\r
+ &gEfiGlobalVariableGuid,\r
+ (EFI_VARIABLE_NON_VOLATILE |\r
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |\r
+ EFI_VARIABLE_RUNTIME_ACCESS),\r
+ sizeof FrontPageTimeout,\r
+ &FrontPageTimeout\r
+ );\r
+ DEBUG ((\r
+ EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,\r
+ "%a: SetVariable(%s, %u): %r\n",\r
+ __FUNCTION__,\r
+ EFI_TIME_OUT_VARIABLE_NAME,\r
+ FrontPageTimeout,\r
+ Status\r
+ ));\r
\r
//\r
// Register platform-specific boot options and keyboard shortcuts.\r