From 495797c5578e88cd1a769e918502cf426f08d6b0 Mon Sep 17 00:00:00 2001 From: rsun3 Date: Tue, 16 Aug 2011 02:58:20 +0000 Subject: 1. Add two performance measurement points for SMM performance measurement; 2. Introduce SmmCorePlatformHookLib library class defining two platform hook points. Update PI Smm Core to call the hook points before and after invoking registered SMI handlers. A NULL instance of this library class is implemented. Note that after this check in, DSC files consuming the PiSmmCore.inf need to be updated to add a library instance for SmmCorePlatformHookLib library class. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12140 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/PiSmmCore/PiSmmCore.c | 16 +++++++++++++++- MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 4 +++- MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 6 ++++-- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'MdeModulePkg/Core') diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c index 75337f6b1c..a5e4b6e980 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c @@ -1,7 +1,7 @@ /** @file SMM Core Main Entry Point - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2011, 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 @@ -246,11 +246,18 @@ SmmEntryPoint ( EFI_STATUS Status; EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader; + PERF_START (NULL, "SMM", NULL, 0) ; + // // Update SMST using the context // CopyMem (&gSmmCoreSmst.SmmStartupThisAp, SmmEntryContext, sizeof (EFI_SMM_ENTRY_CONTEXT)); + // + // Call platform hook before Smm Dispatch + // + PlatformHookBeforeSmmDispatch (); + // // If a legacy boot has occured, then make sure gSmmCorePrivate is not accessed // @@ -297,11 +304,18 @@ SmmEntryPoint ( // SmiManage (NULL, NULL, NULL, NULL); } + + // + // Call platform hook after Smm Dispatch + // + PlatformHookAfterSmmDispatch (); // // Clear the InSmm flag as we are going to leave SMM // gSmmCorePrivate->InSmm = FALSE; + + PERF_END (NULL, "SMM", NULL, 0) ; } /** diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h index 5cd1237056..19af786612 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h @@ -2,7 +2,7 @@ The internal header file includes the common header files, defines internal structure and functions used by SmmCore module. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2011, 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 @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include "PiSmmCorePrivateData.h" diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf index 96886e1e25..7687a618f7 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf @@ -1,7 +1,7 @@ ## @file # This module provide an SMM CIS compliant implementation of SMM Core. # -# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2011, 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 @@ -54,7 +54,9 @@ UefiBootServicesTableLib MemoryAllocationLib PcdLib - + SmmCorePlatformHookLib + PerformanceLib + [Protocols] gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_PRODUCED -- cgit v1.2.3