Revision: 18496
          http://sourceforge.net/p/edk2/code/18496
Author:   hwu1225
Date:     2015-09-17 05:33:07 +0000 (Thu, 17 Sep 2015)
Log Message:
-----------
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.

(Sync patch r18495 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18495

Modified Paths:
--------------
    branches/UDK2015/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c

Modified: 
branches/UDK2015/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
===================================================================
--- branches/UDK2015/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c   
2015-09-17 04:59:59 UTC (rev 18495)
+++ branches/UDK2015/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c   
2015-09-17 05:33:07 UTC (rev 18496)
@@ -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 @@
   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 @@
   Status = SystemTable->BootServices->LocateProtocol (
                                         &gEfiSmmBase2ProtocolGuid,
                                         NULL,
-                                        (VOID **)&mInternalSmmBase2
+                                        (VOID **)&InternalSmmBase2
                                         );
   ASSERT_EFI_ERROR (Status);
-  ASSERT (mInternalSmmBase2 != NULL);
+  ASSERT (InternalSmmBase2 != 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;
-  }
-
-  //
   // 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 @@
   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;
 }


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to