From c5621d9d57b5d645ac712c24e65570bedd3f9cc3 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Fri, 22 Apr 2016 15:13:47 +0800 Subject: MdeModulePkg-MemoryProfile(1): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET definition. This patch enhance SMM memory profile SMM communication by using fixed SMM communication buffer. A new command SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET is added, because we need to support get partial ProfileData to fixed SMM communication buffer. If profile data is bigger than fixed SMM communication buffer, the DXE agent need to call SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET multiple times to get all data out. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Star Zeng Cc: Feng Tian Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Feng Tian (cherry picked from commit 73e0de62826dffe8f9e32d6d0d18b54a8a5d3f38) --- MdeModulePkg/Include/Guid/MemoryProfile.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Include/Guid/MemoryProfile.h b/MdeModulePkg/Include/Guid/MemoryProfile.h index 3c1e5e79ca..4e90a05098 100644 --- a/MdeModulePkg/Include/Guid/MemoryProfile.h +++ b/MdeModulePkg/Include/Guid/MemoryProfile.h @@ -1,7 +1,7 @@ /** @file Memory profile data structure. - Copyright (c) 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2016, 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 @@ -236,13 +236,15 @@ struct _EDKII_MEMORY_PROFILE_PROTOCOL { // // SMRAM profile command // -#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO 0x1 -#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA 0x2 +#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO 0x1 +#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA 0x2 // // Below 2 commands are now used by ECP only and only valid before SmmReadyToLock // -#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE 0x3 -#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE 0x4 +#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE 0x3 +#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE 0x4 + +#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5 typedef struct { UINT32 Command; @@ -261,6 +263,21 @@ typedef struct { PHYSICAL_ADDRESS ProfileBuffer; } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA; +typedef struct { + SMRAM_PROFILE_PARAMETER_HEADER Header; + // + // On input, profile buffer size. + // On output, actual profile data size copied. + // + UINT64 ProfileSize; + PHYSICAL_ADDRESS ProfileBuffer; + // + // On input, profile buffer offset to copy. + // On output, next time profile buffer offset to copy. + // + UINT64 ProfileOffset; +} SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET; + typedef struct { SMRAM_PROFILE_PARAMETER_HEADER Header; EFI_GUID FileName; -- cgit