summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/SmmServicesTableLib
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-09-17 04:59:59 +0000
committervanjeff <vanjeff@Edk2>2015-09-17 04:59:59 +0000
commit4e904348e323ae7b7d49c9f1716482d37a8f8fa4 (patch)
tree06cd3bb7e54b6cdc39f09e4ffe9de3d016a5407d /MdePkg/Library/SmmServicesTableLib
parentfb977e33950abd0e1ac50f17c90b05f0593fd4d6 (diff)
downloadedk2-4e904348e323ae7b7d49c9f1716482d37a8f8fa4.tar.gz
edk2-4e904348e323ae7b7d49c9f1716482d37a8f8fa4.tar.bz2
edk2-4e904348e323ae7b7d49c9f1716482d37a8f8fa4.zip
MdePkg/SmmServicesTableLib: Return TRUE in InSmm ()
SmmServicesTableLib instance only supports DXE_SMM_DRIVER type drivers that will be loaded into SMM range. InSmm() could return TRUE directly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18495 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/SmmServicesTableLib')
-rw-r--r--MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c b/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
index 23a85a0c68..81e5ce8e3f 100644
--- a/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
+++ b/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
@@ -1,7 +1,7 @@
/** @file
SMM Services Table Library.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, 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
@@ -18,7 +18,6 @@
#include <Library/DebugLib.h>
EFI_SMM_SYSTEM_TABLE2 *gSmst = NULL;
-EFI_SMM_BASE2_PROTOCOL *mInternalSmmBase2 = NULL;
/**
The constructor function caches the pointer of SMM Services Table.
@@ -36,8 +35,10 @@ SmmServicesTableLibConstructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ EFI_SMM_BASE2_PROTOCOL *InternalSmmBase2;
+ InternalSmmBase2 = NULL;
//
// Retrieve SMM Base2 Protocol, Do not use gBS from UefiBootServicesTableLib on purpose
// to prevent inclusion of gBS, gST, and gImageHandle from SMM Drivers unless the
@@ -46,25 +47,15 @@ SmmServicesTableLibConstructor (
Status = SystemTable->BootServices->LocateProtocol (
&gEfiSmmBase2ProtocolGuid,
NULL,
- (VOID **)&mInternalSmmBase2
+ (VOID **)&InternalSmmBase2
);
ASSERT_EFI_ERROR (Status);
- ASSERT (mInternalSmmBase2 != NULL);
-
- //
- // Check to see if we are already in SMM
- //
- if (!InSmm ()) {
- //
- // We are not in SMM, so SMST is not needed
- //
- return EFI_SUCCESS;
- }
+ ASSERT (InternalSmmBase2 != NULL);
//
// We are in SMM, retrieve the pointer to SMM System Table
//
- mInternalSmmBase2->GetSmstLocation (mInternalSmmBase2, &gSmst);
+ InternalSmmBase2->GetSmstLocation (InternalSmmBase2, &gSmst);
ASSERT (gSmst != NULL);
return EFI_SUCCESS;
@@ -87,11 +78,8 @@ InSmm (
VOID
)
{
- BOOLEAN InSmm;
-
//
- // Check to see if we are already in SMM
+ // We are already in SMM
//
- mInternalSmmBase2->InSmm (mInternalSmmBase2, &InSmm);
- return InSmm;
+ return TRUE;
}