From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.67.52; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067052.outbound.protection.outlook.com [40.92.67.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7D480210BFF73 for ; Sat, 21 Jul 2018 15:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LgmWIKot+ibGmqanFGYHNgIoYSgZuHnCliDQLSg1+bI=; b=jUq+o4Mx3dk6EcNsN+5W+1UlQ8d+Zysd/fCi6EYZfiTP1uJyL1AqqnkOMkEzhMiXeKLlpqUSVwh6lczp3OcxJkaB1EHuo3SWBfikp4LSk9QsnTZyflGDrfcBu7Wjs5zRk5F4dHrx0wfH0CDDPOFD15CEVbw69oMgMZyXQ7ljL9m9USJzh52enrK+bdJDnpivchU8OWODPFA8llvQ6tiTgPF6paqJ9sSMBfJghRyzODbDGR7cev67b9LlbYFHyg52cMtA0lyktkJ7d11whjWhz6z0lkhwnVCTMdJbtAwE800/T2nehC4DmoCvyPEBmZZ/6N5LwoVuWaOw4q+Ks9vTJQ== Received: from VE1EUR02FT006.eop-EUR02.prod.protection.outlook.com (10.152.12.51) by VE1EUR02HT073.eop-EUR02.prod.protection.outlook.com (10.152.13.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.952.17; Sat, 21 Jul 2018 22:32:02 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com (10.152.12.60) by VE1EUR02FT006.mail.protection.outlook.com (10.152.12.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.952.17 via Frontend Transport; Sat, 21 Jul 2018 22:32:02 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7532:4dc6:e9f7:4765]) by VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7532:4dc6:e9f7:4765%2]) with mapi id 15.20.0973.018; Sat, 21 Jul 2018 22:32:02 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" CC: "michael.d.kinney@intel.com" , "liming.gao@intel.com" , "star.zeng@intel.com" , "eric.dong@intel.com" , "ruiyu.ni@intel.com" , "achin.gupta@arm.com" , "jiewen.yao@intel.com" , "supreeth.venkatesh@arm.com" Thread-Topic: [PATCH 3/4] MdeModulePkg: Import PiSmmCoreMmServicesTableLib library. Thread-Index: AQHUIUKlHIO22Ii2kUqDauFdzjobCg== Date: Sat, 21 Jul 2018 22:32:02 +0000 Message-ID: References: <5f41891c14511148a07d6b05c3f9ff7547aa8200.1532212228.git.Marvin.Haeuser@outlook.com> In-Reply-To: <5f41891c14511148a07d6b05c3f9ff7547aa8200.1532212228.git.Marvin.Haeuser@outlook.com> Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0013.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::26) To VI1PR0801MB1790.eurprd08.prod.outlook.com (2603:10a6:800:5b::15) x-incomingtopheadermarker: OriginalChecksum:9D8E2A8701183B5025AECA9A7F6DC0096BAECECCE33C22A3630ED5EBF310967A; UpperCasedChecksum:7058D96E8EC029BC0CF8FB22DEAD866104DC2EA108292599F218A14C149718B8; SizeAsReceived:8011; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [7t13XwBHrVm+bjfWGOym5EPJ8oysBGYA] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR02HT073; 7:d5nDBaqES+h9y/pY4ioZ3BVwUPUJ69/k6M/ktPKBEu7sgYx5wsJXHjjSGyHD1uhu3RutJGxD1j66pu1fBPwAsYMa6Nuh6U/5RoXCYSNqvpCAGMt4Y0gYUv28BACwNJ81ByrT7j3Elxk9mJRQf8i9NRBYojp4ATpVFwkZiByZqZq3w5W6qDeIf9xqZrAlf5HDumyxpFjDOS+edTDFwYJSynWdL2kgkGy4iT5VTMJD5FRYBQHxqF2za7EqXuScQvNl x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125500)(1701031045); SRVR:VE1EUR02HT073; x-ms-traffictypediagnostic: VE1EUR02HT073: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(82015058); SRVR:VE1EUR02HT073; BCL:0; PCL:0; RULEID:; SRVR:VE1EUR02HT073; x-forefront-prvs: 074040B844 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(6029001)(189003)(199004)(256004)(54906003)(6916009)(86362001)(476003)(5660300001)(486006)(426003)(386003)(72206003)(26005)(87572001)(20460500001)(14454004)(11346002)(6306002)(446003)(97736004)(53376002)(25786009)(99286004)(55016002)(2900100001)(4326008)(68736007)(104016004)(15188155005)(2501003)(76176011)(74316002)(33656002)(305945005)(5640700003)(8936002)(81156014)(7696005)(56003)(8676002)(6346003)(106356001)(102836004)(2351001)(16799955002)(6436002)(966005)(105586002)(5250100002)(82202002); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR02HT073; H:VI1PR0801MB1790.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:; received-spf: None (protection.outlook.com: outlook.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Marvin.Haeuser@outlook.com; x-microsoft-antispam-message-info: TxX/xC4ehCvNHufHgTIfBhST5PSTtwl8VhkYoboYtQarJQEgWphHhBz5zjrqaBFgXpNOs71Jeh8MkdZ9J7Y1sRYGR/ix6f7TSBOZz+2jdjlPQYNyIS2UbA8dmHzGbzB2nCq6rnLQNTBt1JR53QBY8fghSsmp/eO+l/h4/OLynmP12AhN2NxXLy4NlcT0ai17CdkOGb7l/eT2uF8ce9eObaAQHVmIocp1Xobki6x/ufw= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: 87c998ac-d051-473c-82c2-08d5ef59c73f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2018 22:32:02.2724 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT073 Subject: [PATCH 3/4] MdeModulePkg: Import PiSmmCoreMmServicesTableLib library. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2018 22:32:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Implements the MmServicesTableLib library class for PiSmmCore. The code was derieved from PiSmmCoreSmmServicesTableLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableL= ib.c | 61 ++++++++++++++++++++ MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableL= ib.inf | 32 ++++++++++ MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableL= ib.uni | 21 +++++++ 3 files changed, 114 insertions(+) diff --git a/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmSe= rvicesTableLib.c b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCo= reMmServicesTableLib.c new file mode 100644 index 000000000000..9184e9e2e6c9 --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesT= ableLib.c @@ -0,0 +1,61 @@ +/** @file + SMM Core MM Services Table Library. + + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include +#include + +EFI_MM_SYSTEM_TABLE *gMmst =3D NULL; +extern EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst; + +/** + The constructor function caches the pointer of MM Services Table. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +SmmCoreMmServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + gMmst =3D (EFI_MM_SYSTEM_TABLE *)&gSmmCoreSmst; + return EFI_SUCCESS; +} + +/** + This function allows the caller to determine if the driver is executing = in + Management Mode(MM). + + This function returns TRUE if the driver is executing in MM and FALSE if= the + driver is not executing in MM. + + @retval TRUE The driver is executing in Management Mode (MM). + @retval FALSE The driver is not executing in Management Mode (MM). + +**/ +BOOLEAN +EFIAPI +InMm ( + VOID + ) +{ + return TRUE; +} diff --git a/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmSe= rvicesTableLib.inf b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmm= CoreMmServicesTableLib.inf new file mode 100644 index 000000000000..06bb455b1777 --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesT= ableLib.inf @@ -0,0 +1,32 @@ +## @file +# SMM Core MM Services Table Library. +# +# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PiSmmCoreMmServicesTableLib + MODULE_UNI_FILE =3D PiSmmCoreMmServicesTableLib.uni + FILE_GUID =3D 9E32CD7E-DB34-42B5-B5FA-77DD98633F47 + MODULE_TYPE =3D SMM_CORE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D MmServicesTableLib|SMM_CORE + PI_SPECIFICATION_VERSION =3D 0x0001000A + CONSTRUCTOR =3D SmmCoreMmServicesTableLibConstructor + +[Sources] + PiSmmCoreMmServicesTableLib.c + +[Packages] + MdePkg/MdePkg.dec + diff --git a/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmSe= rvicesTableLib.uni b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmm= CoreMmServicesTableLib.uni new file mode 100644 index 000000000000..dbf7ce93731e --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesT= ableLib.uni @@ -0,0 +1,21 @@ +// /** @file +// SMM Core MM Services Table Library. +// +// SMM Core MM Services Table Library. +// +// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the B= SD License +// which accompanies this distribution. The full text of the license may b= e found at +// http://opensource.org/licenses/bsd-license.php +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "SMM Core MM Servi= ces Table Library" + +#string STR_MODULE_DESCRIPTION #language en-US "SMM Core MM Servi= ces Table Library." + --=20 2.18.0.windows.1