From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web12.3085.1609903476617457257 for ; Tue, 05 Jan 2021 19:24:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=R3dP2UOi; spf=fail (domain: intel.com, ip: , mailfrom: hao.a.wu@intel.com) IronPort-SDR: mEZpPrsKqZ6Q17zxJg83YVJDfZMuaVXVOEpxbdSuXNGPFLQH1EzIGcvseY3FLAjF/YPdTkjF2m QRVirHqI/HFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="238771570" X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="238771570" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 19:24:41 -0800 IronPort-SDR: MMp0LKJfRCTweckUrzVGAwQ0h2fEOnbv16i+ezMdwwe7JphEqEB/UdZkMK+2/eww1SXd7YiVa8 WDGephkJQlmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="402551294" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jan 2021 19:24:41 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 19:24:41 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 19:24:40 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 5 Jan 2021 19:24:40 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 5 Jan 2021 19:24:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=liIiWlZ2nLTOy7PjZZU6tJp5LNNaefDpHHVCI8scGrLwWgZnqhG/nlZad9AnXzIBye56PCpR4PUwCKY/FML2Ws4mvf+0MYElmNenG8uFtDWehYJfpVpDNaH0KWoBim8O5uGxRaFAnXISUzdwvcoJJxIHcjUDmre9yl01iGnvY97zK2U+SadLld7DybrkiLBu/jNJ8cm56tQkrOClGUDCTv46haKL/fREX/zB7OpPbn8XNSQEz1nE+BdDO6q7lhn0NAA1sAfVMIN95XQfBrTnsWfaEyiF7BUTleNzIHVD4q7s80alH7h5u1+envYpjDrnIxwhrQ0FCi6kQNXFmLBFUA== 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=+f18xtKpzOjYr5e5QcMtjl9E5lQTrimaypzbR9I9iC4=; b=Odc32sPo+490hjJ6VexrJnLap9MIna1SOyBkJmru5UU6mQofOYEs9GOVNRGGYhNPagqYx9ua+1Yy/WdNuicaaWfBEuMdSYtmvfeG9Y8vLnO2GdWFRmAUCyD0UCxg1uK/AWmblG0G65VHVvOiRu5Hom01m5EBYqPQ/o/qycPqeTAh42mi6P1nG5CJg/VKj/rDZlDrZrhqSSBBdnU5A/0uhD3M/cxYhiICsAYh15SplGf6NEEnLFlNqiP6QB7sTQ9MEzj2uYoJpoZiz3ntXVLJUFvCn2poZSuQ9TZU6+6RV6fdcGMIp9tDWrkCRdarTboj9LzwnsF/b9AsZ8RXDNoJQA== 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=+f18xtKpzOjYr5e5QcMtjl9E5lQTrimaypzbR9I9iC4=; b=R3dP2UOiM+Lxs1gmeBrQSu25D7149N0Ep/Do7AUbxEnE8OyPKQYZX648/A9wfxQkgVvObG9TGGTql9FoAy/kYcFiEUXcCnvwhBFQrWHt6s44Rq6+EcKAkRzwAouHi+gZj/CdJjzg6/eUejXmy9TWsM80xTU0GxIbM7yRjRdLgOM= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN7PR11MB2721.namprd11.prod.outlook.com (2603:10b6:406:ba::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Wed, 6 Jan 2021 03:24:38 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::d11e:3b2:e34f:7f0f]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::d11e:3b2:e34f:7f0f%5]) with mapi id 15.20.3742.006; Wed, 6 Jan 2021 03:24:38 +0000 From: "Wu, Hao A" To: Kun Qin , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Bi, Dandan" , Liming Gao Subject: Re: [PATCH v2 09/16] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Thread-Topic: [PATCH v2 09/16] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Thread-Index: AQHW45UUmkO5pp790UawkbSMgodE3KoZ7kUw Date: Wed, 6 Jan 2021 03:24:38 +0000 Message-ID: References: <20210105185935.3769-1-kun.q@outlook.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: outlook.com; dkim=none (message not signed) header.d=none;outlook.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d681debe-7926-44da-1095-08d8b1f29975 x-ms-traffictypediagnostic: BN7PR11MB2721: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kaJ4WSjttuP35qdHIDVAmpUXAmjRMzReXP5kFh+VMmyIl1t4nh97vCzOJXsBzB14T12Ba/SDJGXAFh+VmQUMyOufAm/FyBzCAP5/ri6HOZnvMIwZ4NITgIjJ13n9pckmnOQFfqsRSRDfudjX55NBMZs6JmKvENXE+jQFxjMiiKpfQzYsa+kXoNJm3hkNfgcIgfTGAsOyfURmd2jFa+gpLkqgaJA9MRqaf5nEjebdebn5t8HwMk2T8TtoQfsGodVao8J1iiTxL9PCsw35D6TLILk4G3MDoX1Y8pT6V7oEeKxMZqo34GmtU1yuNK1KA02Z97xK/RLrM/bU39tvm/5xVvvdGKh7mMMDYtzlZ3p1qdVzRClDg19LRFqceKwQkZtkGmASKsIp1pJNE1BwTMntKw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39860400002)(346002)(396003)(376002)(366004)(2906002)(316002)(76116006)(54906003)(66476007)(4326008)(52536014)(66556008)(110136005)(64756008)(33656002)(7696005)(478600001)(45080400002)(66446008)(5660300002)(71200400001)(30864003)(8676002)(8936002)(83380400001)(26005)(53546011)(6506007)(186003)(55016002)(66574015)(9686003)(86362001)(66946007)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?U5h7KVap+y2UEwoIxWvXFmUudIOpSk8SGvg6m6VP98lXj7fozkeU7V4PVOyz?= =?us-ascii?Q?s5jhy/p4vwye9KwFywXUdsWCinLtXMnEzXEQx9XXGb/E3gsjf6GoPM3tZ/l5?= =?us-ascii?Q?hkR9uFbwJ5aIah/Rd1OplnYNWRPg8A2PBYOPgIYL4pDZmZbYiGyYBdDICIMl?= =?us-ascii?Q?4bIeiijo0oT+5wAwmtHpjQyr4xEbpFcNynJ+8jqNSgoip9pLLWkI2WmqEJbu?= =?us-ascii?Q?HWqCn+D1KzqCQdMKRBUsnuzqBgBFCTL9qIaFWZdEIUpUiCVG/+G+hu8C0BWS?= =?us-ascii?Q?gyuLiVa4OXGorCSdgbfm8PHr8Wcb/63DHIQthqc4XLxFK+Jx2yk2LFpO2s4l?= =?us-ascii?Q?7HSdznFZalaZmuJ4Bf3rt4N+p6WQtwD135uhk8BT/gLhgIsO+eJXcKJrm01I?= =?us-ascii?Q?PGhYGW6eGdBkL3FBAe36ddhq7YP3CTM7xJ3QGnM9nu7C3WbeYg77URE7B+o7?= =?us-ascii?Q?h4rqUr24Z/zqnCIxHi9FxtlojS3N9yXdBdf28uIAu2yhUS5EYW4ROxk9nUBJ?= =?us-ascii?Q?nydU7DR0X6uVNvbPY47E6WXuxRXivuQ1dPOB/nUr+5/lKwPrKirwJIMfjVBK?= =?us-ascii?Q?hJPJKuWpTVPU6Z0rNHX5JzqeffRN5pxL4pVxxRPPErqP0de+qPbkggDeQCB0?= =?us-ascii?Q?JkAc3w0KvToW8seFOwEAi9trA+UnLaCHXZOE6dkosVBVMSWp9/pahNAALpwa?= =?us-ascii?Q?L9wjFortX7X/gxNQQkMOuC60FVhdp7iUTgiyXgKung02FNUaXfawyIWsK5PI?= =?us-ascii?Q?/TX6rHSjXdCqc0KuCuE/tts+YMyrkhFQLH3NVBHQgnEx0Vz3XZNzWCTWG7Ex?= =?us-ascii?Q?+bFh9mXj44oodOlHqwVQCpNdS6JfGdjxQuLfinhucj8Pv1Xpi2ioKYcywVVT?= =?us-ascii?Q?4kRLMnpLcRssaPQfQDbiYtuqI4UfRGOWxwJYeGaYTAeJ5fZTOsdc6Nx/tvIG?= =?us-ascii?Q?d3erLSzSqkMWx5twhptm4dvOaN2lPucEr99x7v3x9bo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d681debe-7926-44da-1095-08d8b1f29975 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2021 03:24:38.6323 (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: Rq9e8jOOAb17bgTTj3TcA3UW/2xQ9+pYtUaw6cfUcGOw7XeLDwlqU/46EdDhN9DPWEQ2dsFJd4/cprT3qkQq8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2721 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Kun Qin > Sent: Wednesday, January 6, 2021 2:59 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Bi, Dandan ; Liming Gao > Subject: [PATCH v2 09/16] MdeModulePkg: ReportStatusCodeRouter: > Support StandaloneMm RSC Router >=20 > This change added support of RSC router under StandaloneMm. It replaces > SMM version ReportStatusCode protocol definitions with MM version. This > patch also switched to use gMmst instead of gSmst. Lastly, it abstracts > standalone and traditional MM driver entrypoints into separate files to a= llow > maximal common implementations. A minor comment: Could you help to update the function description of ReportDispatcher() for= the 2nd input parameter: Type -> CodeType With this handled: Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Dandan Bi > Cc: Liming Gao >=20 > Signed-off-by: Kun Qin > --- >=20 > Notes: > v2: > - Removed "EFIAPI" for internally abstracted functions [Hao] > - Updated function descriptions [Hao] > - Updated ReportDispatcher to make *.h and *.c consistent [Hao] >=20 >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/{ReportStatusCo > deRouterSmm.c =3D> ReportStatusCodeRouterCommon.c} | 55 +++++++++---- > ------- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterStandaloneMm.c | 33 ++++++++++++ >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterTraditional.c | 33 ++++++++++++ > MdeModulePkg/MdeModulePkg.dsc > | 1 + >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/{ReportStatusCo > deRouterSmm.h =3D> ReportStatusCodeRouterCommon.h} | 44 ++++++++++-- > ---- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.inf | 13 ++--- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterStandaloneMm.inf | 49 +++++++++++++++++ > 7 files changed, 176 insertions(+), 52 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.c > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterCommon.c > similarity index 75% > rename from > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.c > rename to > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterCommon.c > index c3ab5cd05045..d84efaa79b7f 100644 > --- > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.c > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterCommon.c > @@ -7,7 +7,7 @@ >=20 > **/ >=20 > -#include "ReportStatusCodeRouterSmm.h" > +#include "ReportStatusCodeRouterCommon.h" >=20 > LIST_ENTRY mCallbackListHead =3D INITIALIZE_LIST_HEAD_VARIABL= E > (mCallbackListHead); >=20 > @@ -17,11 +17,11 @@ LIST_ENTRY mCallbackListHead =3D > INITIALIZE_LIST_HEAD_VARIABLE (mCallba > // > UINT32 mStatusCodeNestStatus =3D 0; >=20 > -EFI_SMM_STATUS_CODE_PROTOCOL mSmmStatusCodeProtocol =3D { > +EFI_MM_STATUS_CODE_PROTOCOL mSmmStatusCodeProtocol =3D { > ReportDispatcher > }; >=20 > -EFI_SMM_RSC_HANDLER_PROTOCOL mSmmRscHandlerProtocol =3D { > +EFI_MM_RSC_HANDLER_PROTOCOL mSmmRscHandlerProtocol =3D { > Register, > Unregister > }; > @@ -45,18 +45,18 @@ EFI_SMM_RSC_HANDLER_PROTOCOL > mSmmRscHandlerProtocol =3D { EFI_STATUS EFIAPI Register ( > - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback > + IN EFI_MM_RSC_HANDLER_CALLBACK Callback > ) > { > LIST_ENTRY *Link; > - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; > + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; >=20 > if (Callback =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackLi= stHead, > Link); Link =3D GetNextNode (&mCallbackListHead, Link)) { > - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, > SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, > + MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > if (CallbackEntry->RscHandlerCallback =3D=3D Callback) { > // > // If the function was already registered. It can't be registered = again. > @@ -65,10 +65,10 @@ Register ( > } > } >=20 > - CallbackEntry =3D (SMM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool > (sizeof (SMM_RSC_HANDLER_CALLBACK_ENTRY)); > + CallbackEntry =3D (MM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool > (sizeof > + (MM_RSC_HANDLER_CALLBACK_ENTRY)); > ASSERT (CallbackEntry !=3D NULL); >=20 > - CallbackEntry->Signature =3D > SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE; > + CallbackEntry->Signature =3D > MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE; > CallbackEntry->RscHandlerCallback =3D Callback; >=20 > InsertTailList (&mCallbackListHead, &CallbackEntry->Node); @@ -92,18 > +92,18 @@ Register ( EFI_STATUS EFIAPI Unregister ( > - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback > + IN EFI_MM_RSC_HANDLER_CALLBACK Callback > ) > { > LIST_ENTRY *Link; > - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; > + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; >=20 > if (Callback =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackLi= stHead, > Link); Link =3D GetNextNode (&mCallbackListHead, Link)) { > - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, > SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, > + MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > if (CallbackEntry->RscHandlerCallback =3D=3D Callback) { > // > // If the function is found in list, delete it and return. > @@ -140,16 +140,16 @@ Unregister ( > EFI_STATUS > EFIAPI > ReportDispatcher ( > - IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This, > - IN EFI_STATUS_CODE_TYPE Type, > + IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This, > + IN EFI_STATUS_CODE_TYPE CodeType, > IN EFI_STATUS_CODE_VALUE Value, > IN UINT32 Instance, > - IN CONST EFI_GUID *CallerId OPTIONAL, > + IN CONST EFI_GUID *CallerId, > IN EFI_STATUS_CODE_DATA *Data OPTIONAL > ) > { > LIST_ENTRY *Link; > - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; > + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; >=20 > // > // Use atom operation to avoid the reentant of report. > @@ -160,13 +160,13 @@ ReportDispatcher ( > } >=20 > for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackLi= stHead, > Link);) { > - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, > SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, > + MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); > // > // The handler may remove itself, so get the next handler in advance= . > // > Link =3D GetNextNode (&mCallbackListHead, Link); > CallbackEntry->RscHandlerCallback ( > - Type, > + CodeType, > Value, > Instance, > (EFI_GUID*)CallerId, @@ -186,20 +186,15 @@ ReportDi= spatcher ( > /** > Entry point of Generic Status Code Driver. >=20 > - This function is the entry point of SMM Status Code Router . > - It produces SMM Report Stataus Code Handler and Status Code protocol. > - > - @param ImageHandle The firmware allocated handle for the EFI im= age. > - @param SystemTable A pointer to the EFI System Table. > + This function is the common entry point of MM Status Code Router. > + It produces MM Report Status Code Handler and Status Code protocol. >=20 > @retval EFI_SUCCESS The entry point is executed successfully. >=20 > **/ > EFI_STATUS > -EFIAPI > -GenericStatusCodeSmmEntry ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > +GenericStatusCodeCommonEntry ( > + VOID > ) > { > EFI_STATUS Status; > @@ -210,9 +205,9 @@ GenericStatusCodeSmmEntry ( > // > // Install SmmRscHandler Protocol > // > - Status =3D gSmst->SmmInstallProtocolInterface ( > + Status =3D gMmst->MmInstallProtocolInterface ( > &Handle, > - &gEfiSmmRscHandlerProtocolGuid, > + &gEfiMmRscHandlerProtocolGuid, > EFI_NATIVE_INTERFACE, > &mSmmRscHandlerProtocol > ); > @@ -221,9 +216,9 @@ GenericStatusCodeSmmEntry ( > // > // Install SmmStatusCode Protocol > // > - Status =3D gSmst->SmmInstallProtocolInterface ( > + Status =3D gMmst->MmInstallProtocolInterface ( > &Handle, > - &gEfiSmmStatusCodeProtocolGuid, > + &gEfiMmStatusCodeProtocolGuid, > EFI_NATIVE_INTERFACE, > &mSmmStatusCodeProtocol > ); > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterStandaloneMm.c > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterStandaloneMm.c > new file mode 100644 > index 000000000000..bd1519fa1506 > --- /dev/null > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterStandaloneMm.c > @@ -0,0 +1,33 @@ > +/** @file > + Report Status Code Router Driver which produces MM Report Stataus > +Code Handler Protocol > + and MM Status Code Protocol. > + > + Copyright (c) 2009 - 2018, Intel Corporation. All rights > + reserved.
Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "ReportStatusCodeRouterCommon.h" > + > +/** > + Entry point of Generic Status Code Driver. > + > + This function is the entry point of MM Status Code Router . > + It produces MM Report Stataus Code Handler and Status Code protocol. > + > + @param ImageHandle The firmware allocated handle for the EFI im= age. > + @param SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +GenericStatusCodeStandaloneMmEntry ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_MM_SYSTEM_TABLE *SystemTable > + ) > +{ > + return GenericStatusCodeCommonEntry (); } > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterTraditional.c > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterTraditional.c > new file mode 100644 > index 000000000000..360a0eef6b6d > --- /dev/null > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterTraditional.c > @@ -0,0 +1,33 @@ > +/** @file > + Report Status Code Router Driver which produces MM Report Stataus > +Code Handler Protocol > + and MM Status Code Protocol. > + > + Copyright (c) 2009 - 2018, Intel Corporation. All rights > + reserved.
Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "ReportStatusCodeRouterCommon.h" > + > +/** > + Entry point of Generic Status Code Driver. > + > + This function is the entry point of SMM Status Code Router . > + It produces SMM Report Stataus Code Handler and Status Code protocol. > + > + @param ImageHandle The firmware allocated handle for the EFI im= age. > + @param SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +GenericStatusCodeTraditionalEntry ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + return GenericStatusCodeCommonEntry (); } > diff --git a/MdeModulePkg/MdeModulePkg.dsc > b/MdeModulePkg/MdeModulePkg.dsc index 34ca571ca662..f95c7cd69ee1 > 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -479,6 +479,7 @@ [Components.IA32, Components.X64] >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSta > ndaloneMm.inf >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.inf > + > + > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRout > + erStandaloneMm.inf > MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf >=20 > MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllo > cationProfileLib.inf >=20 > MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMem > oryAllocationProfileLib.inf > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.h > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterCommon.h > similarity index 73% > rename from > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.h > rename to > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterCommon.h > index f8c48c62e790..4ead2dcbdf2c 100644 > --- > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.h > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterCommon.h > @@ -6,28 +6,26 @@ >=20 > **/ >=20 > -#ifndef __REPORT_STATUS_CODE_ROUTER_SMM_H__ > -#define __REPORT_STATUS_CODE_ROUTER_SMM_H__ > +#ifndef __REPORT_STATUS_CODE_ROUTER_COMMON_H__ > +#define __REPORT_STATUS_CODE_ROUTER_COMMON_H__ >=20 > - > -#include > -#include > +#include > +#include >=20 > #include > #include #include > #include -#include - > #include > +#include > #include >=20 > -#define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE > SIGNATURE_32 ('s', 'h', 'c', 'e') > +#define MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE > SIGNATURE_32 ('s', > +'h', 'c', 'e') >=20 > typedef struct { > UINTN Signature; > - EFI_SMM_RSC_HANDLER_CALLBACK RscHandlerCallback; > + EFI_MM_RSC_HANDLER_CALLBACK RscHandlerCallback; > LIST_ENTRY Node; > -} SMM_RSC_HANDLER_CALLBACK_ENTRY; > +} MM_RSC_HANDLER_CALLBACK_ENTRY; >=20 > /** > Register the callback function for ReportStatusCode() notification. > @@ -48,7 +46,7 @@ typedef struct { > EFI_STATUS > EFIAPI > Register ( > - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback > + IN EFI_MM_RSC_HANDLER_CALLBACK Callback > ); >=20 > /** > @@ -67,13 +65,13 @@ Register ( > EFI_STATUS > EFIAPI > Unregister ( > - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback > + IN EFI_MM_RSC_HANDLER_CALLBACK Callback > ); >=20 > /** > Provides an interface that a software module can call to report a stat= us > code. >=20 > - @param This EFI_SMM_STATUS_CODE_PROTOCOL instance. > + @param This EFI_MM_RSC_HANDLER_CALLBACK instance. > @param Type Indicates the type of status code being repor= ted. > @param Value Describes the current status of a hardware or > software entity. > This included information about the class and= subclass that is > used to @@ -92,12 +90,26 @@ Unregister ( EFI_STATUS EFIAPI > ReportDispatcher ( > - IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This, > - IN EFI_STATUS_CODE_TYPE Type, > + IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This, > + IN EFI_STATUS_CODE_TYPE CodeType, > IN EFI_STATUS_CODE_VALUE Value, > IN UINT32 Instance, > - IN CONST EFI_GUID *CallerId OPTIONAL, > + IN CONST EFI_GUID *CallerId, > IN EFI_STATUS_CODE_DATA *Data OPTIONAL > ); >=20 > +/** > + Entry point of Generic Status Code Driver. > + > + This function is the common entry point of MM Status Code Router. > + It produces MM Report Status Code Handler and Status Code protocol. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + > +**/ > +EFI_STATUS > +GenericStatusCodeCommonEntry ( > + VOID > + ); > + > #endif > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.inf > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.inf > index 46fdcb7bf959..539badc4c755 100644 > --- > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.inf > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterSmm.inf > @@ -16,7 +16,7 @@ [Defines] > MODULE_TYPE =3D DXE_SMM_DRIVER > PI_SPECIFICATION_VERSION =3D 0x0001000A > VERSION_STRING =3D 1.0 > - ENTRY_POINT =3D GenericStatusCodeSmmEntry > + ENTRY_POINT =3D GenericStatusCodeTraditionalEntry >=20 > # > # The following information is for reference only and not required by th= e > build tools. > @@ -25,15 +25,16 @@ [Defines] > # >=20 > [Sources] > - ReportStatusCodeRouterSmm.c > - ReportStatusCodeRouterSmm.h > + ReportStatusCodeRouterCommon.c > + ReportStatusCodeRouterCommon.h > + ReportStatusCodeRouterTraditional.c >=20 > [Packages] > MdePkg/MdePkg.dec > MdeModulePkg/MdeModulePkg.dec >=20 > [LibraryClasses] > - SmmServicesTableLib > + MmServicesTableLib > UefiDriverEntryPoint > DebugLib > BaseLib > @@ -41,8 +42,8 @@ [LibraryClasses] > MemoryAllocationLib >=20 > [Protocols] > - gEfiSmmRscHandlerProtocolGuid ## PRODUCES > - gEfiSmmStatusCodeProtocolGuid ## PRODUCES > + gEfiMmRscHandlerProtocolGuid ## PRODUCES > + gEfiMmStatusCodeProtocolGuid ## PRODUCES >=20 > [Depex] > TRUE > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterStandaloneMm.inf > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterStandaloneMm.inf > new file mode 100644 > index 000000000000..7aa0127e0bec > --- /dev/null > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterStandaloneMm.inf > @@ -0,0 +1,49 @@ > +## @file > +# Report Status Code Router Driver which produces MM Report Stataus > Code Handler Protocol and MM Status Code Protocol. > +# > +# Copyright (c) 2009 - 2018, Intel Corporation. All rights > +reserved.
# Copyright (c) Microsoft Corporation. > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D ReportStatusCodeRouterStandaloneMm > + FILE_GUID =3D EAEEDEF9-ABE7-4B95-82B0-5A534C899B4= 6 > + MODULE_TYPE =3D MM_STANDALONE > + PI_SPECIFICATION_VERSION =3D 0x00010032 > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D GenericStatusCodeStandaloneMmEntry > + > +# > +# The following information is for reference only and not required by th= e > build tools. > +# > +# VALID_ARCHITECTURES =3D IA32 X64 > +# > + > +[Sources] > + ReportStatusCodeRouterCommon.c > + ReportStatusCodeRouterCommon.h > + ReportStatusCodeRouterStandaloneMm.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + > +[LibraryClasses] > + MmServicesTableLib > + StandaloneMmDriverEntryPoint > + DebugLib > + BaseLib > + SynchronizationLib > + MemoryAllocationLib > + > +[Protocols] > + gEfiMmRscHandlerProtocolGuid ## PRODUCES > + gEfiMmStatusCodeProtocolGuid ## PRODUCES > + > +[Depex] > + TRUE > -- > 2.30.0.windows.1