From nobody Tue Nov 26 14:49:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52225+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52225+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1576287160; cv=none; d=zohomail.com; s=zohoarc; b=LIWTITcQHNo7mur4Q/nirDUx+X3fK7nOzoQvMZcncQilFptHwS7Ghj3yn8slBSiiFVaW3OquN4WCAYeDEjs1zAaYqJak7BhW/1qm1Ah3ReQSuWqCygD5QuoNneXtyo6JifqAPlaoqBTm+UWL9sYnxiBytuIMLMraAX5ACGUJuj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576287160; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6Tgqw0Be4vZ8f5Sx93TP3yEYKDdDXKTgyZkwjL5FEwE=; b=V47+xleWesvtptKLCfUI5EzfiKVuMjb4zonY5GTm7Dj333Xh8FaR6xtw9NtNzz8AX8kCT7StZMRxoIQ6XAUzKMe1g8oFpcJaoMrX8NL8y4Uui6ZrZJpw7Ls7wLXEqsODbjTTH+c4pQbk3T/8PVY49CTBI3tU+epv0UlZCZSJ49I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52225+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1576287160976605.0402067767174; Fri, 13 Dec 2019 17:32:40 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id yDD4YY1788612xzXUqDo3YC8; Fri, 13 Dec 2019 17:32:39 -0800 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.2430.1576287158438932734 for ; Fri, 13 Dec 2019 17:32:39 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 17:32:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,311,1571727600"; d="scan'208";a="297091514" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.84]) by orsmga001.jf.intel.com with ESMTP; 13 Dec 2019 17:32:38 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [PATCH 03/11] BoardModulePkg: Add BDS Hook DXE Driver Date: Fri, 13 Dec 2019 17:32:29 -0800 Message-Id: <4917b65e194ea62af08d6a811bc9ae332be2b538.1576282834.git.prince.agyeman@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,prince.agyeman@intel.com X-Gm-Message-State: mzsTi0fc2AkbGOZKxkF33rk0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1576287159; bh=g0A3JdPul0493TR5BeNqLRBa6qG0vSrz/GS5MHWQNMY=; h=Cc:Date:From:Reply-To:Subject:To; b=ryN9I5w35Vng3mX5NBCLLDFgMvtbM0K/daYVMCruqzQyxN30paablaIXjDOjWJYvUtr Ycw1UNLxKNd1RlpmVmepdyAZwfK+isjzi/Vty7jcfTNcEkfMhI0Eclfp2fvdBi854sWax zBsgCec/AdGSvZYVmeSZD07dR6N35A3j6kA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2336 This is a sample/generic DXE driver that registers all the BDS hook points or callbacks as defined in BoardBdsHookLib. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../BoardBdsHookDxe/BoardBdsHookDxe.c | 121 ++++++++++++++++++ .../BoardBdsHookDxe/BoardBdsHookDxe.inf | 46 +++++++ 2 files changed, 167 insertions(+) create mode 100644 Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsH= ookDxe.c create mode 100644 Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsH= ookDxe.inf diff --git a/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.= c b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.c new file mode 100644 index 0000000000..88eb7d70e9 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.c @@ -0,0 +1,121 @@ +/** @file + Bds Hook Point callbacks DXE driver + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +#include + +/** + Initialize DXE Platform. + + @param[in] ImageHandle Image handle of this driver. + @param[in] SystemTable Global system service table. + + @retval EFI_SUCCESS Initialization complete. + @exception EFI_UNSUPPORTED The chipset is unsupported by this driv= er. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize= the driver. + @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. +**/ +EFI_STATUS +EFIAPI +BdsHookDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_EVENT BeforeConsoleAfterTrustedConsoleEvent; + EFI_EVENT BeforeConsoleBeforeEndOfDxeEvent; + EFI_EVENT AfterConsoleReadyBeforeBootOptionEvent; + EFI_EVENT ReadyToBootEvent; + EFI_EVENT PciEnumCompleteEvent; + EFI_EVENT SmmReadyToLockEvent; + EFI_STATUS Status; + VOID *Registration; + + DEBUG ((DEBUG_INFO, "%a starts\n", __FUNCTION__ )); + + // + // Create event to set proper video resolution and text mode for interna= l shell. + // + Status =3D EfiCreateEventReadyToBootEx ( + TPL_CALLBACK, + BdsReadyToBootCallback, + NULL, + &ReadyToBootEvent + ); + ASSERT_EFI_ERROR (Status); + + // + // Create PCI Enumeration Completed callback for BDS + // + PciEnumCompleteEvent =3D EfiCreateProtocolNotifyEvent ( + &gEfiPciEnumerationCompleteProtocolGuid, + TPL_CALLBACK, + BdsPciEnumCompleteCallback, + NULL, + &Registration + ); + ASSERT (PciEnumCompleteEvent !=3D NULL); + + // + // Create PCI Enumeration Completed callback for BDS + // + SmmReadyToLockEvent =3D EfiCreateProtocolNotifyEvent ( + &gEfiDxeSmmReadyToLockProtocolGuid, + TPL_CALLBACK, + BdsSmmReadyToLockCallback, + NULL, + &Registration + ); + ASSERT (SmmReadyToLockEvent !=3D NULL); + + // + // Create BeforeConsoleAfterTrustedConsole event callback + // + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + BdsBeforeConsoleAfterTrustedConsoleCallback, + NULL, + &gBdsEventBeforeConsoleAfterTrustedConsoleGuid, + &BeforeConsoleAfterTrustedConsoleEvent + ); + ASSERT_EFI_ERROR (Status); + + // + // Create BeforeConsoleBeforeEndOfDxeGuid event callback + // + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + BdsBeforeConsoleBeforeEndOfDxeGuidCallback, + NULL, + &gBdsEventBeforeConsoleBeforeEndOfDxeGuid, + &BeforeConsoleBeforeEndOfDxeEvent + ); + ASSERT_EFI_ERROR (Status); + + // + // Create AfterConsoleReadyBeforeBootOption event callback + // + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + BdsAfterConsoleReadyBeforeBootOptionCallback, + NULL, + &gBdsEventAfterConsoleReadyBeforeBootOptionGuid, + &AfterConsoleReadyBeforeBootOptionEvent + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.= inf b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf new file mode 100644 index 0000000000..e3871d6dd4 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf @@ -0,0 +1,46 @@ +### @file +# Module Information file for the Bds Hook DXE driver. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D BoardBdsHookDxe + FILE_GUID =3D EEA6491C-0DC5-48AB-B99D-CE77D14D43F2 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + ENTRY_POINT =3D BdsHookDxeEntryPoint + +[LibraryClasses] + BaseLib + UefiBootServicesTableLib + UefiDriverEntryPoint + DebugLib + UefiLib + BoardBdsHookLib + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + SecurityPkg/SecurityPkg.dec + MinPlatformPkg/MinPlatformPkg.dec + BoardModulePkg/BoardModulePkg.dec + +[Sources] + BoardBdsHookDxe.c + +[Protocols] + gEfiPciEnumerationCompleteProtocolGuid + gEfiDxeSmmReadyToLockProtocolGuid + +[Guids] + gBdsEventBeforeConsoleAfterTrustedConsoleGuid + gBdsEventBeforeConsoleBeforeEndOfDxeGuid + gBdsEventAfterConsoleReadyBeforeBootOptionGuid + +[Depex] + TRUE --=20 2.19.1.windows.1 -=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 (#52225): https://edk2.groups.io/g/devel/message/52225 Mute This Topic: https://groups.io/mt/68590726/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-