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 <[email protected]> --- MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.c | 61 ++++++++++++++++++++ MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.inf | 32 ++++++++++ MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.uni | 21 +++++++ 3 files changed, 114 insertions(+) diff --git a/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.c b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.c new file mode 100644 index 000000000000..9184e9e2e6c9 --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.c @@ -0,0 +1,61 @@ +/** @file + SMM Core MM Services Table Library. + + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be 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 IMPLIED. + +**/ + +#include <PiMm.h> +#include <PiSmm.h> +#include <Library/MmServicesTableLib.h> +#include <Library/DebugLib.h> + +EFI_MM_SYSTEM_TABLE *gMmst = 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 = (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/PiSmmCoreMmServicesTableLib.inf b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.inf new file mode 100644 index 000000000000..06bb455b1777 --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.inf @@ -0,0 +1,32 @@ +## @file +# SMM Core MM Services Table Library. +# +# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be 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 IMPLIED. +# +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = PiSmmCoreMmServicesTableLib + MODULE_UNI_FILE = PiSmmCoreMmServicesTableLib.uni + FILE_GUID = 9E32CD7E-DB34-42B5-B5FA-77DD98633F47 + MODULE_TYPE = SMM_CORE + VERSION_STRING = 1.0 + LIBRARY_CLASS = MmServicesTableLib|SMM_CORE + PI_SPECIFICATION_VERSION = 0x0001000A + CONSTRUCTOR = SmmCoreMmServicesTableLibConstructor + +[Sources] + PiSmmCoreMmServicesTableLib.c + +[Packages] + MdePkg/MdePkg.dec + diff --git a/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.uni b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.uni new file mode 100644 index 000000000000..dbf7ce93731e --- /dev/null +++ b/MdeModulePkg/Library/PiSmmCoreMmServicesTableLib/PiSmmCoreMmServicesTableLib.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.<BR> +// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the BSD License +// which accompanies this distribution. The full text of the license may be 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 IMPLIED. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "SMM Core MM Services Table Library" + +#string STR_MODULE_DESCRIPTION #language en-US "SMM Core MM Services Table Library." + -- 2.18.0.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

