From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.3085.1609903476617457257 for ; Tue, 05 Jan 2021 19:24:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=eMYvus3Y; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: hao.a.wu@intel.com) IronPort-SDR: VEg2rs4ER9uPS+98DpBYKqLE0zTRSzIV70M2N4wHq8U5oi6s3O4Um69SpYjQWoEfaS0sD3oHwX CT+gJELsJozg== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="238771545" X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="238771545" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 19:24:36 -0800 IronPort-SDR: H3sX141q76Vg7od7sGSSiEu75/Yt4XGfp5zbssn12fLpG6Oj6yKv4ZBdf0QnIx+mU5XZtdBR39 /qzp9KxVeoKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="361406534" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 05 Jan 2021 19:24:35 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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:33 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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; Tue, 5 Jan 2021 19:24:32 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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:32 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (192.55.55.68) 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:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W4vy4Qjg2KeWHkiGQSr05rgwUHVTdZ6btgCtN2XqCYqmu9AmBzTwcJT6ENVezAlu1whideEPoqSTSuVfA4x+BxBJ4VFtXHoHGQDRE3DaCb4u7Y4TepsfGojsmrWs44R74veLLhH43HNdAWMz3b1uZLnioYvBCVtdvbKCNVuJa2f17U3wTbn8Tiavhoxblqsy/jb1wcevzpVzwUf/QQ/vGrccsCE9byZ8KNfcxnm8QecZFD7M38ClR9jnA2hpVaBVxy3GeU7ahZbF0V6U9wcG/lH8/Fen3gm7JGsjHJyZA01RnBuOVbewmhRmgV0b2tWk0vcye4GE5NqUnJ5cx0yqYA== 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=zNSdJaAkdjYUaY49mxuJ8iyqVAekAH6UHCKBno8Sprg=; b=Aj1O0Ad6KPPrwl8vL9dLMJxFb6C5up0/Rsb4qEWF3nJQ/ch9K94tLjW+a4ZOqUg0mRrCGHiSjvkpgZBd0EPAMKCc34YboSRW5QuMmRr+au1kfhqiJ+bvb9obRQoN1YKuJ5o6UiEJUAN2eH4nEH9HTzFhcDVNLx/CYMk10QznC3uJJArC3+n8TX7QHW1uXpfVmv7SydS6Kl5vZIj+xwEl1rPydp3qEt65ly3/xOq5asO5yntmYW7F9zo2if52zTP4bq2n1DqwJjefrXRDLC3im9YHlwNLJZJINayz9Z6Jz4/GfQs+ix9FQJEP9cjS0tX23i45D3oX4uzAIFZiY9vzTw== 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=zNSdJaAkdjYUaY49mxuJ8iyqVAekAH6UHCKBno8Sprg=; b=eMYvus3YnfPh7r5SQ5pgG2I1u8JFS/tcGa37jvRVyVmZepqN619+GaJVl84rFNNi8Hhpp9A5em66DfOlfHOrvy8eWPnHpM1U3s1zHZjDB//KJACOWv9XjLyJDB+774te9c6T7vNS1fFInOuLgccda4RwPfQZaGWEQLYGURfh0bU= 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:31 +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:30 +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 v2 07/16] MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver in StandaloneMm Thread-Topic: [PATCH v2 07/16] MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver in StandaloneMm Thread-Index: AQHW45UJJ00YtMqzPkKUQz2u5I0qtaoZ6YOA Date: Wed, 6 Jan 2021 03:24:30 +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: 64555f8e-8cef-49d7-3fe9-08d8b1f294a6 x-ms-traffictypediagnostic: BN7PR11MB2721: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1nd4yUpRdQF+NSfzULxDORj4OdHHGeCkeMFSOfKxqpneCQYABpGszeMyfwDw8OneI9EUD9BvK+1Ye6NA2j7xc+UdEQ93KksczO44nVYzvO8hZ0sU3V690gPifxdyh4Sb4nlJ/nEVI7dpoxZOWPlr+x19oCVjrZR+tLCY3b9Ar7ducKTf9aIk50akNbpt5wv+BABNwH5WPB7Nr37ofmGEF6XKo0Q2h/aGk6nOme1q55+qAZGyELl35SFhM9LVDiczWGGUNRpkUUFVmmkJEA5C/hDcHTEDdAs0CrIzRYEBCOkV2nGMqYsLX5AGCdYA62wbAqVGx/kC7zAo5c8M5QwhJwxPcrisw4+mKp6A8CvmMWxo4N/iPTlZHSPCwAI8XRUxIs3BohyswzSV4VdW4hE8qg== 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)(107886003)(6506007)(186003)(55016002)(66574015)(9686003)(86362001)(66946007)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?ZrHBpe3SqyMTXmlFEFSoJ8OPFlusoIlfCBWup8wLjIw9HKaRpJ/r7OBFsEm6?= =?us-ascii?Q?iv/E3UWjAmL0j7SwDDPBMA41eUy1DBhGjXw1NXrCt0ZM7D/X+j6+Dfkab/LW?= =?us-ascii?Q?eqoB47vRjgBrdSi86fCvR9rAkPfbKlnZAdRT9oL8kCKiwueUbREdZ88RIZHf?= =?us-ascii?Q?30LgpguT/c4egL7Ab7H8/dCt9YIy+dVBLhA8wVt9fVZN97JqzrXrYxiEoylf?= =?us-ascii?Q?eGOWgpaPBMmOHv0HZH3qUwk2N4UBgcd8tQSaRsIwxcC+skgtzWfXAXhcedd/?= =?us-ascii?Q?GlTolq3WAPL7RpfmANw+Ew7aIYw1f1oR3zthHIMLb+eBtPYq54MrPxLrV3re?= =?us-ascii?Q?2i1FhliUsodBGFFe28/Mzc8a3SgPCitBqJxobaiSRtkFs+XEVWJOSG9QuFfE?= =?us-ascii?Q?vKPxuA3FaUyD2mkpSRR+kT3GpLZfS7jQLP+/yGnzGL8ZjvULL/maHU2YnVJ5?= =?us-ascii?Q?bxnJmMi1wkfY0oOJDuN1vdMs05el4387N03uJyqqHYyhPXDDuBUSXbcg+ayB?= =?us-ascii?Q?TCwuA/s/3UKOM/Ysg3dFd55VZq5PdkvpFYUAK9RMKFKG8jI6zyEAwLdVLGnr?= =?us-ascii?Q?YW/EKHNfWJx1LNcKvKnTKwB8mDIRBhqrRDrqjDzMGbE4ngRAGEVVPJyMzNr7?= =?us-ascii?Q?rIDTWR53SCzuutt3RqoB+sMRM37TatyY8m0V1f5/ioXPqYnUvkIawfgrUsyc?= =?us-ascii?Q?QEtnxa7ywqfWY5ko+4/7+UYTGFSWv+eHS8WrsZiLYjdrDW7NtDOVNKzAQgKx?= =?us-ascii?Q?lAllGBeYpSXUa/tMxC/UusamJMBmAlUPM84RvElG4sdhrCFJn9Wz5iVtKU+H?= =?us-ascii?Q?6sp7OqbhpijR69H2IhmIzSrdU/GGyrIOuOahFSuH7/rW9gjuRwq1DVyyznSQ?= =?us-ascii?Q?vUUb5aqjMg0cGZGzaUZKqXfdbYJ9ZYn8yepKwhbzjEBBW7w2O2v0+F+TgknZ?= =?us-ascii?Q?jxL0Yfy2ZJqA2nelSHY5NSyiy9SSoQsColiymPc3Lzs=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: 64555f8e-8cef-49d7-3fe9-08d8b1f294a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2021 03:24:30.6590 (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: ITpyPdUte4Ev7iybZeQPF4uvKy/pHFeOwFmY099kflROOPVsWqicvLqCXdARfgSLTvhhlNpb5KPd8F4oZ8RLUg== 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 > ; Yao, Jiewen > Subject: [PATCH v2 07/16] MdeModulePkg: StatusCodeHandler: > StatusCodeHandler driver in StandaloneMm >=20 > This change added support of StandaloneMm for StatusCodeHandler. It adds > a new instance of StatusCodeHandler of MM_STANDALONE type, and > abstracts the driver entrypoint into separate files, replaced gSmst with > gMmst, and switched to MM version of RscHandlerProtocol. Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Dandan Bi > Cc: Liming Gao > Cc: Jiewen Yao >=20 > Signed-off-by: Kun Qin > --- >=20 > Notes: > v2: > - New patch to support StatusCodeHandler in standalone mm [Liming] >=20 >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeW > orker.c | 36 ++++++++++---------- >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWork > er.c | 2 +- >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/{StatusCodeHandlerS > mm.c =3D> StatusCodeHandlerMm.c} | 23 +++++-------- >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSta > ndalone.c | 31 +++++++++++++++++ >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerTra > ditional.c | 31 +++++++++++++++++ > MdeModulePkg/MdeModulePkg.dsc > | 1 + >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/{StatusCodeHandlerS > mm.h =3D> StatusCodeHandlerMm.h} | 23 ++++++++++--- >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf | 15 ++++---- >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/{StatusCodeHandlerS > mm.inf =3D> StatusCodeHandlerStandaloneMm.inf} | 32 ++++++++--------- > 9 files changed, 132 insertions(+), 62 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCode > Worker.c > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCode > Worker.c > index c9b43fd2468f..14bac8ec3c18 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCode > Worker.c > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCode > Worke > +++ r.c > @@ -7,15 +7,15 @@ >=20 > **/ >=20 > -#include "StatusCodeHandlerSmm.h" > +#include "StatusCodeHandlerMm.h" >=20 > -RUNTIME_MEMORY_STATUSCODE_HEADER > *mSmmMemoryStatusCodeTable; > +RUNTIME_MEMORY_STATUSCODE_HEADER > *mMmMemoryStatusCodeTable; >=20 > /** > - Initialize SMM memory status code table as initialization for memory s= tatus > code worker > + Initialize MM memory status code table as initialization for memory > + status code worker >=20 > - @retval EFI_SUCCESS SMM memory status code table successfully > initialized. > - @retval others Errors from gSmst->SmmInstallConfigurationTable()= . > + @retval EFI_SUCCESS MM memory status code table successfully > initialized. > + @retval others Errors from gMmst->MmInstallConfigurationTable(). > **/ > EFI_STATUS > MemoryStatusCodeInitializeWorker ( > @@ -25,17 +25,17 @@ MemoryStatusCodeInitializeWorker ( > EFI_STATUS Status; >=20 > // > - // Allocate SMM memory status code pool. > + // Allocate MM memory status code pool. > // > - mSmmMemoryStatusCodeTable =3D > (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof > (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 > (PcdStatusCodeMemorySize) * 1024); > - ASSERT (mSmmMemoryStatusCodeTable !=3D NULL); > + mMmMemoryStatusCodeTable =3D > (RUNTIME_MEMORY_STATUSCODE_HEADER > + *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + > + PcdGet16 (PcdStatusCodeMemorySize) * 1024); ASSERT > + (mMmMemoryStatusCodeTable !=3D NULL); >=20 > - mSmmMemoryStatusCodeTable->MaxRecordsNumber =3D (PcdGet16 > (PcdStatusCodeMemorySize) * 1024) / sizeof > (MEMORY_STATUSCODE_RECORD); > - Status =3D gSmst->SmmInstallConfigurationTable ( > - gSmst, > + mMmMemoryStatusCodeTable->MaxRecordsNumber =3D (PcdGet16 > + (PcdStatusCodeMemorySize) * 1024) / sizeof > (MEMORY_STATUSCODE_RECORD); Status =3D gMmst- > >MmInstallConfigurationTable ( > + gMmst, > &gMemoryStatusCodeRecordGuid, > - &mSmmMemoryStatusCodeTable, > - sizeof (mSmmMemoryStatusCodeTable) > + &mMmMemoryStatusCodeTable, > + sizeof (mMmMemoryStatusCodeTable) > ); > return Status; > } > @@ -74,8 +74,8 @@ MemoryStatusCodeReportWorker ( > // > // Locate current record buffer. > // > - Record =3D (MEMORY_STATUSCODE_RECORD *) > (mSmmMemoryStatusCodeTable + 1); > - Record =3D &Record[mSmmMemoryStatusCodeTable->RecordIndex++]; > + Record =3D (MEMORY_STATUSCODE_RECORD *) > (mMmMemoryStatusCodeTable + 1); > + Record =3D &Record[mMmMemoryStatusCodeTable->RecordIndex++]; >=20 > // > // Save status code. > @@ -92,12 +92,12 @@ MemoryStatusCodeReportWorker ( > // so the first record is pointed by record index. > // If it is less then max number, index of the first record is zero. > // > - mSmmMemoryStatusCodeTable->NumberOfRecords++; > - if (mSmmMemoryStatusCodeTable->RecordIndex =3D=3D > mSmmMemoryStatusCodeTable->MaxRecordsNumber) { > + mMmMemoryStatusCodeTable->NumberOfRecords++; > + if (mMmMemoryStatusCodeTable->RecordIndex =3D=3D > + mMmMemoryStatusCodeTable->MaxRecordsNumber) { > // > // Wrap around record index. > // > - mSmmMemoryStatusCodeTable->RecordIndex =3D 0; > + mMmMemoryStatusCodeTable->RecordIndex =3D 0; > } >=20 > return EFI_SUCCESS; > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWo > rker.c > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWo > rker.c > index 3df0a6712611..bcb75bc7b170 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWo > rker.c > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWo > rke > +++ r.c > @@ -6,7 +6,7 @@ >=20 > **/ >=20 > -#include "StatusCodeHandlerSmm.h" > +#include "StatusCodeHandlerMm.h" >=20 > /** > Convert status code value and extended data to readable ASCII string, = send > string to serial I/O device. > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.c > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler > Mm.c > similarity index 69% > rename from > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.c > rename to > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerM > m.c > index 20271571ded4..4948d3d99ad6 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.c > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler > Mm.c > @@ -1,15 +1,15 @@ > /** @file > Status Code Handler Driver which produces general handlers and hook > them > - onto the SMM status code router. > + onto the MM status code router. >=20 > Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ >=20 > -#include "StatusCodeHandlerSmm.h" > +#include "StatusCodeHandlerMm.h" >=20 > -EFI_SMM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol =3D NULL; > +EFI_MM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol =3D NULL; >=20 >=20 > /** > @@ -42,27 +42,22 @@ InitializationDispatcherWorker ( } >=20 > /** > - Entry point of SMM Status Code Driver. > + Entry point of Common MM Status Code Driver. >=20 > - This function is the entry point of SMM Status Code Driver. > - > - @param ImageHandle The firmware allocated handle for the EFI im= age. > - @param SystemTable A pointer to the EFI System Table. > + This function is the entry point of MM Status Code Driver. >=20 > @retval EFI_SUCCESS The entry point is executed successfully. >=20 > **/ > EFI_STATUS > -EFIAPI > -StatusCodeHandlerSmmEntry ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > +StatusCodeHandlerCommonEntry ( > + VOID > ) > { > EFI_STATUS Status; >=20 > - Status =3D gSmst->SmmLocateProtocol ( > - &gEfiSmmRscHandlerProtocolGuid, > + Status =3D gMmst->MmLocateProtocol ( > + &gEfiMmRscHandlerProtocolGuid, > NULL, > (VOID **) &mRscHandlerProtocol > ); > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > tandalone.c > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > tandalone.c > new file mode 100644 > index 000000000000..11a61705d612 > --- /dev/null > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > tan > +++ dalone.c > @@ -0,0 +1,31 @@ > +/** @file > + Abstraction layer that contains Standalone MM specific implementation > +for > + Status Code Handler Driver. > + > + Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "StatusCodeHandlerMm.h" > + > +/** > + Entry point of Standalone MM Status Code Driver. > + > + This function is the entry point of Standalone MM Status Code Driver. > + > + @param ImageHandle The firmware allocated handle for the EFI im= age. > + @param SystemTable A pointer to the EFI MM System Table. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +StatusCodeHandlerStandaloneMmEntry ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_MM_SYSTEM_TABLE *SystemTable > + ) > +{ > + return StatusCodeHandlerCommonEntry (); } > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerT > raditional.c > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerT > raditional.c > new file mode 100644 > index 000000000000..1105f184b08e > --- /dev/null > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerT > rad > +++ itional.c > @@ -0,0 +1,31 @@ > +/** @file > + Abstraction layer that contains Standalone MM specific implementation > +for > + Status Code Handler Driver. > + > + Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "StatusCodeHandlerMm.h" > + > +/** > + Entry point of Traditional MM Status Code Driver. > + > + This function is the entry point of Traditional MM Status Code Driver. > + > + @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 > +StatusCodeHandlerTraditionalMmEntry ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + return StatusCodeHandlerCommonEntry (); } > diff --git a/MdeModulePkg/MdeModulePkg.dsc > b/MdeModulePkg/MdeModulePkg.dsc index 200fbcc18a18..098909490095 > 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -476,6 +476,7 @@ [Components.IA32, Components.X64] >=20 > MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLi > b.inf >=20 > MdeModulePkg/Library/SmmReportStatusCodeLib/StandaloneMmReportSt > atusCodeLib.inf >=20 > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf > + > + > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSta > ndalo > + neMm.inf >=20 > MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod > eRouterSmm.inf > MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf >=20 > MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllo > cationProfileLib.inf > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.h > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler > Mm.h > similarity index 87% > rename from > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.h > rename to > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerM > m.h > index 6b5d53a4fee3..7871ee404046 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.h > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler > Mm.h > @@ -7,10 +7,10 @@ >=20 > **/ >=20 > -#ifndef __STATUS_CODE_HANDLER_SMM_H__ > -#define __STATUS_CODE_HANDLER_SMM_H__ > +#ifndef __STATUS_CODE_HANDLER_MM_H__ > +#define __STATUS_CODE_HANDLER_MM_H__ >=20 > -#include > +#include >=20 > #include #include > @@ -22,7 +22,7 @@ #include > #include #include > -#include > +#include > #include > #include #include > @@ -32,7 +32,7 @@ // #define > MAX_DEBUG_MESSAGE_LENGTH 0x100 >=20 > -extern RUNTIME_MEMORY_STATUSCODE_HEADER > *mSmmMemoryStatusCodeTable; > +extern RUNTIME_MEMORY_STATUSCODE_HEADER > *mMmMemoryStatusCodeTable; >=20 > /** > Locates Serial I/O Protocol as initialization for serial status code w= orker. > @@ -114,4 +114,17 @@ MemoryStatusCodeReportWorker ( > IN EFI_STATUS_CODE_DATA *Data OPTIONAL > ); >=20 > +/** > + Entry point of Common MM Status Code Driver. > + > + This function is the entry point of MM Status Code Driver. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + > +**/ > +EFI_STATUS > +StatusCodeHandlerCommonEntry ( > + VOID > + ); > + > #endif > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > index 4e24d87e55d1..90abe662d291 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm. > +++ inf > @@ -1,5 +1,5 @@ > ## @file > -# Status Code Handler Driver which produces general handlers and hook > them onto the SMM status code router. > +# Status Code Handler Driver which produces general handlers and hook > them onto the MM status code router. > # > # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. # (C) > Copyright 2016 Hewlett Packard Enterprise Development LP
@@ -17,7 > +17,7 @@ [Defines] > MODULE_TYPE =3D DXE_SMM_DRIVER > PI_SPECIFICATION_VERSION =3D 0x0001000A > VERSION_STRING =3D 1.0 > - ENTRY_POINT =3D StatusCodeHandlerSmmEntry > + ENTRY_POINT =3D StatusCodeHandlerTraditionalMmEntry >=20 > # > # The following information is for reference only and not required by th= e > build tools. > @@ -26,8 +26,9 @@ [Defines] > # >=20 > [Sources] > - StatusCodeHandlerSmm.c > - StatusCodeHandlerSmm.h > + StatusCodeHandlerMm.c > + StatusCodeHandlerMm.h > + StatusCodeHandlerTraditional.c > SerialStatusCodeWorker.c > MemoryStatusCodeWorker.c >=20 > @@ -37,7 +38,7 @@ [Packages] >=20 > [LibraryClasses] > SerialPortLib > - SmmServicesTableLib > + MmServicesTableLib > UefiDriverEntryPoint > PcdLib > PrintLib > @@ -51,7 +52,7 @@ [Guids] > gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES = ## > UNDEFINED # SmmSystemTable >=20 > [Protocols] > - gEfiSmmRscHandlerProtocolGuid ## CONSUMES > + gEfiMmRscHandlerProtocolGuid ## CONSUMES >=20 > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## > CONSUMES @@ -59,7 +60,7 @@ [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## > SOMETIMES_CONSUMES >=20 > [Depex] > - gEfiSmmRscHandlerProtocolGuid > + gEfiMmRscHandlerProtocolGuid >=20 > [UserExtensions.TianoCore."ExtraFiles"] > StatusCodeHandlerSmmExtra.uni > diff --git > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > tandaloneMm.inf > similarity index 62% > copy from > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf > copy to > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSta > ndaloneMm.inf > index 4e24d87e55d1..d7c863bf064c 100644 > --- > a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > +++ > b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > tan > +++ daloneMm.inf > @@ -1,8 +1,9 @@ > ## @file > -# Status Code Handler Driver which produces general handlers and hook > them onto the SMM status code router. > +# Status Code Handler Driver which produces general handlers and hook > them onto the MM status code router. > # > # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. # (C) > Copyright 2016 Hewlett Packard Enterprise Development LP
> +# Copyright (c) Microsoft Corporation. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -11,13 +12,12 @@ >=20 > [Defines] > INF_VERSION =3D 0x00010005 > - BASE_NAME =3D StatusCodeHandlerSmm > - MODULE_UNI_FILE =3D StatusCodeHandlerSmm.uni > - FILE_GUID =3D 79CD78D8-6EDC-4978-BD02-3299C387AB1= 7 > - MODULE_TYPE =3D DXE_SMM_DRIVER > - PI_SPECIFICATION_VERSION =3D 0x0001000A > + BASE_NAME =3D StatusCodeHandlerStandaloneMm > + FILE_GUID =3D EBE7802F-5E11-4D4E-B463-22D2425D156= B > + MODULE_TYPE =3D MM_STANDALONE > + PI_SPECIFICATION_VERSION =3D 0x00010032 > VERSION_STRING =3D 1.0 > - ENTRY_POINT =3D StatusCodeHandlerSmmEntry > + ENTRY_POINT =3D StatusCodeHandlerStandaloneMmEntry >=20 > # > # The following information is for reference only and not required by th= e > build tools. > @@ -26,8 +26,9 @@ [Defines] > # >=20 > [Sources] > - StatusCodeHandlerSmm.c > - StatusCodeHandlerSmm.h > + StatusCodeHandlerMm.c > + StatusCodeHandlerMm.h > + StatusCodeHandlerStandalone.c > SerialStatusCodeWorker.c > MemoryStatusCodeWorker.c >=20 > @@ -37,8 +38,8 @@ [Packages] >=20 > [LibraryClasses] > SerialPortLib > - SmmServicesTableLib > - UefiDriverEntryPoint > + MmServicesTableLib > + StandaloneMmDriverEntryPoint > PcdLib > PrintLib > ReportStatusCodeLib > @@ -48,10 +49,10 @@ [LibraryClasses] >=20 > [Guids] > gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES = ## > UNDEFINED > - gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES = ## > UNDEFINED # SmmSystemTable > + gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES = ## > UNDEFINED # MmSystemTable >=20 > [Protocols] > - gEfiSmmRscHandlerProtocolGuid ## CONSUMES > + gEfiMmRscHandlerProtocolGuid ## CONSUMES >=20 > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## > CONSUMES @@ -59,7 +60,4 @@ [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## > SOMETIMES_CONSUMES >=20 > [Depex] > - gEfiSmmRscHandlerProtocolGuid > - > -[UserExtensions.TianoCore."ExtraFiles"] > - StatusCodeHandlerSmmExtra.uni > + gEfiMmRscHandlerProtocolGuid > -- > 2.30.0.windows.1