From nobody Wed May 8 07:39:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+93578+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93578+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1662722115; cv=none; d=zohomail.com; s=zohoarc; b=KNA/Jm+9Nyaj3tpuie7tIQaebTQIk61anY+Ku24eOpEK4ffvx1J2Tq8cNzBT7bgMnwYns/hoXqa+iWEAmOVfJu54WsZHirqP+1bZherkpZPMCpfRSYrWelas7toyaat7CNqT7kc75ArBZz9yxxNXjaqYdzTkeGfR3r681lFvS14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662722115; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=1WoTgrGhkHWN+9XSUu1YSxe2D9u4dpt0ae8AqzAxZj4=; b=TZYAmSdIEFLpAWnoUvhoF5AvNuYgTzi6ra26z/jcL2e4bYssVyvlwQ468PGzeS+uJoOH2ErKfsQ5WfArnFAx+u2acKDRBiP+Z7B/XMh+scLWPeIDuTi0S1W4EpeMaYleaQ0hjeq5beVAxxpkwYPZr5e2fbvsVTA2tGX26heDMZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93578+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1662722115367241.32242791833755; Fri, 9 Sep 2022 04:15:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id o2ocYY1788612xF7xKH9lJen; Fri, 09 Sep 2022 04:15:15 -0700 X-Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web11.10.1662722112157686911 for ; Fri, 09 Sep 2022 04:15:14 -0700 X-Received: by mail-wr1-f48.google.com with SMTP id d2so2196168wrn.1 for ; Fri, 09 Sep 2022 04:15:13 -0700 (PDT) X-Gm-Message-State: 3CyYDI5yBJEpeciMqtAhoXzdx1787277AA= X-Google-Smtp-Source: AA6agR5a3c8MzMx/fa6OfdMRDSyMs4RJSRQIlMsNOXe4JGGCwgwcnQ08S1Ct4WFd3tHorj3j8ctUFQ== X-Received: by 2002:a5d:6d84:0:b0:220:5dda:a0e8 with SMTP id l4-20020a5d6d84000000b002205ddaa0e8mr7533266wrs.493.1662722112750; Fri, 09 Sep 2022 04:15:12 -0700 (PDT) X-Received: from localhost.localdomain (eth-east-parth2-46-193-66-249.wb.wifirst.net. [46.193.66.249]) by smtp.gmail.com with ESMTPSA id i11-20020adfb64b000000b00228df23bd51sm240537wre.82.2022.09.09.04.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 04:15:11 -0700 (PDT) From: =?UTF-8?B?VGjDqW8gSmVobA==?= To: devel@edk2.groups.io Cc: Leif Lindholm , Michael D Kinney , Isaac Oram , Pedro Falcato , Gerd Hoffmann , Stefan Hajnoczi Subject: [edk2-devel] [[edk2-platforms] Patch V2 3/4] QemuOpenBoardPkg: Enable stage 3 Date: Fri, 9 Sep 2022 13:15:03 +0200 Message-Id: <20220909111504.1661-4-theojehl76@gmail.com> In-Reply-To: <20220909111504.1661-1-theojehl76@gmail.com> References: <20220909111504.1661-1-theojehl76@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,theojehl76@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1662722115; bh=6iZTF1wuQTxOLIk9JvBvREW3DRlkKbvmmAgknKRiF0o=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=dvpweB41lAOabqF7bsZVr2rxUk+trIZbuHSXAen1BKb0QnyqWYBAWGHK8fJbIGzODFG qcTjsDh6OhSQcav1EFqYVaEmVyNJCR2wi/FyYPvpYL3FeM3W2ZmzDCC0pImBIqUrf/D/B RNjMVIw2BDSgH3SLDsCZX6/Ldl08Jy1nZMc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1662722115802100007 Content-Type: text/plain; charset="utf-8" This patch adds MinPlatform stage 3 (UEFI boot) functionality Stage 3 adds DxeMain, drivers and modules necessary to reach UEFI shell. Cc: Leif Lindholm Cc: Michael D Kinney Cc: Isaac Oram Cc: Pedro Falcato Cc: Gerd Hoffmann Cc: Stefan Hajnoczi Signed-off-by: Th=C3=A9o Jehl --- Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc = | 101 +++++++++ Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc = | 3 +- Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf = | 54 +++++ Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManage= rLib.inf | 39 ++++ Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManage= r.c | 105 ++++++++++ 5 files changed, 301 insertions(+), 1 deletion(-) diff --git a/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc b/Pl= atform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc new file mode 100644 index 000000000000..3e981c3b7209 --- /dev/null +++ b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc @@ -0,0 +1,101 @@ +## @file +# Common DSC content to begin Stage 3 enabling +# +# @copyright +# Copyright (C) 2022 Th=C3=A9o Jehl +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[LibraryClasses.Common] + PlatformBootManagerLib | OvmfPkg/Library/PlatformBootManagerLib/Platfor= mBootManagerLib.inf + BootLogoLib | MdeModulePkg/Library/BootLogoLib/BootLogoLib.i= nf + NvVarsFileLib | OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf + QemuFwCfgS3Lib | OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3L= ibFwCfg.inf + QemuLoadImageLib | OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoa= dImageLib.inf + QemuBootOrderLib | OvmfPkg/Library/QemuBootOrderLib/QemuBootOrder= Lib.inf + PlatformBmPrintScLib | OvmfPkg/Library/PlatformBmPrintScLib/PlatformB= mPrintScLib.inf + XenPlatformLib | OvmfPkg/Library/XenPlatformLib/XenPlatformLib.= inf + LoadLinuxLib | OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf + SerializeVariablesLib | OvmfPkg/Library/SerializeVariablesLib/Serializ= eVariablesLib.inf + BoardBootManagerLib | QemuOpenBoardPkg/Library/BoardBootManagerLib/B= oardBootManagerLib.inf + LocalApicLib | UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApi= cX2ApicLib.inf + IoLib | MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibInt= rinsic.inf + PciExpressLib | MdePkg/Library/BasePciExpressLib/BasePciExpres= sLib.inf + PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf + PciLib | MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf + DebugLib | MdePkg/Library/BaseDebugLibSerialPort/BaseDebu= gLibSerialPort.inf + SerialPortLib | PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib= .inf + +[Components.$(DXE_ARCH)] + MdeModulePkg/Core/Dxe/DxeMain.inf { + + NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf + } + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { + + PcdLib | MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCod= eRouterRuntimeDxe.inf + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf + MdeModulePkg/Universal/Metronome/Metronome.inf + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntim= eDxe.inf + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + UefiCpuPkg/CpuDxe/CpuDxe.inf + PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf + MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf + MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf + MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf + MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf + UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf + MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + FatPkg/EnhancedFatDxe/Fat.inf + OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf + + ShellPkg/Application/Shell/Shell.inf { + + ShellCommandLib | ShellPkg/Library/UefiShellCommandLib/UefiShellComm= andLib.inf + NULL | ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Co= mmandsLib.inf + NULL | ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1Co= mmandsLib.inf + NULL | ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Co= mmandsLib.inf + NULL | ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1= CommandsLib.inf + NULL | ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Co= mmandsLib.inf + NULL | ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstal= l1CommandsLib.inf + NULL | ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwor= k1CommandsLib.inf + HandleParsingLib | ShellPkg/Library/UefiHandleParsingLib/UefiHandleP= arsingLib.inf + PrintLib | MdePkg/Library/BasePrintLib/BasePrintLib.inf + BcfgCommandLib | ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellB= cfgCommandLib.inf + + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask | 0xFF + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize | FALSE + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize | 8000 + } + + MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf + OvmfPkg/PlatformDxe/Platform.inf + MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf + MdeModulePkg/Application/UiApp/UiApp.inf + OvmfPkg/IoMmuDxe/IoMmuDxe.inf + MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf + OvmfPkg/SioBusDxe/SioBusDxe.inf + MdeModulePkg/Bus/Pci/PciSioSerialDxe/PciSioSerialDxe.inf diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc b/Platform= /Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc index 897ba727cdb2..55c7c3e3cc00 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc +++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc @@ -38,7 +38,7 @@ OvmfPkg/OvmfPkg.dec =20 [PcdsFixedAtBuild] - gMinPlatformPkgTokenSpaceGuid.PcdBootStage | 2 + gMinPlatformPkgTokenSpaceGuid.PcdBootStage | 3 =20 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel | = 0x802A00C7 gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel | = 0x802A00C7 @@ -128,6 +128,7 @@ !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc !include QemuOpenBoardPkg/Include/Dsc/Stage1.dsc.inc !include QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc +!include QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc =20 [LibraryClasses.Common] QemuOpenFwCfgLib | QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/Qemu= OpenFwCfgLib.inf diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf b/Platform= /Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf index 548397dedb5b..8f14ad71c1f8 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf +++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf @@ -174,10 +174,64 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = =3D 0x800000 # Stage 3 Firmware Volumes # ########################### + +[FV.FvUefiBootUnCompressed] + !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf + FvNameGuid =3D D2F110DB-2388-4963-BEFD-5889EEE01569 + + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + + INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatu= sCodeRouterRuntimeDxe.inf + INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandle= rRuntimeDxe.inf + + INF MdeModulePkg/Universal/Metronome/Metronome.inf + INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf + INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + INF UefiCpuPkg/CpuDxe/CpuDxe.inf + INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeD= xe.inf + INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.i= nf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRu= ntimeDxe.inf + INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf + INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf + INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf + + INF OvmfPkg/IoMmuDxe/IoMmuDxe.inf + INF OvmfPkg/PlatformDxe/Platform.inf + + INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf + INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf + INF MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.i= nf + INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe= .inf + INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf + INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf + INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + + INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf + INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf + INF ShellPkg/Application/Shell/Shell.inf + + INF OvmfPkg/SioBusDxe/SioBusDxe.inf + INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + INF MdeModulePkg/Bus/Pci/PciSioSerialDxe/PciSioSerialDxe.inf + [FV.FvUefiBoot] !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf FvNameGuid =3D D0C15ADB-FE38-4331-841C-0E96C1B0FBFA =20 + INF MdeModulePkg/Core/Dxe/DxeMain.inf + + FILE FV_IMAGE =3D D2F110DB-2388-4963-BEFD-5889EEE01569 { + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRE= D =3D TRUE { + SECTION FV_IMAGE =3D FvUefiBootUncompressed + } + } + ########################### # # Stage 4 Firmware Volumes diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/Boa= rdBootManagerLib.inf b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootMana= gerLib/BoardBootManagerLib.inf new file mode 100644 index 000000000000..37425d711010 --- /dev/null +++ b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootM= anagerLib.inf @@ -0,0 +1,39 @@ +## @file +# The module definition file for BoardBootManagerLib. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BoardBootManagerLib + FILE_GUID =3D 3fe4b589-8bd9-46df-9322-d06fa2c278d6 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BoardBootManagerLib|DXE_DRIVER + + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + BoardBootManager.c + +[LibraryClasses] + BaseLib + UefiBootServicesTableLib + DebugLib + UefiLib + HobLib + UefiBootManagerLib + TimerLib + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + MinPlatformPkg/MinPlatformPkg.dec diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/Boa= rdBootManager.c b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLi= b/BoardBootManager.c new file mode 100644 index 000000000000..9fad6bc56dfd --- /dev/null +++ b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootM= anager.c @@ -0,0 +1,105 @@ +/** @file + This file include board specific boot manager callbacks + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +BOOLEAN mHotKeypressed =3D FALSE; +EFI_EVENT HotKeyEvent =3D NULL; +UINTN mBootMenuOptionNumber; + +/** + This function is called each second during the boot manager waits timeou= t. + + @param TimeoutRemain The remaining timeout. +**/ +VOID +EFIAPI +BoardBootManagerWaitCallback ( + UINT16 TimeoutRemain + ) +{ + EFI_STATUS Status; + EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TxtInEx; + EFI_KEY_DATA KeyData; + BOOLEAN PausePressed; + + // + // Pause on PAUSE key + // + Status =3D gBS->HandleProtocol (gST->ConsoleInHandle, &gEfiSimpleTextInp= utExProtocolGuid, (VOID **)&TxtInEx); + ASSERT_EFI_ERROR (Status); + + PausePressed =3D FALSE; + + while (TRUE) { + Status =3D TxtInEx->ReadKeyStrokeEx (TxtInEx, &KeyData); + if (EFI_ERROR (Status)) { + break; + } + + if (KeyData.Key.ScanCode =3D=3D SCAN_PAUSE) { + PausePressed =3D TRUE; + break; + } + } + + // + // Loop until non-PAUSE key pressed + // + while (PausePressed) { + Status =3D TxtInEx->ReadKeyStrokeEx (TxtInEx, &KeyData); + if (!EFI_ERROR (Status)) { + DEBUG ( + ( + DEBUG_INFO, "[PauseCallback] %x/%x %x/%x\n", + KeyData.Key.ScanCode, KeyData.Key.UnicodeChar, + KeyData.KeyState.KeyShiftState, KeyData.KeyState.KeyToggleSt= ate + ) + ); + PausePressed =3D (BOOLEAN)(KeyData.Key.ScanCode =3D=3D SCAN_PAUSE); + } + } +} + +/** + The function is called when no boot option could be launched, + including platform recovery options and options pointing to applications + built into firmware volumes. + + If this function returns, BDS attempts to enter an infinite loop. +**/ +VOID +EFIAPI +BoardBootManagerUnableToBoot ( + VOID + ) +{ + EFI_STATUS Status; + EFI_BOOT_MANAGER_LOAD_OPTION BootDeviceList; + CHAR16 OptionName[sizeof ("Boot####")]; + + if (mBootMenuOptionNumber =3D=3D LoadOptionNumberUnassigned) { + return; + } + + UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", mBootMenuOp= tionNumber); + Status =3D EfiBootManagerVariableToLoadOption (OptionName, &BootDeviceLi= st); + if (EFI_ERROR (Status)) { + return; + } + + for ( ;;) { + EfiBootManagerBoot (&BootDeviceList); + } +} --=20 2.32.1 (Apple Git-133) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#93578): https://edk2.groups.io/g/devel/message/93578 Mute This Topic: https://groups.io/mt/93570151/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-