From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.1189.1591851976440567510 for ; Wed, 10 Jun 2020 22:06:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Mfv2wrAQ; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: eric.dong@intel.com) IronPort-SDR: +FVArsw/l1o6a4EyGDg6aDhhMUJ+gOl4FgmLP4d5IOEYO26deVTfT/hxnR0ui63i+Syh+Lz+Gi xp44EZY2vN4Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2020 22:06:16 -0700 IronPort-SDR: 4zZO3Fmgc3VJyvAA/1nt8mE4Aq3hzn3wUXAcCV9zIt9Qs/iwgnVKmMizqHVAbxq6g0+GKnLImQ 2pQ2/jx4Qh2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,498,1583222400"; d="scan'208";a="296466153" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2020 22:06:15 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jun 2020 22:06:15 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jun 2020 22:06:14 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jun 2020 22:06:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yo6//b4A99/qqwnTBGtJYbihH9DwX3gfvsH5x3nn2+bY7NGUy/q/QAWt51wU8O8wUpROjds566WweGBWxe8F9EzkToE0kIti+7zVTfaux6Nh1+w3e/SZ7k17bRDD82VLPhuy9yMhsadHHr8CNL4QSx8G0tYw91tJUhVpqSYyQBLbXJaiLvae/1W/MoQkZEcVvQYUzsIW9bjaHgt/Fnny4l/J9Gv9LPhOpNipzX9L8+R4hd3sHy167IRc3GOQ7Y+HiamR+8ADXw0OxlvM+c1SGZEpjCMRkWLMkSOjG+rq/sCgMo6TJV9itjS9/XixrPeN4/VZGJ1G7ywsiFSeG3BGvQ== 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=76o61AAWS3Lr2J4LUy9c2ZxdpqXB+D74gqCYlw2NotU=; b=JCn/kP2XEmPYH2N3+cv1L0ECdF2V/T/p8qh8uNYShwBXPNRzIlXzdp5P7VRG5J/f/nsO5rT1z3vKuGLJ5kDD9CqxWsLnqAdgrQM204lh+mz5eI5FwNjnOd9NGzb6jmXSDKlfi7tA90P4YY/YJ/NhWinQkWY3kMsDeI+4R6lLzeqcFF/4tJn52MN4skv0kSQVXgZZNVEcGZqetm4HhVTkUdISq7GprqSVBkp/8RYbxfmajAsbESb5PUE87w5AmryN3oqDUngJqw9a4rzc2XXB4nQ4hw4BfNJjMeBDavb0YxkjLr8IWekbRubC7Lx593lh3h41xZ5Vox+UoTX2LzEr9w== 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=76o61AAWS3Lr2J4LUy9c2ZxdpqXB+D74gqCYlw2NotU=; b=Mfv2wrAQxwgMneIWmRkwfLsc4+EKg1jigK8gTEouZqUUXxOzB82LkSx1NaakzugWpcMcUUydvWngwN6VtaeAY/BnMk67TSl3EPhu1c4mFokOCkL+ve7BLNTILaPzszISAz4Ujf7HLK9/RTnWFPEHZtHQbUHDYvOfu4+ifPocUi0= Received: from DM6PR11MB3274.namprd11.prod.outlook.com (2603:10b6:5:b::26) by DM6PR11MB4547.namprd11.prod.outlook.com (2603:10b6:5:2a1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18; Thu, 11 Jun 2020 05:06:12 +0000 Received: from DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7]) by DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7%6]) with mapi id 15.20.3088.019; Thu, 11 Jun 2020 05:06:12 +0000 From: "Dong, Eric" To: "Tan, Ming" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH v2] Features/Intel/BeepDebugFeaturePkg: add it. Thread-Topic: [PATCH v2] Features/Intel/BeepDebugFeaturePkg: add it. Thread-Index: AQHWP4xXOozFoN8/eU227QxIY1Ed7qjSsgBg Date: Thu, 11 Jun 2020 05:06:12 +0000 Message-ID: References: <20200611010434.27119-1-ming.tan@intel.com> In-Reply-To: <20200611010434.27119-1-ming.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.210] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c1deb078-6f1a-47fc-6096-08d80dc5295c x-ms-traffictypediagnostic: DM6PR11MB4547: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 0431F981D8 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: v30vdZcxQj2wotSGlVGfftRCgl5oJhYQ5I44wOPgnlMaYW/WkNkDAelcLptlfSw7BOFZcBXEYbl055uSQeqC0rOPaKFZyXEzC7Fh32EXBWKdpEeb7bNZdqWJlQsPdjv8EoRZ6AgSCwdSTuz+z307Ks1QJDGjHVRYcvQLwV0KloMFXCym05/NuRWJ5NlCv6UrSqlhKVrr2e+jcrNsdS6Wc47Pp0GIlq2I5DA337k542jf6/5QPBx7rrIrfPCiNdphuFUg2HX90a3/mhxfdqfIchihqhUnTZI35w5d5yJThyvhGYJg/VTzMZWa6aW6G+Metdq1P32PmoV6Fe73GaYJoFhx21XXmzHEGi/cw/G+R8U9eS4fODN+Jp9Ahxqt6Yh4xC1Ou6EgYJX+sTGKixjVHQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3274.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(366004)(346002)(136003)(39860400002)(376002)(30864003)(86362001)(5660300002)(8936002)(4326008)(478600001)(53546011)(26005)(55016002)(316002)(7696005)(9686003)(110136005)(66574014)(186003)(33656002)(966005)(83380400001)(66476007)(52536014)(2906002)(66556008)(66946007)(64756008)(6506007)(76116006)(107886003)(66446008)(8676002)(71200400001)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: udDZEHhc9serjXpbcMrEYNkIGfcxT8c7MQmXfxqoEnftm9Nq479HKWQmOmETYHQlBBXkPvoeCyNhgVOYTI0lwp3CapJ0I5t4y5hicolGTqirl+//dA3M44NnBmMLsyDaIc5cQ7+m/a+vWx3X3zXl6lsYr5NXJoh0JUsv9yBYrX5GW4dqEbvvZiOqil9djwI1hK0Pkftm6asHMwloeeGejWcafGUXFtFGOeu7gXRhegC5MMu9CWFoNc/eGpS4MmUK2X3hxtLc+fFuhWFgpNfQBKResTGzyvIcwLxYc5nDH2clQeLibXmGz/Wn4GKK1XkbfyzZ4G0OQa3eLbxL26+R0WtUtbcyFAcqZYgPS5tzflfy9Z9LJAKaPGIgDADVigu16dKfzMETYbbSlsY/7Mv2gX9ENA0766kvVUPLijut9jeyuyQww2BGqDOLy9bxx4LeAfhEeFWw5PzwRM7erze84HEBenhh0J6iSdpUMIVWQCg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c1deb078-6f1a-47fc-6096-08d80dc5295c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2020 05:06:12.4684 (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: tOC7foEAwWh4R+kBdyJRFQApZePpWN0u9Of2ksKmAEB0+sVo7ayIoHtvKgY1ISKKwc3Am0Co5envJCcN/ElBwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4547 Return-Path: eric.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ming, > -----Original Message----- > From: Tan, Ming > Sent: Thursday, June 11, 2020 9:05 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Gao, Liming > Subject: [PATCH v2] Features/Intel/BeepDebugFeaturePkg: add it. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2792 >=20 > The BeepDebugFeaturePkg include some useful beep debug > libraries, such as get beep value from status code and beep. >=20 > It provide a library BeepStatusCodeHandlerLib used by edk2 > StatusCodeHandler.efi, used to do beep if needed. > It also provide a library of BeepMap lib, it map the status code > to beep value. > A library of Beep lib is needed by platform, and this pkg has a > Null implementation. >=20 > Cc: Eric Dong > Cc: Liming Gao > Signed-off-by: Ming Tan > --- > V2: Delete the last empty line in > BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf >=20 > .../BeepDebugFeaturePkg.dec | 31 ++ > .../BeepDebugFeaturePkg.dsc | 30 ++ > .../Include/BeepDebugFeature.dsc | 182 ++++++++++++ > .../Include/Library/BeepLib.h | 33 +++ > .../Include/Library/BeepMapLib.h | 32 +++ > .../Library/BeepLib/BeepLibNull.c | 37 +++ > .../Library/BeepLib/BeepLibNull.inf | 26 ++ > .../Library/BeepMapLib/BeepMapLib.c | 116 ++++++++ > .../Library/BeepMapLib/BeepMapLib.inf | 27 ++ > .../BeepMapLib/PlatformStatusCodesInternal.h | 270 > ++++++++++++++++++ > .../PeiBeepStatusCodeHandlerLib.c | 102 +++++++ > .../PeiBeepStatusCodeHandlerLib.inf | 55 ++++ > .../RuntimeDxeBeepStatusCodeHandlerLib.c | 183 ++++++++++++ > .../RuntimeDxeBeepStatusCodeHandlerLib.inf | 57 ++++ > .../SmmBeepStatusCodeHandlerLib.c | 138 +++++++++ > .../SmmBeepStatusCodeHandlerLib.inf | 55 ++++ > .../Debugging/BeepDebugFeaturePkg/Readme.md | 126 ++++++++ > 17 files changed, 1500 insertions(+) > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.d > ec > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.d > sc > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeat > ure.dsc > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib. > h > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepMa > pLib.h > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLib > Null.c > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLib > Null.inf > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Bee > pMapLib.c > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Bee > pMapLib.inf > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Plat > formStatusCodesInternal.h > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/PeiBeepStatusCodeHandlerLib.c > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/PeiBeepStatusCodeHandlerLib.inf > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.c > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/SmmBeepStatusCodeHandlerLib.c > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCode > HandlerLib/SmmBeepStatusCodeHandlerLib.inf > create mode 100644 > Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dec > b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dec > new file mode 100644 > index 0000000000..e80ce2f661 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dec > @@ -0,0 +1,31 @@ > +## @file >=20 > +# This package provides Beep Debug feature. >=20 > +# This package should only depend on EDK II Core packages, IntelSiliconP= kg, > and MinPlatformPkg. >=20 > +# >=20 > +# The DEC files are used by the utilities that parse DSC and >=20 > +# INF files to generate AutoGen.c and AutoGen.h files >=20 > +# for the build infrastructure. >=20 > +# >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + DEC_SPECIFICATION =3D 0x00010017 >=20 > + PACKAGE_NAME =3D BeepDebugFeaturePkg >=20 > + PACKAGE_GUID =3D DD88CEBB-E68F-4155-B754-D11E4FDF008D >=20 > + PACKAGE_VERSION =3D 0.1 >=20 > + >=20 > +[Includes] >=20 > + Include >=20 > + >=20 > +[LibraryClasses] >=20 1. Please add new added library class for this section. Just like the BeepL= ib, BeepMapLib... > + >=20 > +[Guids] >=20 > + gBeepDebugFeaturePkgTokenSpaceGuid =3D {0x54f56fb5, 0xea0e, 0x4518, > {0xa0, 0x3e, 0x1b, 0xeb, 0x56, 0x94, 0xd2, 0x16}} >=20 > + >=20 > +[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] >=20 > + # Beep is a legacy feature, disabled it by default >=20 > + > gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|FALSE|B > OOLEAN|0x00000001 >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dsc > b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dsc > new file mode 100644 > index 0000000000..47254f9974 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg > .dsc > @@ -0,0 +1,30 @@ > +## @file >=20 > +# This package provides Beep Debug feature. >=20 > +# This package should only depend on EDK II Core packages, IntelSiliconP= kg, > and MinPlatformPkg. >=20 > +# >=20 > +# The DEC files are used by the utilities that parse DSC and >=20 > +# INF files to generate AutoGen.c and AutoGen.h files >=20 > +# for the build infrastructure. >=20 > +# >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + PLATFORM_NAME =3D BeepDebugFeaturePkg >=20 > + PLATFORM_GUID =3D D716EDF2-77BB-4536-9C64-4D7EEF0F389= 6 >=20 > + PLATFORM_VERSION =3D 0.1 >=20 > + DSC_SPECIFICATION =3D 0x00010005 >=20 > + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME) >=20 > + SUPPORTED_ARCHITECTURES =3D IA32|X64 >=20 > + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT >=20 > + SKUID_IDENTIFIER =3D DEFAULT >=20 > + PEI_ARCH =3D IA32 >=20 > + DXE_ARCH =3D X64 >=20 > + >=20 > +# >=20 > +# This package always builds the feature. >=20 > +# >=20 > +!include Include/BeepDebugFeature.dsc >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFe > ature.dsc > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFe > ature.dsc > new file mode 100644 > index 0000000000..2ede28ca25 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFe > ature.dsc > @@ -0,0 +1,182 @@ > +## @file >=20 > +# This package provides Beep Debug feature. >=20 > +# This file should be included into another package DSC file to build th= is > feature. >=20 > +# >=20 > +# The DEC files are used by the utilities that parse DSC and >=20 > +# INF files to generate AutoGen.c and AutoGen.h files >=20 > +# for the build infrastructure. >=20 > +# >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +######################################################### > ####################### >=20 > +# >=20 > +# Defines Section - statements that will be processed to create a Makefi= le. >=20 > +# >=20 > +######################################################### > ####################### >=20 > +[Defines] >=20 > +!ifndef $(PEI_ARCH) >=20 > + !error "PEI_ARCH must be specified to build this feature!" >=20 > +!endif >=20 > +!ifndef $(DXE_ARCH) >=20 > + !error "DXE_ARCH must be specified to build this feature!" >=20 > +!endif >=20 > + >=20 > +######################################################### > ####################### >=20 > +# >=20 > +# PCD Section - list of PCD Entries modified by the feature. >=20 > +# >=20 > +######################################################### > ####################### >=20 > +[PcdsDynamicDefault] >=20 > + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE >=20 > + >=20 > +######################################################### > ####################### >=20 > +# >=20 > +# Library Class section - list of all Library Classes needed by this fea= ture. >=20 > +# >=20 > +######################################################### > ####################### >=20 > +[LibraryClasses] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf >=20 > + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf >=20 > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf >=20 > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf >=20 > + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf >=20 > + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf >=20 > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf >=20 > + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf >=20 > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf >=20 > + > TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTem > plate.inf >=20 > + > UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBo > otServicesTableLib.inf >=20 > + > UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry > Point.inf >=20 > + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf >=20 > + > UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib > /UefiRuntimeServicesTableLib.inf >=20 > + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf >=20 > + > OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN > ull/OemHookStatusCodeLibNull.inf >=20 > + > SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.= in > f >=20 > + >=20 > + BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf >=20 > + >=20 > + ##################################### >=20 > + # Beep Debug Feature Package >=20 > + ##################################### >=20 > + > BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf >=20 > + >=20 > +[LibraryClasses.common.PEIM] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf >=20 > + > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemory > AllocationLib.inf >=20 > + > PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/P > eiServicesTablePointerLibIdt.inf >=20 > + >=20 > +[LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA= 32 > .SEC] >=20 > + > ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiR > eportStatusCodeLib.inf >=20 > + >=20 > +[LibraryClasses.common.DXE_DRIVER] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf >=20 > + > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf >=20 > + >=20 > +[LibraryClasses.common.DXE_RUNTIME_DRIVER] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf >=20 > + > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf >=20 > + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf >=20 > + > ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCod > eLib/RuntimeDxeReportStatusCodeLib.inf >=20 > + >=20 > +[LibraryClasses.common.UEFI_DRIVER] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf >=20 > + > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf >=20 > + >=20 > +[LibraryClasses.X64.DXE_SMM_DRIVER] >=20 > + ####################################### >=20 > + # Edk2 Packages >=20 > + ####################################### >=20 > + > SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesT > ableLib.inf >=20 > + > MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe > moryAllocationLib.inf >=20 > + SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf >=20 > + SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf >=20 > + > ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/S > mmReportStatusCodeLib.inf >=20 > + >=20 > +######################################################### > ####################### >=20 > +# >=20 > +# Component section - list of all components that need built for this fe= ature. >=20 > +# >=20 > +# Note: The EDK II DSC file is not used to specify how compiled binary > images get placed >=20 > +# into firmware volume images. This section is just a list of modu= les to > compile from >=20 > +# source into UEFI-compliant binaries. >=20 > +# It is the FDF file that contains information on combining binary= files into > firmware >=20 > +# volume images, whose concept is beyond UEFI and is described in = PI > specification. >=20 > +# There may also be modules listed in this section that are not re= quired > in the FDF file, >=20 > +# When a module listed here is excluded from FDF file, then UEFI- > compliant binary will be >=20 > +# generated for it, but the binary will not be put into any firmwa= re > volume. >=20 > +# >=20 > +######################################################### > ####################### >=20 > +# >=20 > +# Feature PEI Components >=20 > +# >=20 > + >=20 > +# @todo: Change below line to [Components.$(PEI_ARCH)] after > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2308 >=20 > +# is completed. >=20 > +[Components.IA32] >=20 > + ##################################### >=20 > + # Beep Debug Feature Package >=20 > + ##################################### >=20 > + >=20 > + > MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.in > f { >=20 > + >=20 > + > NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepSt > atusCodeHandlerLib.inf >=20 > + } >=20 > + >=20 > + # Add components here that should be included in the package build. >=20 > + >=20 > +# >=20 > +# Feature DXE Components >=20 > +# >=20 > + >=20 > +# @todo: Change below line to [Components.$(DXE_ARCH)] after > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2308 >=20 > +# is completed. >=20 > +[Components.X64] >=20 > + ##################################### >=20 > + # Beep Debug Feature Package >=20 > + ##################################### >=20 > + >=20 > + > MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHan > dlerRuntimeDxe.inf { >=20 > + >=20 > + > NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeD > xeBeepStatusCodeHandlerLib.inf >=20 > + } >=20 > + >=20 > + > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf { >=20 > + >=20 > + > NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeep > StatusCodeHandlerLib.inf >=20 > + } >=20 > + >=20 > + # Add components here that should be included in the package build. >=20 > + >=20 > +######################################################### > ########################################## >=20 > +# >=20 > +# BuildOptions Section - Define the module specific tool chain flags tha= t > should be used as >=20 > +# the default flags for a module. These flags are= appended to > any >=20 > +# standard flags that are defined by the build pr= ocess. They can > be >=20 > +# applied for any modules or only those modules w= ith the > specific >=20 > +# module style (EDK or EDKII) specified in [Compo= nents] section. >=20 > +# >=20 > +# For advanced features, it is recommended to ena= ble > [BuildOptions] in >=20 > +# the applicable INF file so it does not affect t= he whole board > package >=20 > +# build when this DSC file is active. >=20 > +# >=20 > +######################################################### > ########################################## >=20 > +[BuildOptions] >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLi > b.h > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLi > b.h > new file mode 100644 > index 0000000000..f768acc557 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLi > b.h > @@ -0,0 +1,33 @@ > +/** @file >=20 > + Provides services to send progress/error codes to Beep device. >=20 > + >=20 > + Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#ifndef __BEEP_LIB_H__ >=20 > +#define __BEEP_LIB_H__ >=20 > + >=20 > +/** >=20 > + Sends a 32-bit value to Beep device. >=20 > + >=20 > + Sends the 32-bit value specified by Value to Beep device, and returns > Value. >=20 > + Some implementations of this library function may perform I/O operatio= ns >=20 > + directly to Beep device. Other implementations may send Value to >=20 > + ReportStatusCode(), and the status code reporting mechanism will > eventually >=20 > + display the 32-bit value on the status reporting device. >=20 > + >=20 > + Beep() must actively prevent recursion. If Beep() is called while >=20 > + processing another Post Code Library function, then >=20 > + Beep() must return Value immediately. >=20 > + >=20 > + @param Value Beep count. >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +Beep ( >=20 > + IN UINT32 Value >=20 > + ); >=20 > + >=20 > +#endif >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepM > apLib.h > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepM > apLib.h > new file mode 100644 > index 0000000000..7600d72ecd > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepM > apLib.h > @@ -0,0 +1,32 @@ > +/** @file >=20 > + This library class provides Platform Beep Map. >=20 > + >=20 > + Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#ifndef __BEEP_MAP_LIB__ >=20 > +#define __BEEP_MAP_LIB__ >=20 > + >=20 > +/** >=20 > + Get BeepValue from status code type and value. >=20 > + >=20 > + @param CodeType Indicates the type of status code being repor= ted. >=20 > + @param Value Describes the current status of a hardware or >=20 > + software entity. This includes information ab= out the class and >=20 > + subclass that is used to classify the entity = as well as an > operation. >=20 > + For progress codes, the operation is the curr= ent activity. >=20 > + For error codes, it is the exception.For debu= g codes,it is not > defined at this time. >=20 > + >=20 > + @return BeepValue >=20 > + >=20 > +**/ >=20 > +UINT32 >=20 > +EFIAPI >=20 > +GetBeepValueFromStatusCode ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value >=20 > + ); >=20 > + >=20 > +#endif >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.c > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.c > new file mode 100644 > index 0000000000..a0bd946b50 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.c > @@ -0,0 +1,37 @@ > +/** @file >=20 > + BeepLib Null implementation. >=20 > + >=20 > + Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + NULL implemented of Beep() function, just return directly. >=20 > + Normal Beep() function will do the following: >=20 > + >=20 > + Sends a 32-bit value to Beep device. >=20 > + >=20 > + Sends the 32-bit value specified by Value to Beep device, and returns > Value. >=20 > + Some implementations of this library function may perform I/O operatio= ns >=20 > + directly to Beep device. Other implementations may send Value to >=20 > + ReportStatusCode(), and the status code reporting mechanism will > eventually >=20 > + display the 32-bit value on the status reporting device. >=20 > + >=20 > + Beep() must actively prevent recursion. If Beep() is called while >=20 > + processing another Post Code Library function, then >=20 > + Beep() must return Value immediately. >=20 > + >=20 > + @param Value Beep count. >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +Beep ( >=20 > + IN UINT32 Value >=20 > + ) >=20 > +{ >=20 > + return; >=20 > +} >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.inf > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.inf > new file mode 100644 > index 0000000000..7f84dad082 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLi > bNull.inf > @@ -0,0 +1,26 @@ > +## @file >=20 > +# Instance of Platform Beep Null Library. >=20 > +# >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010017 >=20 > + BASE_NAME =3D BeepLib >=20 > + FILE_GUID =3D 319F24D8-9F3E-4BEC-B1C4-C54BE51F3FC= 2 >=20 > + VERSION_STRING =3D 1.0 >=20 > + MODULE_TYPE =3D BASE >=20 > + LIBRARY_CLASS =3D BeepLib >=20 > +# >=20 > +# The following information is for reference only and not required by th= e > build tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC >=20 > +# >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + >=20 > +[Sources] >=20 > + BeepLibNull.c >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.c > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.c > new file mode 100644 > index 0000000000..26c32dfd9b > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.c > @@ -0,0 +1,116 @@ > +/** @file >=20 > + BeepMap implementation. >=20 > + >=20 > + Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include "PlatformStatusCodesInternal.h" >=20 > + >=20 > +STATUS_CODE_TO_DATA_MAP mBeepProgressMap[] =3D { >=20 > + // >=20 > + // PEI >=20 > + // >=20 > + // Recovery >=20 > + { PEI_RECOVERY_STARTED, 2 }, >=20 > + >=20 > + // >=20 > + // DXE >=20 > + // >=20 > + >=20 > + {0,0} >=20 > +}; >=20 > + >=20 > +STATUS_CODE_TO_DATA_MAP mBeepErrorMap[] =3D { >=20 > + // >=20 > + // PEI >=20 > + // >=20 > + // Regular boot >=20 > + { PEI_MEMORY_NOT_DETECTED, 1 }, >=20 > + { PEI_MEMORY_INSTALLED_TWICE, 1 }, >=20 > + { PEI_DXEIPL_NOT_FOUND, 3 }, >=20 > + { PEI_DXE_CORE_NOT_FOUND, 3 }, >=20 > + { PEI_RESET_NOT_AVAILABLE, 7 }, >=20 > + // Recovery >=20 > + { PEI_RECOVERY_FAILED, 4 }, >=20 > + // S3 Resume >=20 > + { PEI_S3_RESUME_FAILED, 4 }, >=20 > + >=20 > + // >=20 > + // DXE >=20 > + // >=20 > + { DXE_ARCH_PROTOCOL_NOT_AVAILABLE, 4 }, >=20 > + { DXE_NO_CON_OUT, 5 }, >=20 > + { DXE_NO_CON_IN, 5 }, >=20 > + { DXE_INVALID_PASSWORD, 1 }, >=20 > + { DXE_FLASH_UPDATE_FAILED, 6 }, >=20 > + { DXE_RESET_NOT_AVAILABLE, 7 }, >=20 > + >=20 > + {0,0} >=20 > +}; >=20 > + >=20 > +STATUS_CODE_TO_DATA_MAP *mBeepStatusCodesMap[] =3D { >=20 > + //#define EFI_PROGRESS_CODE 0x00000001 >=20 > + mBeepProgressMap, >=20 > + //#define EFI_ERROR_CODE 0x00000002 >=20 > + mBeepErrorMap >=20 > + //#define EFI_DEBUG_CODE 0x00000003 >=20 > +}; >=20 > + >=20 > +/** >=20 > + Find the beep data from status code value. >=20 > + >=20 > + @param Map The map used to find in. >=20 > + @param Value The status code value. >=20 > + >=20 > + @return BeepValue 0 for not found. >=20 > + >=20 > +**/ >=20 > +UINT32 >=20 > +FindBeepData ( >=20 > + IN STATUS_CODE_TO_DATA_MAP *Map, >=20 > + IN EFI_STATUS_CODE_VALUE Value >=20 > + ) >=20 > +{ >=20 > + while (Map->Value !=3D 0) { >=20 > + if (Map->Value =3D=3D Value) { >=20 > + return Map->Data; >=20 > + } >=20 > + Map++; >=20 > + } >=20 > + return 0; >=20 > +} >=20 > + >=20 > +/** >=20 > + Get BeepValue from status code type and value. >=20 > + >=20 > + @param CodeType Indicates the type of status code being repor= ted. >=20 > + @param Value Describes the current status of a hardware or >=20 > + software entity. This includes information ab= out the class and >=20 > + subclass that is used to classify the entity = as well as an > operation. >=20 > + For progress codes, the operation is the curr= ent activity. >=20 > + For error codes, it is the exception.For debu= g codes,it is not > defined at this time. >=20 > + >=20 > + @return BeepValue >=20 > +**/ >=20 > +UINT32 >=20 > +EFIAPI >=20 > +GetBeepValueFromStatusCode ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value >=20 > + ) >=20 > +{ >=20 > + UINT32 CodeTypeIndex; >=20 > + >=20 > + CodeTypeIndex =3D STATUS_CODE_TYPE (CodeType) - 1; >=20 > + >=20 > + if (CodeTypeIndex >=3D sizeof (mBeepStatusCodesMap) / > sizeof(mBeepStatusCodesMap[0])) { >=20 > + return 0; >=20 > + } >=20 > + >=20 > + return FindBeepData (mBeepStatusCodesMap[CodeTypeIndex], Value); >=20 > +} >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.inf > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.inf > new file mode 100644 > index 0000000000..b957eee07b > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/B > eepMapLib.inf > @@ -0,0 +1,27 @@ > +## @file >=20 > +# Instance of Beep Map Library. >=20 > +# >=20 > +# Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010017 >=20 > + BASE_NAME =3D BeepMapLib >=20 > + FILE_GUID =3D 8BAFA82F-DA9E-4cce-8FA2-9DA189D7246= D >=20 > + VERSION_STRING =3D 2.0 >=20 > + MODULE_TYPE =3D BASE >=20 > + LIBRARY_CLASS =3D BeepMapLib >=20 > +# >=20 > +# The following information is for reference only and not required by th= e > build tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC >=20 > +# >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + >=20 > +[Sources] >=20 > + BeepMapLib.c >=20 > + PlatformStatusCodesInternal.h >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Pl > atformStatusCodesInternal.h > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Pl > atformStatusCodesInternal.h > new file mode 100644 > index 0000000000..a36134c933 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/Pl > atformStatusCodesInternal.h > @@ -0,0 +1,270 @@ > +/** @file >=20 > + Beep status code definition. >=20 > + >=20 > + Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#ifndef __PLATFORM_STATUS_CODES_INTERNAL_H__ >=20 > +#define __PLATFORM_STATUS_CODES_INTERNAL_H__ >=20 > + >=20 > +#include >=20 > + >=20 > +typedef struct{ >=20 > + EFI_STATUS_CODE_VALUE Value; >=20 > + UINT32 Data; >=20 > +} STATUS_CODE_TO_DATA_MAP; >=20 > + >=20 > +// >=20 > +// Enable PEI/DXE status code >=20 > +// >=20 > +#define PEI_STATUS_CODE 1 >=20 > +#define DXE_STATUS_CODE 1 >=20 > + >=20 > +#define STATUS_CODE_TYPE(Type) > ((Type)&EFI_STATUS_CODE_TYPE_MASK) >=20 > +#define STATUS_CODE_CLASS(Value) > ((Value)&EFI_STATUS_CODE_CLASS_MASK) >=20 > + >=20 > +//Progress/Error codes >=20 > +#define PEI_CORE_STARTED (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_CORE_PC_ENTRY_POINT) >=20 > +#define PEI_RESET_NOT_AVAILABLE (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PS_EC_RESET_NOT_AVAILABLE) >=20 > +#define PEI_DXEIPL_NOT_FOUND (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND) >=20 > +#define PEI_DXE_CORE_NOT_FOUND (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_CORE_EC_DXE_CORRUPT) >=20 > +#define PEI_S3_RESUME_ERROR (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_EC_S3_RESUME_FAILED) >=20 > +#define PEI_RECOVERY_FAILED (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_EC_RECOVERY_FAILED) >=20 > +#define DXE_CORE_STARTED (EFI_SOFTWARE_DXE_CORE | > EFI_SW_DXE_CORE_PC_ENTRY_POINT) >=20 > + >=20 > +//#define DXE_EXIT_BOOT_SERVICES_BEGIN 0xF8 >=20 > +#define DXE_EXIT_BOOT_SERVICES_END > (EFI_SOFTWARE_EFI_BOOT_SERVICE | > EFI_SW_BS_PC_EXIT_BOOT_SERVICES) >=20 > + >=20 > +// Reported by CPU PEIM >=20 > +#define PEI_CAR_CPU_INIT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_PC_POWER_ON_INIT) >=20 > + >=20 > +// Reported by NB PEIM >=20 > +//#define PEI_CAR_NB_INIT (EFI_COMPUTING_UNIT_CHIP= SET | > EFI_CU_CHIPSET_NORTH_INIT) >=20 > + >=20 > +// Reported by SB PEIM >=20 > +//#define PEI_CAR_SB_INIT (EFI_COMPUTING_UNIT_CHIP= SET | > EFI_CU_CHIPSET_PC_SOUTH_INIT) >=20 > + >=20 > +//Reported by Memory Detection PEIM >=20 > +#define PEI_MEMORY_SPD_READ > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_SPD_READ) >=20 > +#define PEI_MEMORY_PRESENCE_DETECT > (EFI_COMPUTING_UNIT_MEMORY | > EFI_CU_MEMORY_PC_PRESENCE_DETECT) >=20 > +#define PEI_MEMORY_TIMING > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_TIMING) >=20 > +#define PEI_MEMORY_CONFIGURING > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_CONFIGURING) >=20 > +#define PEI_MEMORY_OPTIMIZING > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_OPTIMIZING) >=20 > +#define PEI_MEMORY_INIT (EFI_COMPUTING_UNIT_MEMORY > | EFI_CU_MEMORY_PC_INIT) >=20 > +#define PEI_MEMORY_TEST (EFI_COMPUTING_UNIT_MEMORY > | EFI_CU_MEMORY_PC_TEST) >=20 > +#define PEI_MEMORY_INVALID_TYPE > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_TYPE) >=20 > +#define PEI_MEMORY_INVALID_SPEED > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SPEED) >=20 > +#define PEI_MEMORY_SPD_FAIL > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_SPD_FAIL) >=20 > +#define PEI_MEMORY_INVALID_SIZE > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SIZE) >=20 > +#define PEI_MEMORY_MISMATCH > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_MISMATCH) >=20 > +#define PEI_MEMORY_S3_RESUME_FAILED > (EFI_COMPUTING_UNIT_MEMORY | > EFI_CU_MEMORY_EC_S3_RESUME_FAIL) >=20 > +#define PEI_MEMORY_NOT_DETECTED > (EFI_COMPUTING_UNIT_MEMORY | > EFI_CU_MEMORY_EC_NONE_DETECTED) >=20 > +#define PEI_MEMORY_NONE_USEFUL > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_NONE_USEFUL) >=20 > +#define PEI_MEMORY_ERROR > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NON_SPECIFIC) >=20 > +#define PEI_MEMORY_INSTALLED (EFI_SOFTWARE_PEI_SERVICE = | > EFI_SW_PS_PC_INSTALL_PEI_MEMORY) >=20 > +#define PEI_MEMORY_NOT_INSTALLED > (EFI_SOFTWARE_PEI_SERVICE | > EFI_SW_PEI_CORE_EC_MEMORY_NOT_INSTALLED) >=20 > +#define PEI_MEMORY_INSTALLED_TWICE > (EFI_SOFTWARE_PEI_SERVICE | > EFI_SW_PS_EC_MEMORY_INSTALLED_TWICE) >=20 > + >=20 > +//Reported by CPU PEIM >=20 > +#define PEI_CPU_INIT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_PC_INIT_BEGIN) >=20 > +#define PEI_CPU_CACHE_INIT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_CACHE_INIT) >=20 > +#define PEI_CPU_BSP_SELECT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_BSP_SELECT) >=20 > +#define PEI_CPU_AP_INIT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_AP_INIT) >=20 > +#define PEI_CPU_SMM_INIT > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_SMM_INIT) >=20 > +#define PEI_CPU_INVALID_TYPE > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_INVALID_TYPE) >=20 > +#define PEI_CPU_INVALID_SPEED > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_INVALID_SPEED) >=20 > +#define PEI_CPU_MISMATCH > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_MISMATCH) >=20 > +#define PEI_CPU_SELF_TEST_FAILED > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST) >=20 > +#define PEI_CPU_CACHE_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_CACHE) >=20 > +#define PEI_CPU_MICROCODE_UPDATE_FAILED > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_MICROCODE_UPDATE) >=20 > +#define PEI_CPU_NO_MICROCODE > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_NO_MICROCODE_UPDATE) >=20 > +//If non of the errors above apply use this one >=20 > +#define PEI_CPU_INTERNAL_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INTERNAL) >=20 > +//Generic CPU error. It should only be used if non of the errors above a= pply >=20 > +#define PEI_CPU_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NON_SPECIFIC) >=20 > + >=20 > +// Reported by NB PEIM >=20 > +#define PEI_MEM_NB_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_PEI_MEM_NB_INIT) >=20 > +// Reported by SB PEIM >=20 > +#define PEI_MEM_SB_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_PEI_MEM_SB_INIT) >=20 > + >=20 > +//Reported by PEIM which detected forced or auto recovery condition >=20 > +#define PEI_RECOVERY_AUTO (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_PC_RECOVERY_AUTO) >=20 > +#define PEI_RECOVERY_USER (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_PC_RECOVERY_USER) >=20 > + >=20 > +//Reported by DXE IPL >=20 > +#define PEI_RECOVERY_PPI_NOT_FOUND > (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_EC_RECOVERY_PPI_NOT_FOUND) >=20 > +#define PEI_S3_RESUME_PPI_NOT_FOUND > (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND) >=20 > +#define PEI_S3_RESUME_FAILED (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_EC_S3_RESUME_FAILED) >=20 > + >=20 > +//Reported by Recovery PEIM >=20 > +#define PEI_RECOVERY_STARTED (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_PC_RECOVERY_BEGIN) >=20 > +#define PEI_RECOVERY_CAPSULE_FOUND > (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_CAPSULE_LOAD) >=20 > +#define PEI_RECOVERY_NO_CAPSULE > (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE) >=20 > +#define PEI_RECOVERY_CAPSULE_LOADED > (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_CAPSULE_START) >=20 > +#define PEI_RECOVERY_INVALID_CAPSULE > (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR) >=20 > + >=20 > +//Reported by S3 Resume PEIM >=20 > +#define PEI_S3_BOOT_SCRIPT (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_PC_S3_BOOT_SCRIPT) >=20 > +#define PEI_S3_OS_WAKE (EFI_SOFTWARE_PEI_MODULE | > EFI_SW_PEI_PC_OS_WAKE) >=20 > +#define PEI_S3_BOOT_SCRIPT_ERROR > (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_S3_BOOT_SCRIPT_ERROR) >=20 > +#define PEI_S3_OS_WAKE_ERROR (EFI_SOFTWARE_PEI_MODULE > | EFI_SW_PEI_EC_S3_OS_WAKE_ERROR) >=20 > + >=20 > +#define PEI_PEIM_STARTED (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PC_INIT_BEGIN) >=20 > +#define PEI_PEIM_ENDED (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PC_INIT_END) >=20 > + >=20 > +//Reported by DXE IPL >=20 > +#define PEI_DXE_IPL_STARTED (EFI_SOFTWARE_PEI_CORE | > EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT) >=20 > + >=20 > +//Reported by PEIM which installs Reset PPI >=20 > +#define PEI_RESET_SYSTEM (EFI_SOFTWARE_PEI_SERVICE = | > EFI_SW_PS_PC_RESET_SYSTEM) >=20 > + >=20 > +//Reported by the PEIM or DXE driver which detected the error >=20 > +#define GENERIC_MEMORY_CORRECTABLE_ERROR > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_CORRECTABLE) >=20 > +#define GENERIC_MEMORY_UNCORRECTABLE_ERROR > (EFI_COMPUTING_UNIT_MEMORY | > EFI_CU_MEMORY_EC_UNCORRECTABLE) >=20 > + >=20 > +//Reported by Flash Update DXE driver >=20 > +#define DXE_FLASH_UPDATE_FAILED > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UPDATE_FAIL) >=20 > + >=20 > +//Reported by the PEIM or DXE driver which detected the error >=20 > +#define GENERIC_CPU_THERMAL_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_THERMAL) >=20 > +#define GENERIC_CPU_LOW_VOLTAGE > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_LOW_VOLTAGE) >=20 > +#define GENERIC_CPU_HIGH_VOLTAGE > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_HIGH_VOLTAGE) >=20 > +#define GENERIC_CPU_CORRECTABLE_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_CORRECTABLE) >=20 > +#define GENERIC_CPU_UNCORRECTABLE_ERROR > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | > EFI_CU_HP_EC_UNCORRECTABLE) >=20 > +#define GENERIC_BAD_DATE_TIME_ERROR > (EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_BAD_DATE_TIME) >=20 > +#define GENERIC_MEMORY_SIZE_DECREASE > (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_MISMATCH) >=20 > + >=20 > +//Reported by DXE Core >=20 > +#define DXE_DRIVER_STARTED > (EFI_SOFTWARE_EFI_DXE_SERVICE | EFI_SW_PC_INIT_BEGIN) >=20 > +#define DXE_DRIVER_ENED (EFI_SOFTWARE_DXE_CORE | > EFI_SW_PC_INIT_END) >=20 > +#define DXE_ARCH_PROTOCOLS_AVAILABLE > (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ARCH_READY) >=20 > +#define DXE_DRIVER_CONNECTED (EFI_SOFTWARE_DXE_CORE | > EFI_SW_DXE_CORE_PC_START_DRIVER) >=20 > +#define DXE_ARCH_PROTOCOL_NOT_AVAILABLE > (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH) >=20 > + >=20 > +//Reported by DXE CPU driver >=20 > +#define DXE_CPU_SELF_TEST_FAILED > (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST) >=20 > + >=20 > +//Reported by PCI Host Bridge driver >=20 > +#define DXE_NB_HB_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_HB_INIT ) >=20 > + >=20 > +// Reported by NB Driver >=20 > +#define DXE_NB_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_NB_INIT ) >=20 > +#define DXE_NB_SMM_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_NB_SMM_INIT ) >=20 > +#define DXE_NB_ERROR (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_EC_DXE_NB_ERROR ) >=20 > + >=20 > +// Reported by SB Driver(s) >=20 > +#define DXE_SBRUN_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_SB_RT_INIT ) >=20 > +#define DXE_SB_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_SB_INIT ) >=20 > +#define DXE_SB_SMM_INIT (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_PC_DXE_SB_SMM_INIT ) >=20 > +#define DXE_SB_DEVICES_INIT (EFI_COMPUTING_UNIT_CHIPSE= T > | EFI_CHIPSET_PC_DXE_SB_DEVICES_INIT ) >=20 > +#define DXE_SB_BAD_BATTERY (EFI_COMPUTING_UNIT_CHIPSE= T > | EFI_CHIPSET_EC_BAD_BATTERY) >=20 > +#define DXE_SB_ERROR (EFI_COMPUTING_UNIT_CHIPSE= T | > EFI_CHIPSET_EC_DXE_SB_ERROR ) >=20 > + >=20 > +//Reported by DXE Core >=20 > +#define DXE_BDS_STARTED (EFI_SOFTWARE_DXE_CORE | > EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT) >=20 > + >=20 > +//Reported by BDS >=20 > +//#define DXE_BDS_CONNECT_DRIVERS > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS) >=20 > + >=20 > +//Reported by Boot Manager >=20 > +#define DXE_READY_TO_BOOT (EFI_SOFTWARE_DXE_BS_DRIVE= R > | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT) >=20 > + >=20 > +//Reported by DXE Core >=20 > +#define DXE_EXIT_BOOT_SERVICES > (EFI_SOFTWARE_EFI_BOOT_SERVICE | > EFI_SW_BS_PC_EXIT_BOOT_SERVICES) >=20 > +#define DXE_EXIT_BOOT_SERVICES_EVENT > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT) >=20 > + >=20 > +//Reported by driver that installs Runtime AP >=20 > +#define RT_SET_VIRTUAL_ADDRESS_MAP_BEGIN > (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | > EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP) >=20 > +#define RT_SET_VIRTUAL_ADDRESS_MAP_END > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT) >=20 > + >=20 > +//Reported by CSM >=20 > +#define DXE_LEGACY_OPROM_INIT > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT) >=20 > +#define DXE_LEGACY_BOOT (EFI_SOFTWARE_DXE_BS_DRIVE= R | > EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT) >=20 > +#define DXE_LEGACY_OPROM_NO_SPACE > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE) >=20 > + >=20 > +//Reported by SETUP >=20 > +//#define DXE_SETUP_VERIFYING_PASSWORD > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD) >=20 > +#define DXE_SETUP_START (EFI_SOFTWARE_DXE_BS_DRIVE= R | > EFI_SW_PC_USER_SETUP) >=20 > +#define DXE_SETUP_INPUT_WAIT > (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_INPUT_WAIT) >=20 > +#define DXE_INVALID_PASSWORD > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_EC_INVALID_PASSWORD) >=20 > +#define DXE_INVALID_IDE_PASSWORD > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_EC_INVALID_IDE_PASSWORD) >=20 > +#define DXE_BOOT_OPTION_LOAD_ERROR > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR) >=20 > +#define DXE_BOOT_OPTION_FAILED > (EFI_SOFTWARE_DXE_BS_DRIVER | > EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED) >=20 > + >=20 > +//Reported by a Driver that installs Reset AP >=20 > +#define DXE_RESET_SYSTEM > (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_RS_PC_RESET_SYSTEM) >=20 > +#define DXE_RESET_NOT_AVAILABLE > (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | > EFI_SW_PS_EC_RESET_NOT_AVAILABLE) >=20 > + >=20 > +// Reported by PCI bus driver >=20 > +#define DXE_PCI_BUS_BEGIN (EFI_IO_BUS_PCI | > EFI_IOB_PC_INIT) >=20 > +#define DXE_PCI_BUS_ENUM (EFI_IO_BUS_PCI | > EFI_IOB_PCI_PC_BUS_ENUM) >=20 > +#define DXE_PCI_BUS_HPC_INIT (EFI_IO_BUS_PCI | > EFI_IOB_PCI_PC_HPC_INIT) >=20 > +#define DXE_PCI_BUS_REQUEST_RESOURCES (EFI_IO_BUS_PCI | > EFI_IOB_PCI_PC_RES_ALLOC) >=20 > +#define DXE_PCI_BUS_ASSIGN_RESOURCES (EFI_IO_BUS_PCI | > EFI_IOB_PC_ENABLE) >=20 > +#define DXE_PCI_BUS_HOTPLUG (EFI_IO_BUS_PCI | > EFI_IOB_PC_HOTPLUG) >=20 > +#define DXE_PCI_BUS_OUT_OF_RESOURCES (EFI_IO_BUS_PCI | > EFI_IOB_EC_RESOURCE_CONFLICT) >=20 > + >=20 > +// Reported by USB bus driver >=20 > +#define DXE_USB_BEGIN (EFI_IO_BUS_USB | EFI_IOB_= PC_INIT) >=20 > +#define DXE_USB_RESET (EFI_IO_BUS_USB | > EFI_IOB_PC_RESET) >=20 > +#define DXE_USB_DETECT (EFI_IO_BUS_USB | > EFI_IOB_PC_DETECT) >=20 > +#define DXE_USB_ENABLE (EFI_IO_BUS_USB | > EFI_IOB_PC_ENABLE) >=20 > +#define DXE_USB_HOTPLUG (EFI_IO_BUS_USB | > EFI_IOB_PC_HOTPLUG) >=20 > + >=20 > +//Reported by IDE bus driver >=20 > +#define DXE_IDE_BEGIN (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_PC_INIT) >=20 > +#define DXE_IDE_RESET (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_PC_RESET) >=20 > +#define DXE_IDE_DETECT (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_PC_DETECT) >=20 > +#define DXE_IDE_ENABLE (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_PC_ENABLE) >=20 > +#define DXE_IDE_SMART_ERROR (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD) >=20 > +#define DXE_IDE_CONTROLLER_ERROR (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_EC_CONTROLLER_ERROR) >=20 > +#define DXE_IDE_DEVICE_FAILURE (EFI_IO_BUS_ATA_ATAPI | > EFI_IOB_EC_INTERFACE_ERROR) >=20 > + >=20 > +// Reported by SCSI bus driver >=20 > +#define DXE_SCSI_BEGIN (EFI_IO_BUS_SCSI | EFI_IOB= _PC_INIT) >=20 > +#define DXE_SCSI_RESET (EFI_IO_BUS_SCSI | > EFI_IOB_PC_RESET) >=20 > +#define DXE_SCSI_DETECT (EFI_IO_BUS_SCSI | > EFI_IOB_PC_DETECT) >=20 > +#define DXE_SCSI_ENABLE (EFI_IO_BUS_SCSI | > EFI_IOB_PC_ENABLE) >=20 > + >=20 > +// Reported by Super I/O driver >=20 > +#define DXE_SIO_INIT (EFI_IO_BUS_LPC | EFI_IOB_= PC_INIT) >=20 > + >=20 > +// Reported by Keyboard driver >=20 > +#define DXE_KEYBOARD_INIT (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_INIT) >=20 > +#define DXE_KEYBOARD_RESET (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_RESET) >=20 > +#define DXE_KEYBOARD_DISABLE (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_DISABLE) >=20 > +#define DXE_KEYBOARD_DETECT (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_PRESENCE_DETECT) >=20 > +#define DXE_KEYBOARD_ENABLE (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_ENABLE) >=20 > +#define DXE_KEYBOARD_CLEAR_BUFFER > (EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_CLEAR_BUFFER) >=20 > +#define DXE_KEYBOARD_SELF_TEST (EFI_PERIPHERAL_KEYBOARD | > EFI_P_KEYBOARD_PC_SELF_TEST) >=20 > + >=20 > +// Reported by Mouse driver >=20 > +#define DXE_MOUSE_INIT (EFI_PERIPHERAL_MOUSE | > EFI_P_PC_INIT) >=20 > +#define DXE_MOUSE_RESET (EFI_PERIPHERAL_MOUSE | > EFI_P_PC_RESET) >=20 > +#define DXE_MOUSE_DISABLE (EFI_PERIPHERAL_MOUSE | > EFI_P_PC_DISABLE) >=20 > +#define DXE_MOUSE_DETECT (EFI_PERIPHERAL_MOUSE | > EFI_P_PC_PRESENCE_DETECT) >=20 > +#define DXE_MOUSE_ENABLE (EFI_PERIPHERAL_MOUSE | > EFI_P_PC_ENABLE) >=20 > + >=20 > +// Reported by Mass Storage drivers >=20 > +#define DXE_FIXED_MEDIA_INIT (EFI_PERIPHERAL_FIXED_MEDI= A > | EFI_P_PC_INIT) >=20 > +#define DXE_FIXED_MEDIA_RESET (EFI_PERIPHERAL_FIXED_MEDI= A > | EFI_P_PC_RESET) >=20 > +#define DXE_FIXED_MEDIA_DISABLE > (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_DISABLE) >=20 > +#define DXE_FIXED_MEDIA_DETECT > (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_PRESENCE_DETECT) >=20 > +#define DXE_FIXED_MEDIA_ENABLE > (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_ENABLE) >=20 > +#define DXE_REMOVABLE_MEDIA_INIT > (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_INIT) >=20 > +#define DXE_REMOVABLE_MEDIA_RESET > (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_RESET) >=20 > +#define DXE_REMOVABLE_MEDIA_DISABLE > (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_DISABLE) >=20 > +#define DXE_REMOVABLE_MEDIA_DETECT > (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_PRESENCE_DETECT) >=20 > +#define DXE_REMOVABLE_MEDIA_ENABLE > (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_ENABLE) >=20 > + >=20 > + >=20 > +// Reported by BDS >=20 > +#define DXE_CON_OUT_CONNECT > (EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_INIT) >=20 > +#define DXE_CON_IN_CONNECT (EFI_PERIPHERAL_KEYBOARD | > EFI_P_PC_INIT) >=20 > +#define DXE_NO_CON_OUT > (EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_DETECTED) >=20 > +#define DXE_NO_CON_IN (EFI_PERIPHERAL_KEYBOARD | > EFI_P_EC_NOT_DETECTED) >=20 > + >=20 > +#endif >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.c > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.c > new file mode 100644 > index 0000000000..78cde0c118 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.c > @@ -0,0 +1,102 @@ > +/** @file >=20 > + Beep status code implementation. >=20 > + >=20 > + Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + Convert status code value to the times of beep. >=20 > + >=20 > + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES t= able > published by the PEI Foundation. >=20 > + @param CodeType Indicates the type of status code being repor= ted. >=20 > + @param Value Describes the current status of a hardware or >=20 > + software entity. This includes information ab= out the class and >=20 > + subclass that is used to classify the entity = as well as an > operation. >=20 > + For progress codes, the operation is the curr= ent activity. >=20 > + For error codes, it is the exception.For debu= g codes,it is not > defined at this time. >=20 > + @param Instance The enumeration of a hardware or software ent= ity > within >=20 > + the system. A system may contain multiple ent= ities that match > a class/subclass >=20 > + pairing. The instance differentiates between = them. An > instance of 0 indicates >=20 > + that instance information is unavailable, not= meaningful, or > not relevant. >=20 > + Valid instance numbers start with 1. >=20 > + @param CallerId This optional parameter may be used to identi= fy the > caller. >=20 > + This parameter allows the status code driver = to apply different > rules to >=20 > + different callers. >=20 > + @param Data This optional parameter may be used to pass > additional data. >=20 > + >=20 > + @retval EFI_SUCCESS Status code reported to beep successfully. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +BeepStatusCodeReportWorker ( >=20 > + IN CONST EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN CONST EFI_GUID *CallerId, >=20 > + IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > +{ >=20 > + UINT32 BeepValue; >=20 > + >=20 > + BeepValue =3D GetBeepValueFromStatusCode (CodeType, Value); >=20 > + if (BeepValue !=3D 0) { >=20 > + DEBUG ((DEBUG_INFO, "Beep: %d \n", BeepValue)); >=20 > + Beep (BeepValue); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Constructor function of PeiBeepStatusCodeHandlerLib. >=20 > + >=20 > + This function is the constructor function of this Beep Status Code Han= dler > Library for PEI Phase. >=20 > + It check whether need beep, and register it to gEfiPeiRscHandlerPpiGui= d. >=20 > + >=20 > + @param FileHandle Handle of the file being invoked. >=20 > + @param PeiServices Describes the list of possible PEI Services. >=20 > + >=20 > + @retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfu= lly. >=20 > + >=20 > +**/ >=20 > +RETURN_STATUS >=20 > +EFIAPI >=20 > +PeiBeepStatusCodeHandlerLibConstructor ( >=20 > + IN EFI_PEI_FILE_HANDLE FileHandle, >=20 > + IN CONST EFI_PEI_SERVICES **PeiServices >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + EFI_PEI_RSC_HANDLER_PPI *RscHandlerPpi; >=20 > + >=20 > + if (!PcdGetBool (PcdStatusCodeUseBeep)) { >=20 > + return RETURN_SUCCESS; >=20 > + } >=20 > + >=20 > + Status =3D PeiServicesLocatePpi ( >=20 > + &gEfiPeiRscHandlerPpiGuid, >=20 > + 0, >=20 > + NULL, >=20 > + (VOID **) &RscHandlerPpi >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > + Status =3D RscHandlerPpi->Register (BeepStatusCodeReportWorker); >=20 > + ASSERT (!EFI_ERROR (Status) || Status =3D=3D EFI_ALREADY_STARTED); 2. I think "|| Status =3D=3D EFI_ALREADY_STARTED " is not needed. >=20 > + >=20 > + return RETURN_SUCCESS; >=20 > +} >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.inf > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.inf > new file mode 100644 > index 0000000000..f8200d9921 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/PeiBeepStatusCodeHandlerLib.inf > @@ -0,0 +1,55 @@ > +## @file >=20 > +# Beep status code implementation. >=20 > +# >=20 > +# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +# vendor. This file may not be modified, except as allowed by >=20 > +# additional terms of your license agreement. >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010005 >=20 > + BASE_NAME =3D PeiBeepStatusCodeHandlerLib >=20 > + FILE_GUID =3D C4210E71-0A38-4728-8D25-4876348AA38= 0 >=20 > + MODULE_TYPE =3D PEIM >=20 > + CONSTRUCTOR =3D PeiBeepStatusCodeHandlerLibConstruc= tor >=20 > + LIBRARY_CLASS =3D StatusCodeHandlerLib|SEC PEIM PEI_C= OR >=20 > + >=20 > +# >=20 > +# The following information is for reference only and not required by th= e > build tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC (EBC is only for b= uild) >=20 > +# >=20 > + >=20 > +[Sources] >=20 > + PeiBeepStatusCodeHandlerLib.c >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + PeiServicesLib >=20 > + PcdLib >=20 > + HobLib >=20 > + ReportStatusCodeLib >=20 > + PrintLib >=20 > + DebugLib >=20 > + BaseMemoryLib >=20 > + BeepMapLib >=20 > + BeepLib >=20 > + >=20 > +[Guids] >=20 > + gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## > GUID >=20 3. For Beep handler, I think this guid is not needed, we can remove it. > + >=20 > +[Pcd] >=20 > + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep > ## CONSUMES >=20 > + >=20 > +[Ppis] >=20 > + gEfiPeiRscHandlerPpiGuid ## CONSUMES >=20 > + >=20 > +[Depex] >=20 > + TRUE >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.c > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.c > new file mode 100644 > index 0000000000..0f24dbdf02 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.c > @@ -0,0 +1,183 @@ > +/** @file >=20 > + Beep status code implementation. >=20 > + >=20 > + Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +EFI_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol =3D NULL; >=20 > +EFI_EVENT mExitBootServicesEvent =3D NULL; >=20 > + >=20 > +/** >=20 > + Convert status code value to the times of beep. >=20 > + >=20 > + @param CodeType Indicates the type of status code being repor= ted. >=20 > + @param Value Describes the current status of a hardware or >=20 > + software entity. This includes information ab= out the class and >=20 > + subclass that is used to classify the entity = as well as an > operation. >=20 > + For progress codes, the operation is the curr= ent activity. >=20 > + For error codes, it is the exception.For debu= g codes,it is not > defined at this time. >=20 > + @param Instance The enumeration of a hardware or software ent= ity > within >=20 > + the system. A system may contain multiple ent= ities that match > a class/subclass >=20 > + pairing. The instance differentiates between = them. An > instance of 0 indicates >=20 > + that instance information is unavailable, not= meaningful, or > not relevant. >=20 > + Valid instance numbers start with 1. >=20 > + @param CallerId This optional parameter may be used to identi= fy the > caller. >=20 > + This parameter allows the status code driver = to apply different > rules to >=20 > + different callers. >=20 > + @param Data This optional parameter may be used to pass > additional data. >=20 > + >=20 > + @retval EFI_SUCCESS Status code reported to beep successfully. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +BeepStatusCodeReportWorker ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN EFI_GUID *CallerId, >=20 > + IN EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > +{ >=20 > + UINT32 BeepValue; >=20 > + >=20 > + BeepValue =3D GetBeepValueFromStatusCode (CodeType, Value); >=20 > + if (BeepValue !=3D 0) { >=20 > + DEBUG ((DEBUG_INFO, "Beep: %d \n", BeepValue)); >=20 > + Beep (BeepValue); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Unregister status code callback functions only available at boot time = from >=20 > + report status code router when exiting boot services. >=20 > + >=20 > + @param Event Event whose notification function is being invok= ed. >=20 > + @param Context Pointer to the notification function's context, = which is >=20 > + always zero in current implementation. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +UnregisterBeepBootTimeHandlers ( >=20 > + IN EFI_EVENT Event, >=20 > + IN VOID *Context >=20 > + ) >=20 > +{ >=20 > + if (PcdGetBool (PcdStatusCodeUseBeep)) { >=20 > + mRscHandlerProtocol->Unregister (BeepStatusCodeReportWorker); >=20 > + } >=20 > +} >=20 > + >=20 > + >=20 > + >=20 > +/** >=20 > + Register status code callback function only when Report Status Code > protocol >=20 > + is installed. >=20 > + >=20 > + @param Event Event whose notification function is being invok= ed. >=20 > + @param Context Pointer to the notification function's context, = which is >=20 > + always zero in current implementation. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +RegisterBeepBootTimeHandlers ( >=20 > + IN EFI_EVENT Event, >=20 > + IN VOID *Context >=20 > +) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + >=20 > + Status =3D gBS->LocateProtocol ( >=20 > + &gEfiRscHandlerProtocolGuid, >=20 > + NULL, >=20 > + (VOID **) &mRscHandlerProtocol >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > + if (PcdGetBool (PcdStatusCodeUseBeep)) { >=20 > + mRscHandlerProtocol->Register (BeepStatusCodeReportWorker, > TPL_HIGH_LEVEL); >=20 > + } >=20 > + >=20 > + Status =3D gBS->CreateEventEx ( >=20 > + EVT_NOTIFY_SIGNAL, >=20 > + TPL_NOTIFY, >=20 > + UnregisterBeepBootTimeHandlers, >=20 > + NULL, >=20 > + &gEfiEventExitBootServicesGuid, >=20 > + &mExitBootServicesEvent >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > +} 4. I think the above create event logic should move into the "If" condition= . If the handler is not register, we don't need to create the event to unr= egister it. >=20 > + >=20 > +/** >=20 > + Constructor function of RuntimeDxeBeepStatusCodeHandlerLib. >=20 > + >=20 > + This function allocates memory for extended status code data, caches >=20 > + the report status code service, and registers events. >=20 > + >=20 > + @param ImageHandle The firmware allocated handle for the EFI image. >=20 > + @param SystemTable A pointer to the EFI System Table. >=20 > + >=20 > + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +RuntimeDxeBeepStatusCodeHandlerLibConstructor ( >=20 > + IN EFI_HANDLE ImageHandle, >=20 > + IN EFI_SYSTEM_TABLE *SystemTable >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + EFI_EVENT RegisterStatusCodeHandlerEvent; >=20 > + VOID *Registration; >=20 > + >=20 > + Status =3D gBS->LocateProtocol ( >=20 > + &gEfiRscHandlerProtocolGuid, >=20 > + NULL, >=20 > + (VOID **) &mRscHandlerProtocol >=20 > + ); >=20 > + >=20 > + if (!EFI_ERROR (Status)) { >=20 > + RegisterBeepBootTimeHandlers (NULL, NULL); >=20 > + } else { >=20 > + Status =3D gBS->CreateEvent ( >=20 > + EVT_NOTIFY_SIGNAL, >=20 > + TPL_NOTIFY, >=20 > + RegisterBeepBootTimeHandlers, >=20 > + NULL, >=20 > + &RegisterStatusCodeHandlerEvent >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > + // >=20 > + // Register for protocol notifications on this event >=20 > + // >=20 > + Status =3D gBS->RegisterProtocolNotify ( >=20 > + &gEfiRscHandlerProtocolGuid, >=20 > + RegisterStatusCodeHandlerEvent, >=20 > + &Registration >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf > new file mode 100644 > index 0000000000..f612a6d367 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf > @@ -0,0 +1,57 @@ > +## @file >=20 > +# Beep status code implementation. >=20 > +# >=20 > +# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +# vendor. This file may not be modified, except as allowed by >=20 > +# additional terms of your license agreement. >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010005 >=20 > + BASE_NAME =3D RuntimeDxeBeepStatusCodeHandlerLib >=20 > + FILE_GUID =3D D05F43CE-7C70-4663-848F-8265C311A8A= 5 >=20 > + MODULE_TYPE =3D DXE_RUNTIME_DRIVER >=20 > + VERSION_STRING =3D 1.0 >=20 > + CONSTRUCTOR =3D > RuntimeDxeBeepStatusCodeHandlerLibConstructor >=20 > + LIBRARY_CLASS =3D StatusCodeHandlerLib|DXE_RUNTIME_DR= IVER >=20 > + >=20 > +# >=20 > +# The following information is for reference only and not required by th= e > build tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC (EBC is only for b= uild) >=20 > +# >=20 > + >=20 > +[Sources] >=20 > + RuntimeDxeBeepStatusCodeHandlerLib.c >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + BaseLib >=20 > + DebugLib >=20 > + UefiBootServicesTableLib >=20 > + BaseMemoryLib >=20 > + PcdLib >=20 > + DevicePathLib >=20 > + UefiRuntimeLib >=20 > + ReportStatusCodeLib >=20 > + BeepMapLib >=20 > + BeepLib >=20 > + >=20 > +[Guids] >=20 > + gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## > GUID >=20 5. Save as PEI instance, this GUID is not needed, we can remove it. > + >=20 > +[Pcd] >=20 > + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep > ## CONSUMES >=20 > + >=20 > +[Protocols] >=20 > + gEfiRscHandlerProtocolGuid ## CONSUMES >=20 > + >=20 > +[Depex] >=20 > + TRUE >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.c > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.c > new file mode 100644 > index 0000000000..65f17dc7d4 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.c > @@ -0,0 +1,138 @@ > +/** @file >=20 > + Beep status code implementation. >=20 > + >=20 > + Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +EFI_SMM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol =3D NULL; 6. I think here no need to define it as a global variable, local variable i= s enough. >=20 > + >=20 > + >=20 > +/** >=20 > + Convert status code value to the times of beep. >=20 > + >=20 > + @param CodeType Indicates the type of status code being repor= ted. >=20 > + @param Value Describes the current status of a hardware or >=20 > + software entity. This includes information ab= out the class and >=20 > + subclass that is used to classify the entity = as well as an > operation. >=20 > + For progress codes, the operation is the curr= ent activity. >=20 > + For error codes, it is the exception.For debu= g codes,it is not > defined at this time. >=20 > + @param Instance The enumeration of a hardware or software ent= ity > within >=20 > + the system. A system may contain multiple ent= ities that match > a class/subclass >=20 > + pairing. The instance differentiates between = them. An > instance of 0 indicates >=20 > + that instance information is unavailable, not= meaningful, or > not relevant. >=20 > + Valid instance numbers start with 1. >=20 > + @param CallerId This optional parameter may be used to identi= fy the > caller. >=20 > + This parameter allows the status code driver = to apply different > rules to >=20 > + different callers. >=20 > + @param Data This optional parameter may be used to pass > additional data. >=20 > + >=20 > + @retval EFI_SUCCESS Status code reported to beep successfully. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +BeepStatusCodeReportWorker ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN EFI_GUID *CallerId, >=20 > + IN EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > +{ >=20 > + UINT32 BeepValue; >=20 > + >=20 > + BeepValue =3D GetBeepValueFromStatusCode (CodeType, Value); >=20 > + if (BeepValue !=3D 0) { >=20 > + Beep (BeepValue); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Register status code callback function only when Report Status Code > protocol >=20 > + is installed. >=20 > + >=20 > + @param Protocol Points to the protocol's unique identifier. >=20 > + @param Interface Points to the interface instance. >=20 > + @param Handle The handle on which the interface was installed. >=20 > + >=20 > + @retval EFI_SUCCESS Notification runs successfully. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +RegisterBeepBootTimeHandlers ( >=20 > + IN CONST EFI_GUID *Protocol, >=20 > + IN VOID *Interface, >=20 > + IN EFI_HANDLE Handle >=20 > +) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + >=20 > + Status =3D gSmst->SmmLocateProtocol ( >=20 > + &gEfiSmmRscHandlerProtocolGuid, >=20 > + NULL, >=20 > + (VOID **) &mRscHandlerProtocol >=20 > + ); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > + if (PcdGetBool (PcdStatusCodeUseBeep)) { >=20 > + mRscHandlerProtocol->Register (BeepStatusCodeReportWorker); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Constructor function of SmmBeepStatusCodeHandlerLib. >=20 > + >=20 > + This function allocates memory for extended status code data, caches >=20 > + the report status code service, and registers events. >=20 > + >=20 > + @param ImageHandle The firmware allocated handle for the EFI image. >=20 > + @param SystemTable A pointer to the EFI System Table. >=20 > + >=20 > + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. >=20 > + >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +SmmBeepStatusCodeHandlerLibConstructor ( >=20 > + IN EFI_HANDLE ImageHandle, >=20 > + IN EFI_SYSTEM_TABLE *SystemTable >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + VOID *Registration; >=20 > + >=20 > + Status =3D gSmst->SmmLocateProtocol ( >=20 > + &gEfiSmmRscHandlerProtocolGuid, >=20 > + NULL, >=20 > + (VOID **) &mRscHandlerProtocol >=20 > + ); >=20 > + if (!EFI_ERROR (Status)) { >=20 > + RegisterBeepBootTimeHandlers (NULL, NULL, NULL); >=20 > + } else { >=20 > + gSmst->SmmRegisterProtocolNotify ( >=20 > + &gEfiSmmRscHandlerProtocolGuid, >=20 > + RegisterBeepBootTimeHandlers, >=20 > + &Registration >=20 > + ); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > diff --git > a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.inf > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.inf > new file mode 100644 > index 0000000000..1a01794e11 > --- /dev/null > +++ > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCod > eHandlerLib/SmmBeepStatusCodeHandlerLib.inf > @@ -0,0 +1,55 @@ > +## @file >=20 > +# Beep status code implementation. >=20 > +# >=20 > +# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +# vendor. This file may not be modified, except as allowed by >=20 > +# additional terms of your license agreement. >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010005 >=20 > + BASE_NAME =3D SmmBeepStatusCodeHandlerLib >=20 > + FILE_GUID =3D 2E2BC2D4-572D-4663-9A1E-FB52FA30922= A >=20 > + MODULE_TYPE =3D DXE_SMM_DRIVER >=20 > + VERSION_STRING =3D 1.0 >=20 > + CONSTRUCTOR =3D SmmBeepStatusCodeHandlerLibConstruc= tor >=20 > + LIBRARY_CLASS =3D StatusCodeHandlerLib|DXE_SMM_DRIVER >=20 > + >=20 > +# >=20 > +# The following information is for reference only and not required by th= e > build tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC (EBC is only for b= uild) >=20 > +# >=20 > + >=20 > +[Sources] >=20 > + SmmBeepStatusCodeHandlerLib.c >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + PcdLib >=20 > + BaseMemoryLib >=20 > + SmmServicesTableLib >=20 > + DebugLib >=20 > + MemoryAllocationLib >=20 > + ReportStatusCodeLib >=20 > + BeepMapLib >=20 > + BeepLib >=20 > + >=20 > +[Guids] >=20 > + gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## > GUID >=20 7. Same as above, can remove it. Thanks, Eric > + >=20 > +[Pcd] >=20 > + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep > ## CONSUMES >=20 > + >=20 > +[Protocols] >=20 > + gEfiSmmRscHandlerProtocolGuid ## CONSUMES >=20 > + >=20 > +[Depex] >=20 > + TRUE >=20 > diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md > b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md > new file mode 100644 > index 0000000000..12ae2c1582 > --- /dev/null > +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md > @@ -0,0 +1,126 @@ > +# Overview >=20 > +* **Feature Name:** Beep Debug >=20 > +* **PI Phase(s) Supported:** PEI, DXE, SMM >=20 > +* **SMM Required?** Yes >=20 > + >=20 > +More Information: >=20 > + >=20 > +## Purpose >=20 > +The BeepDebugFeaturePkg include some useful beep debug libraries, such > as get beep value from status code and beep. >=20 > +This is an important capability in firmware development to get and analy= ze > the early error when there is not serial port. >=20 > + >=20 > + >=20 > +# High-Level Theory of Operation >=20 > +It provide a library BeepStatusCodeHandlerLib used by edk2 > StatusCodeHandler.efi, used to do beep if needed. >=20 > +It also provide a library of BeepMap lib, it map the status code to beep= value. >=20 > +A library of Beep lib is needed by platform, and this pkg has a Null > implementation. >=20 > + >=20 > +In the library contstructor function, BeepStatusCodeHandlerLib register = the > call back function for ReportStatusCode. >=20 > +When called, it call GetBeepFromStatusCode() in BeepMapLib to get beep > value from status code, and call Beep() in BeepLib to beep. >=20 > + >=20 > +BeepStatusCodeHandlerLib include 3 libraries for PEI, RuntimeDxe, SMM: >=20 > +* PeiBeepStatusCodeHandlerLib >=20 > +* RuntimeDxeBeepStatusCodeHandlerLib >=20 > +* SmmBeepStatusCodeHandlerLib >=20 > + >=20 > +## Firmware Volumes >=20 > +Linked with StatusCodeHandler.efi, and make sure put the > StatusCodeHandler.efi after the ReportStatusCodeRouter.efi. >=20 > + >=20 > +## Modules >=20 > +* BeepStatusCodeHandlerLib >=20 > +* BeepMapLib >=20 > +* BeepLibNull >=20 > + >=20 > +## BeepStatusCodeHandlerLib >=20 > +This library register the call back function for ReportStatusCode, and g= et >=20 > +beep valude from status code, and do beep. >=20 > + >=20 > +## BeepMapLib >=20 > +This library provide a function to get beep value from status code. >=20 > + >=20 > +## Key Functions >=20 > +* In PeiBeepStatusCodeHandlerLib: >=20 > + EFI_STATUS >=20 > + EFIAPI >=20 > + BeepStatusCodeReportWorker ( >=20 > + IN CONST EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN CONST EFI_GUID *CallerId, >=20 > + IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > + >=20 > +* In RuntimeDxeBeepStatusCodeHandlerLib: >=20 > + EFI_STATUS >=20 > + EFIAPI >=20 > + BeepStatusCodeReportWorker ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN EFI_GUID *CallerId, >=20 > + IN EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > + >=20 > +* In SmmBeepStatusCodeHandlerLib: >=20 > + EFI_STATUS >=20 > + EFIAPI >=20 > + BeepStatusCodeReportWorker ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value, >=20 > + IN UINT32 Instance, >=20 > + IN EFI_GUID *CallerId, >=20 > + IN EFI_STATUS_CODE_DATA *Data OPTIONAL >=20 > + ) >=20 > + >=20 > +* In BeepMapLib: >=20 > + UINT32 >=20 > + EFIAPI >=20 > + GetBeepValueFromStatusCode ( >=20 > + IN EFI_STATUS_CODE_TYPE CodeType, >=20 > + IN EFI_STATUS_CODE_VALUE Value >=20 > + ) >=20 > + >=20 > +* In BeepLib: >=20 > + VOID >=20 > + EFIAPI >=20 > + Beep ( >=20 > + IN UINT32 Value >=20 > + ) >=20 > + >=20 > +## Configuration >=20 > +* Link the library to StatusCodeHandler.efi. >=20 > + Example: >=20 > + > MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHan > dlerRuntimeDxe.inf { >=20 > + >=20 > + > BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBee > pStatusCodeHandlerLib.inf >=20 > + } >=20 > + Refer to BeepDebugFeaturePkg.dsc for other example. >=20 > +* Config pcd > gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep >=20 > + In platform .dsc file, need to config the type of > gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep. >=20 > + Use PcdsFixedAtBuild to save binary size, and use PcdsDynamic if want = to > enable/disable in runtime. >=20 > +* Implemented platform's special BeepMapLib if needed. >=20 > +* Provide the platform's special BeepLib. >=20 > +* Make sure put the StatusCodeHandler.efi after the > ReportStatusCodeRouter.efi. >=20 > + >=20 > +## Data Flows >=20 > +Status Code (ReportStatusCode) -> Beep Value > (GetBeepValueFromStatusCode). >=20 > + >=20 > +## Control Flows >=20 > +ReportStatusCode() -> BeepStatusCodeReportWorker() -> > GetBeepValueFromStatusCode() -> Beep() >=20 > + >=20 > +## Build Flows >=20 > +There is not special build flows. >=20 > + >=20 > +## Test Point Results >=20 > +Verify the post code shown is correct. >=20 > + >=20 > +## Functional Exit Criteria >=20 > +N/A >=20 > + >=20 > +## Feature Enabling Checklist >=20 > +* Set the PCD > gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep to TRUE. >=20 > +* Plug out all the memory, check can here the beep. >=20 > + >=20 > +## Common Optimizations >=20 > +* Implemented platform's special BeepMapLib if needed. >=20 > -- > 2.24.0.windows.2