From b5cc527ea9ae80224482325ddf404b151f5c2962 Mon Sep 17 00:00:00 2001 From: jyao1 Date: Fri, 5 Mar 2010 03:52:12 +0000 Subject: Add SmmCore SmmServicesTable library. This library should be used and only used by SmmCore, (compare with SmmServicesTable Lib is used and only used by SmmDriver) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10202 6f19259b-4bc3-4df7-8a09-765794883524 --- .../SmmCoreSmmServicesTableLib.c | 40 ++++++++++++++++++++++ .../SmmCoreSmmServicesTableLib.inf | 37 ++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.c create mode 100644 MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.inf (limited to 'MdePkg/Library') diff --git a/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.c b/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.c new file mode 100644 index 0000000000..00b7cc6e40 --- /dev/null +++ b/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.c @@ -0,0 +1,40 @@ +/** @file + SMM Core SMM Services Table Library. + + Copyright (c) 2010, Intel Corporation
+ All rights reserved. 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 +#include +#include + +EFI_SMM_SYSTEM_TABLE2 *gSmst = NULL; +extern EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst; + +/** + The constructor function caches the pointer of SMM 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 +SmmCoreSmmServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + gSmst = &gSmmCoreSmst; + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.inf b/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.inf new file mode 100644 index 0000000000..15b6c65403 --- /dev/null +++ b/MdePkg/Library/SmmCoreSmmServicesTableLib/SmmCoreSmmServicesTableLib.inf @@ -0,0 +1,37 @@ +## @file +# SMM Core SMM Services Table Library. +# +# Copyright (c) 2010, Intel Corporation. +# +# All rights reserved. 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 = SmmCoreSmmServicesTableLib + FILE_GUID = C427146A-2EF2-4af9-A85A-E09EA65EE47D + MODULE_TYPE = DXE_SMM_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = SmmServicesTableLib|SMM_CORE + PI_SPECIFICATION_VERSION = 0x0001000A + CONSTRUCTOR = SmmCoreSmmServicesTableLibConstructor + +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + SmmCoreSmmServicesTableLib.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib -- cgit v1.2.3