From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.3079.1576895798033360843 for ; Fri, 20 Dec 2019 18:36:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=p2wKX9cT; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 18:36:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,338,1571727600"; d="scan'208";a="222607842" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2019 18:36:37 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 18:36:37 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 18:36:37 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 18:36:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/Q2Y0E9qFPGvluV+GeEZFGaT/hY+HVJiTKYryJLZi6702ZrVPlfQ+7RSnABwyFZ982A3kj7Cvo6He61GAzWLH5Kc02SXOxjT3tN2U8YLVZsjFScTDe6Ou+QhU8ceS2GA5y8gBaZtj4VLDVgspBvn0ODRmPeMZ29JVtpyWobcf2vE5eU2HIXG1rgnbfULz6PxOyKlKGNEkfqiKAHNwk7Dz0Gy5UWFcE4G9DZtfkYerrB1I/mjJrNztgPU0L613Pas0jbNM1H6rn56rHeDlf8r9Fdirkfd9fFqb3CWe+c4hR+119AzeX8DdEr4fiaL7gjSV6hgVowHvWIGWTBKLSG9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nbQvJvJOjRyJ/BibHl0a52y4kjiREYKSVmBBLIbMpXY=; b=UU0XxFrC35I9E+9fDThudic+N4wTjugDZa7q8v/dge8/mS9tkwkU3jXu/9iXtzneAPHJWh0FDppuPFV0KTtLMVTRYi1C2kYYEiqtK2mLZQ/NlT0mmwTBKHQDYsIhGu73vy+WO1Ur+CEyBKZvCCBVmJgB3gb4+oWIfpOcl9c4bT/62yTJtTbqPuNI49EuOfq5iXM6MXD6UTKmn1vbLTPjaMPQePQJ3rm7yi8ucEbgDa8ch5JhnVKjK61dd+P6ZkHzSPT/xQFUYvcagaB+DO4K5QcBfNCStMuWGqeLL9bvAbw40/50ow6pncITy3p64pC1nGlXGIcUFZFZ7UkBNVSyuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nbQvJvJOjRyJ/BibHl0a52y4kjiREYKSVmBBLIbMpXY=; b=p2wKX9cTho7fWvIlsrc9fAHVke/7Anc1uOycRcD2vEcnAIEgczyApgdpnJKyYcZwyumP2yHwcd/hgbtmMna22FMJ16O1L8rJ9XaI/yDTS7Nov0zdPfxoV/4ZZ/jaWB0v8U5/GyVYaHDoDnjufnsqFJbj9ajI7P2k06g9NtUgeG4= Received: from BY5PR11MB4484.namprd11.prod.outlook.com (52.132.254.155) by BY5PR11MB4482.namprd11.prod.outlook.com (52.132.255.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14; Sat, 21 Dec 2019 02:36:28 +0000 Received: from BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::bc80:2ec3:11ba:2f8a]) by BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::bc80:2ec3:11ba:2f8a%3]) with mapi id 15.20.2559.017; Sat, 21 Dec 2019 02:36:28 +0000 From: "Kubacki, Michael A" To: "Agyeman, Prince" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" Subject: Re: [edk2-platforms] [PATCH 03/11] BoardModulePkg: Add BDS Hook DXE Driver Thread-Topic: [edk2-platforms] [PATCH 03/11] BoardModulePkg: Add BDS Hook DXE Driver Thread-Index: AQHVsh5rEuBv8wH5D0elarlnulpPUKfD51mg Date: Sat, 21 Dec 2019 02:36:28 +0000 Message-ID: References: <4917b65e194ea62af08d6a811bc9ae332be2b538.1576282834.git.prince.agyeman@intel.com> In-Reply-To: <4917b65e194ea62af08d6a811bc9ae332be2b538.1576282834.git.prince.agyeman@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzI2YWFiOWQtMzI3ZS00NTlkLWIyNzktMTQyMzQ0ZThmZjUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYWx1dHdGR3Y2RmI3WjNwK1VZcnN5b1g3K1pJdUd4UFFsN3NoWUxPbmlkdUR2WUpsWWtnNW0zTWVEbkhPSDBpbyJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 778a7da5-5c62-43d0-47bb-08d785be9516 x-ms-traffictypediagnostic: BY5PR11MB4482: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0258E7CCD4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(366004)(376002)(39860400002)(13464003)(189003)(199004)(8676002)(86362001)(55016002)(478600001)(316002)(33656002)(81156014)(53546011)(81166006)(54906003)(966005)(26005)(66476007)(66446008)(186003)(76116006)(66946007)(9686003)(64756008)(66556008)(6506007)(2906002)(5660300002)(4326008)(71200400001)(7696005)(107886003)(110136005)(8936002)(52536014);DIR:OUT;SFP:1102;SCL:1;SRVR:BY5PR11MB4482;H:BY5PR11MB4484.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AARL4Cr+OSETZTJf8IUwjhT7d5k4MQiIbgOaHaf72KnXvjNq4lJ87yxXTQX3C9xbC5Dwh9vDgjCSkoeQb+KoGZI4gIG8b2qQcgpis8/wWBLSFyDMXseRsxIy/ztM6zkSJgp8ho1njfUmxpmWpTwO08Nno3rjnRRXoSm7BvwXorJCymUhQ8zUqer8b9A1YapZKVYWRfyDV/kTfdJnCFV7k06/btF+J1SQrMFbnO3DLFp4aD2d3SphA4EWFF/o+wofL1tl02YzEesiXMBQD519S2FtIIKGsdhwDGV/HPtl96u8hVdeHwe+rX5Bx6u0qEqIoFMdKaXpS9HgxDnj/jCbTEaSTPpWXeG3R9blyiJmHX7dqIerNfsMxk8Zdiu8iuzavIo9ZvH4VeLZgHiT0SMCQsNA2r03f5se877RNnXKFqprx+7Hg9v4GYelCJqqxXZglhNfz+YlLLmSdsrG559rarvxgI2bFoh+ps7gUFAZSrB6/E5hq/ivHZAot/NfBQdHsFPrpZ4HTz08IIn97tETQ4/1St99ayDzNgDZw9CEqno= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 778a7da5-5c62-43d0-47bb-08d785be9516 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2019 02:36:28.6101 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: clPP0vrq67oUU0Bgi+liDI0aewj/7/JWIyI8sGpXc5lHcbXGnvWK895LKrt7yJJNSDq/1ZqQldeNAm7f7SAiVIXuT+xFLYMC6pP7QI+4A8g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4482 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki > -----Original Message----- > From: Agyeman, Prince > Sent: Friday, December 13, 2019 5:32 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > > Subject: [edk2-platforms] [PATCH 03/11] BoardModulePkg: Add BDS Hook > DXE Driver >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2336 >=20 > This is a sample/generic DXE driver that registers all the BDS hook point= s or > callbacks as defined in BoardBdsHookLib. >=20 > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone >=20 > Signed-off-by: Prince Agyeman > --- > .../BoardBdsHookDxe/BoardBdsHookDxe.c | 121 ++++++++++++++++++ > .../BoardBdsHookDxe/BoardBdsHookDxe.inf | 46 +++++++ > 2 files changed, 167 insertions(+) > create mode 100644 > Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.c > create mode 100644 > Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf >=20 > 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 > driver. > + @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 inter= nal > 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.in > f > b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.in > f > new file mode 100644 > index 0000000000..e3871d6dd4 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.in > f > @@ -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-CE77D14D43F= 2 > + 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 > -- > 2.19.1.windows.1