MdeModulePkg-MemoryProfile(1): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET...
authorStar Zeng <star.zeng@intel.com>
Fri, 22 Apr 2016 07:13:47 +0000 (15:13 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Fri, 29 Apr 2016 04:49:11 +0000 (12:49 +0800)
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 <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Include/Guid/MemoryProfile.h

index a2f03256c317715e144bc2f414cc3083f728810b..9c70b9df3924b81c3cc8a78415d14de9000cdf69 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Memory profile data structure.\r
 \r
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -237,13 +237,15 @@ struct _EDKII_MEMORY_PROFILE_PROTOCOL {
 //\r
 // SMRAM profile command\r
 //\r
-#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO         0x1\r
-#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA         0x2\r
+#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO           0x1\r
+#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA           0x2\r
 //\r
 // Below 2 commands are now used by ECP only and only valid before SmmReadyToLock\r
 //\r
-#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE           0x3\r
-#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE         0x4\r
+#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE             0x3\r
+#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE           0x4\r
+\r
+#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5\r
 \r
 typedef struct {\r
   UINT32                            Command;\r
@@ -262,6 +264,21 @@ typedef struct {
   PHYSICAL_ADDRESS                  ProfileBuffer;\r
 } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA;\r
 \r
+typedef struct {\r
+  SMRAM_PROFILE_PARAMETER_HEADER    Header;\r
+  //\r
+  // On input, profile buffer size.\r
+  // On output, actual profile data size copied.\r
+  //\r
+  UINT64                            ProfileSize;\r
+  PHYSICAL_ADDRESS                  ProfileBuffer;\r
+  //\r
+  // On input, profile buffer offset to copy.\r
+  // On output, next time profile buffer offset to copy.\r
+  //\r
+  UINT64                            ProfileOffset;\r
+} SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET;\r
+\r
 typedef struct {\r
   SMRAM_PROFILE_PARAMETER_HEADER    Header;\r
   EFI_GUID                          FileName;\r