From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.9120.1608626538856401162 for ; Tue, 22 Dec 2020 00:42:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=IIH2gQDd; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: hao.a.wu@intel.com) IronPort-SDR: g/cvREu41bpt8kw47N5C60RIEt+gfNSCmfrHtFv9yBlVVGy4Uph3mWPd4+jWrIg3brE2F1BdNR IMbX9E2gfGmg== X-IronPort-AV: E=McAfee;i="6000,8403,9842"; a="172328820" X-IronPort-AV: E=Sophos;i="5.78,438,1599548400"; d="scan'208";a="172328820" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2020 00:42:17 -0800 IronPort-SDR: /K6RqHaNpvY2Rrd3bUzLh6p72B70eo14DHYtnr6Gv22k1pA81GINff+s3r5qysUWbAxUDBySow qmQwtVV5R68w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,438,1599548400"; d="scan'208";a="382489189" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga007.jf.intel.com with ESMTP; 22 Dec 2020 00:42:16 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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, 22 Dec 2020 00:42:15 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 22 Dec 2020 00:42:15 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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, 22 Dec 2020 00:42:15 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 22 Dec 2020 00:42:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kdz2bHS8SnBpKj0sPbTOxyAl0P2ziFEUYTEz5ZM2i/UMAqklpHP6NGmskcC6u0pFO3PQGw6WQSMN6qb8lRpJ0sHya/4ooEqdhAvkCH2UI4H4XgMz1lDaxfZB/v53096Ic+KMImOSOdSS9E6I4Kx1iD9fi1vLnkZPm2f1JEPCWC+JRjRrC4rC8nIM6A8hfSvwwIQtXRQIwZa52Kr1HvBYnjsN8a63suOUVtPUyrOWlyyEg0tmbHl9QlRK0E0wVYFs1D2QX/c+xAMARGqXP2eQwNhKFGzF29BRRv7W2xYCUT0IY24/wd4uOiUDj0ARWIrw/YYxXpXtw8vBdvQsOWMwZw== 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=Hfn9uOmX2TpTY3FhZlfLbPkZknLSbQJL1DDjd69GvfE=; b=U7YUv5goZFNYmPqy5F7nFbE8oxWxXf0BWsjEQZmMJGxWOW0KETtelrYTJWsJXBdQUbLubd47sOY+Q0KbxpykjGdZ/P793uvexzoNjHkfT/TYIgLJw52pERCsHWiDo3nME+usQo2chYHbe7bhze1PzwJFpvJvAigo1klhxsnNZoV3VsM1fmO5IazyVvhfL0fsyHKHyoPGkEaJemC+1yksPD9cf4CDfTEaVjUVCo1vf989XHZnIY9AHB0kILi9KgHgPxMgjYP+DZ9P3DI7HA7eHSJP8lUX3gFwW/AOBz36WlighflLpMWTG6iHWsHbNSnIfPYbVZ5tq4nyUYjH0sCj1A== 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=Hfn9uOmX2TpTY3FhZlfLbPkZknLSbQJL1DDjd69GvfE=; b=IIH2gQDdCQjjWGk4k+eZIyvfnFUBxoqPS2WVcLsV1+7PlGhYTBy2J1S+5Uh0VnMao6/FhluU51PiguPUhteOrratfidjOl9dpfgdv+Q9xLq7W8YsYFjUCsdVBdTTN7KKiUr9fDPwWmRbSlNphJC2uJrd/9ntoJUQF4RJTae7moA= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR1101MB2354.namprd11.prod.outlook.com (2603:10b6:404:9b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25; Tue, 22 Dec 2020 08:42:08 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::4cda:993f:ffc1:f169]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::4cda:993f:ffc1:f169%6]) with mapi id 15.20.3676.033; Tue, 22 Dec 2020 08:42:08 +0000 From: "Wu, Hao A" To: Kun Qin , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Bi, Dandan" , Liming Gao , "Yao, Jiewen" Subject: Re: [PATCH v1 08/15] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Thread-Topic: [PATCH v1 08/15] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Thread-Index: AQHW1W60HwzE9Kp2GkegWishqJEmeKoCz0qA Date: Tue, 22 Dec 2020 08:42:08 +0000 Message-ID: References: <20201218185011.1366-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: c4060d40-8003-4cef-2148-08d8a6557799 x-ms-traffictypediagnostic: BN6PR1101MB2354: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Zib5NUNzA8sdDz/YVXiDDvzmB65Iqm29Xu++2+FRRg4R6Mi4CHzndhJzH/cdX+Q4uBZGVUzX2OkmAl95Yn1FcxkKR291iSdWB6HSxT5Nm5vLQQ0Eb0m1XJpD3bFdUo9eXNWQ3chAi8Gk8HfXFn9ZciuYE20i7MZp3bIYb0ju0MnDP1reDe8h4ah4B5u3voRrRH3fIjPnmJJivAYYbPfDfwRyv3p1/dIqNeL/OPlmYdH1DDnRe/LNx06r/AN9XNqmZMNqAxei72EI/Eg7zBqWNlWybu/QlVpnaudtujbpYdvGlkdJ3DxsQ7pp+wDh+D538tLYc4agXOTV5x9FsmCkQBsXKKYJq2AjqypPPbpQ7rQrce5oKMFvPZ1O366g5MO0uaP8sOU/tn2HSyrLXqqJew== 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)(396003)(366004)(376002)(136003)(346002)(39860400002)(26005)(7696005)(6506007)(71200400001)(8936002)(2906002)(86362001)(66556008)(66476007)(33656002)(64756008)(66446008)(66574015)(54906003)(30864003)(83380400001)(55016002)(9686003)(76116006)(110136005)(186003)(66946007)(52536014)(45080400002)(4326008)(8676002)(53546011)(107886003)(316002)(478600001)(5660300002)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?HVtudv192EaK2Hj4iVGuF7CtsWyblwVDFV3ZRvg8XFfOhsALip0ZIVexKFVW?= =?us-ascii?Q?xMN7u3t7iPXNPYIxi89bMNrcHEvRdL1E5rNIPpGZbvkYbXjbXyUSajUg7KJV?= =?us-ascii?Q?vJv5bvQW21GQVZHSqijFj8szMsmw9yMR/PnCEx5SEg0kxVxyAKBfVfU4jC18?= =?us-ascii?Q?L9BC+d6QaCCZxfuid+XAQj+1XMoUt/IzKGL9wJqg4ADEJziDhDSKyb0ob/nT?= =?us-ascii?Q?R9fFujIFkWJhF2K34qIf7dOR+a3ywdHahm7PVwfQZcPCCHT2XRzuc4BjKO8J?= =?us-ascii?Q?OuFxVUTfmsyByaHze6je+x8iu94mieEzNZ1JSBJ/ygsyYDAjFii/6my0XIr5?= =?us-ascii?Q?JOlqJ1NA9h8QHc/8cnEs9lahFMkX1chHjv2UN/5bPh7UXjNgfbNKgSbspeui?= =?us-ascii?Q?Ct7Hgo4lpdZjqKSnUEXQ9Q29BiFV4rEKNFHzpSkhmMdKMUBR9Fe+nc0CMDVF?= =?us-ascii?Q?TCyNcGgeUm6jpgxApBxGI7QFVl57rOedh1YWkvDUCsP7f8I76tqn/OsVyd6s?= =?us-ascii?Q?29T4v+d9GNjW5xjyjIEXJsTHdPJHa1Oho/l5bXpR87Q0pxKtd/y8pgpeXNte?= =?us-ascii?Q?/fGLjIXOmbTqzOBI8ywqQcc2V+XjJahm8huPOE0QeanROgV/CFKZwtBgzHQZ?= =?us-ascii?Q?N3g60a6sjL3CJt38p32EewzUhNxTvN833YSmci+RiVzVcnXj4oGfe68Fb5/v?= =?us-ascii?Q?iXHMw65zMPAngOdrnHlEfYwU7NvndXOGtzyopNDmOl/knyMFZvMIOgvPlhy8?= =?us-ascii?Q?QHLevU9TZuJsP8DolPd5mRVg0yHDVsZC5hL5wAtvcnUFVAj1BnSQq/EngmNC?= =?us-ascii?Q?MVXns2GIyENgFAOuprp7fbce6jXJg6kxt5oc2S529JS7haiGwpn/iFGaE0Vk?= =?us-ascii?Q?UYS2lTufLpvyHUYWXGOLpayf1P1D1rPfpkmPC8JpoU3rwNOzKRxLy8pd3lCe?= =?us-ascii?Q?vBw+0IhGyio4vCpgTTLkBil5MFg3KjFG4Y5WGZB2L/g=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: c4060d40-8003-4cef-2148-08d8a6557799 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Dec 2020 08:42:08.0471 (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: QPr8jj29UZiqIguM46I1XfzALaU5sdyby6mIMgYT0vHaCXRLJTJsUwe30+2lqlPSsNLAx4DRl0zpazlgNeKJlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2354 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 A couple of inline comments below: > -----Original Message----- > From: Kun Qin > Sent: Saturday, December 19, 2020 2:50 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Bi, Dandan ; Liming Gao > Subject: [PATCH v1 08/15] 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. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Dandan Bi > Cc: Liming Gao >=20 > Signed-off-by: Kun Qin > --- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/{ReportStatusCo > deRouterSmm.c =3D> ReportStatusCodeRouterCommon.c} | 43 ++++++++------ > --- >=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} | 50 > +++++++++++++------- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.inf | 13 ++--- >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterStandaloneMm.inf | 49 +++++++++++++++++++ > 7 files changed, 177 insertions(+), 45 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterSmm.c > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > odeRouterCommon.c > similarity index 80% > rename from > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.c > rename to > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterCommon.c > index c3ab5cd05045..585428aad669 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 CONST EFI_MM_STATUS_CODE_PROTOCOL *This, > IN EFI_STATUS_CODE_TYPE Type, > 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,7 +160,7 @@ 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= . > // > @@ -197,9 +197,8 @@ ReportDispatcher ( > **/ > EFI_STATUS > EFIAPI > -GenericStatusCodeSmmEntry ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > +GenericStatusCodeCommonEntry ( > + VOID > ) Could you help to remove the 'EFIAPI' for function GenericStatusCodeCommonE= ntry()? And also update the function description comments for removed input paramet= ers? > { > EFI_STATUS Status; > @@ -210,9 +209,9 @@ GenericStatusCodeSmmEntry ( > // > // Install SmmRscHandler Protocol > // > - Status =3D gSmst->SmmInstallProtocolInterface ( > + Status =3D gMmst->MmInstallProtocolInterface ( > &Handle, > - &gEfiSmmRscHandlerProtocolGuid, > + &gEfiMmRscHandlerProtocolGuid, > EFI_NATIVE_INTERFACE, > &mSmmRscHandlerProtocol > ); > @@ -221,9 +220,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..501572719fdc > --- /dev/null > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterStandaloneMm.c > @@ -0,0 +1,33 @@ > +/** @file > + Report Status Code Router Driver which produces SMM Report Stataus > +Code Handler Protocol > + and SMM 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 > +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 dc85d108d958..84ad577c2851 > 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -477,6 +477,7 @@ [Components.IA32, Components.X64] >=20 > MdeModulePkg/Library/SmmReportStatusCodeLib/StandaloneMmReportSt > atusCodeLib.inf >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.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 70% > rename from > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.h > rename to > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterCommon.h > index f8c48c62e790..f7962e773bb3 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,30 @@ 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, I found that the above parameter does not match the name with its implement= ation in .C files. Could you help to update it? > IN EFI_STATUS_CODE_VALUE Value, > IN UINT32 Instance, > - IN CONST EFI_GUID *CallerId OPTIONAL, > - IN EFI_STATUS_CODE_DATA *Data OPTIONAL > + IN CONST EFI_GUID *CallerId, > + IN EFI_STATUS_CODE_DATA *Data OPTIONAL > + ); > + > +/** > + 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 > +GenericStatusCodeCommonEntry ( > + VOID > ); Could you help to remove the 'EFIAPI' for function GenericStatusCodeCommonE= ntry()? And also update the function description comments for removed input paramet= ers? Best Regards, Hao Wu >=20 > #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..f34b3e29d4ad > --- /dev/null > +++ > b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC > ode > +++ RouterStandaloneMm.inf > @@ -0,0 +1,49 @@ > +## @file > +# Report Status Code Router Driver which produces SMM Report Stataus > Code Handler Protocol and SMM 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.28.0.windows.1