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: "Zeng, Star" <[email protected]>
Cc: "Tian, Feng" <[email protected]>
Cc: "Laszlo Ersek" <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Zeng, Star" <[email protected]>
Reviewed-by: "Tian, Feng" <[email protected]>
---
 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 a2f0325..9c70b9d 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 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2016, 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
@@ -237,13 +237,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;
@@ -264,6 +266,21 @@ typedef struct {
 
 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;
   PHYSICAL_ADDRESS                  ImageBuffer;
   UINT64                            NumberOfPage;
-- 
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to