From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.69.84; helo=eur02-ve1-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069084.outbound.protection.outlook.com [40.92.69.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 34A91210BFF73 for ; Sat, 21 Jul 2018 15:32:06 -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=Gvjs7IlfAG0EpNI/xeSEqplGGJjXzfLgSye0s57b0I4=; b=C5Z7k18ilwwC8MchSB6HNLxueksHpiXLAeIMd4Lkfsfe23i7CBRpnzGwVA35Zmezycbtn6sbt5/rXm5qNEfOTfNZI2TOqq1+4/UStCPUNM9cAqmbkjqNSnFsc94UjxsNQxSt8qK/3qXJjls0TPTg70IiakH1Hy5mutiwI4daG7Z9aQVFxwZZrSFwiTHeiIy3TKlFhVJyHLTkks5vcnyPkw5Fq2H8/7bZTd+gli0ZmyA4lMZFbLgo3J7dLS+d91by/dKAyzUJMdEq7qDRJXZDzvyYrCKIyKb7WUTTj+iHDCPifSaHityYnIjt9hSjk6+VoVPIsVU53/A56O7JmvIViw== Received: from VE1EUR02FT006.eop-EUR02.prod.protection.outlook.com (10.152.12.53) by VE1EUR02HT004.eop-EUR02.prod.protection.outlook.com (10.152.12.154) 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:03 +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:03 +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:03 +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 4/4] StandaloneMmPkg: Import StandaloneMmServicesTableLib library. Thread-Index: AQHUIUKlV/k7ZY0unU+tV24cipF2VQ== Date: Sat, 21 Jul 2018 22:32:03 +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:64E6125424E52C7B45DF73B122850C4B9258F9C31A223BD0F532E761418D9832; UpperCasedChecksum:040E07782826CE78FDC187EEB2C737860AAC1E0649C154003E97C785668E29CD; SizeAsReceived:8020; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [y06u7nSSkip0zxYjCkcpmq2WhbqKfhmz] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR02HT004; 7:zQs4JK75C/TPW+Scn2b+ZoNzNPtjs5tTQWPCrq6jnc+c6r6J+T8qYZUlsxGI77W/ZwTVcmmYxhnDLElptg/eoBi3UobGji2Z1QLDaHdyd9/Fee4OOp9v6NK+/+HWxbjPeS/fBKIYO/rx/6P9F4ctLr3AqQxTTqk+1SX5ac2UWktUW0c8WTtXEAWkMdrluyoCHyX1pQ3GXQr7klMDqexPQ8sgClZ6hhE8aVrO/hlEo4q0hdlC1iYCMHYiKXoysptp 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:VE1EUR02HT004; x-ms-traffictypediagnostic: VE1EUR02HT004: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(82015058); SRVR:VE1EUR02HT004; BCL:0; PCL:0; RULEID:; SRVR:VE1EUR02HT004; x-forefront-prvs: 074040B844 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(6029001)(189003)(199004)(5640700003)(99286004)(68736007)(55016002)(82202002)(305945005)(97736004)(6436002)(6306002)(20460500001)(26005)(256004)(6346003)(104016004)(74316002)(56003)(2351001)(14454004)(7696005)(106356001)(33656002)(105586002)(54906003)(8676002)(76176011)(386003)(966005)(476003)(5660300001)(2900100001)(6916009)(86362001)(486006)(446003)(72206003)(5250100002)(25786009)(2501003)(4326008)(11346002)(53376002)(8936002)(87572001)(81156014)(102836004)(426003); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR02HT004; 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: kkiV4aCXC8k3o5hAE8WQiUzHjfxwm6dvkAZW9fFiTu5uCwBh2MujTPMcUCMQaR3LYj/NKYqutIrIPsVq6+TTpamS0hjnojpUNIIIUQPnwVYacThQ9ZnhRdeTRot8bNy/kaUDwNhWz7MmSO4irViTDFyUfI2zded+cSG9oseNrwRS/biwALe4dvvAl2bc6PyEUHP46frGDD2rfnkqWYMD5YR31HM/71vi80U4E3DQuJw= 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: af450616-5461-4d53-6ff5-08d5ef59c7ef X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2018 22:32:03.3583 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT004 Subject: [PATCH 4/4] StandaloneMmPkg: Import StandaloneMmServicesTableLib 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 MM Stanalone modules. The code was derieved from SmmServicesTableLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesT= ableLib.c | 64 ++++++++++++++++++++ StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesT= ableLib.inf | 35 +++++++++++ StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesT= ableLib.uni | 21 +++++++ 3 files changed, 120 insertions(+) diff --git a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.c b/StandaloneMmPkg/Library/StandaloneMmServicesTableLi= b/StandaloneMmServicesTableLib.c new file mode 100644 index 000000000000..d33ff953b555 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServ= icesTableLib.c @@ -0,0 +1,64 @@ +/** @file + Standalone 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 + +EFI_MM_SYSTEM_TABLE *gMmst =3D NULL; + +/** + The constructor function caches the pointer of MM Services Table. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param MmSystemTable A pointer to the MM System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +StandaloneMmServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + gMmst =3D MmSystemTable; + ASSERT (gMmst !=3D NULL); + + 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 + ) +{ + // + // We are already in MM + // + return TRUE; +} diff --git a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.inf b/StandaloneMmPkg/Library/StandaloneMmServicesTable= Lib/StandaloneMmServicesTableLib.inf new file mode 100644 index 000000000000..bfe5678a5bc0 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServ= icesTableLib.inf @@ -0,0 +1,35 @@ +## @file +# Standalone MM Services Table Library. +# +# Copyright (c) 2009 - 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 StandaloneMmServicesTableLib + MODULE_UNI_FILE =3D StandaloneMmServicesTableLib.uni + FILE_GUID =3D 821F6D8E-CE99-4CD5-B1FD-C33AC8BA5704 + MODULE_TYPE =3D MM_STANDALONE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D MmServicesTableLib|MM_STANDALONE + PI_SPECIFICATION_VERSION =3D 0x0001000A + CONSTRUCTOR =3D StandaloneMmServicesTableLibConstruct= or + +[Sources] + StandaloneMmServicesTableLib.c + +[Packages] + MdePkg/MdePkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec + +[LibraryClasses] + DebugLib diff --git a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.uni b/StandaloneMmPkg/Library/StandaloneMmServicesTable= Lib/StandaloneMmServicesTableLib.uni new file mode 100644 index 000000000000..c0581e2820ce --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmServ= icesTableLib.uni @@ -0,0 +1,21 @@ +// /** @file +// Standalone MM Services Table Library. +// +// Standalone MM Services Table Library. +// +// Copyright (c) 2009 - 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 "Standalone MM Ser= vices Table Library" + +#string STR_MODULE_DESCRIPTION #language en-US "Standalone MM Ser= vices Table Library." + --=20 2.18.0.windows.1