]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Puts SMM variable common definitions in SmmVariableCommon.h.
authorgdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 28 Feb 2011 07:31:45 +0000 (07:31 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 28 Feb 2011 07:31:45 +0000 (07:31 +0000)
Fixed a bug that SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY was misused as SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11339 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Guid/SmmVariableCommon.h [new file with mode: 0644]
MdeModulePkg/Include/Guid/VariableFormat.h
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmCommon.h [deleted file]
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

diff --git a/MdeModulePkg/Include/Guid/SmmVariableCommon.h b/MdeModulePkg/Include/Guid/SmmVariableCommon.h
new file mode 100644 (file)
index 0000000..c7fde00
--- /dev/null
@@ -0,0 +1,104 @@
+/** @file\r
+  The file defined some common structures used for communicating between SMM variable module and SMM variable wrapper module.\r
+\r
+Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                            \r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _SMM_VARIABLE_COMMON_H_\r
+#define _SMM_VARIABLE_COMMON_H_\r
+\r
+#define EFI_SMM_VARIABLE_WRITE_GUID \\r
+  { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 } }\r
+\r
+extern EFI_GUID gSmmVariableWriteGuid;\r
+\r
+//\r
+// This structure is used for SMM variable. the collected statistics data is saved in SMRAM. It can be got from \r
+// SMI handler. The communication buffer should be: \r
+// EFI_SMM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.\r
+//\r
+typedef struct {\r
+  UINTN       Function;\r
+  EFI_STATUS  ReturnStatus;\r
+  UINT8       Data[1];\r
+} SMM_VARIABLE_COMMUNICATE_HEADER;\r
+\r
+//\r
+// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
+//\r
+#define SMM_VARIABLE_FUNCTION_GET_VARIABLE            1\r
+//\r
+// The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME.\r
+// \r
+#define SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME  2\r
+//\r
+// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
+// \r
+#define SMM_VARIABLE_FUNCTION_SET_VARIABLE            3\r
+//\r
+// The payload for this function is SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.\r
+// \r
+#define SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO     4\r
+//\r
+// It is a notify event, no extra payload for this function.\r
+// \r
+#define SMM_VARIABLE_FUNCTION_READY_TO_BOOT           5\r
+//\r
+// It is a notify event, no extra payload for this function.\r
+// \r
+#define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE       6\r
+//\r
+// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_SMM_COMMUNICATE_HEADER \r
+// is gEfiSmmVariableProtocolGuid.\r
+//\r
+#define SMM_VARIABLE_FUNCTION_GET_STATISTICS          7\r
+\r
+///\r
+/// Size of SMM communicate header, without including the payload.\r
+///\r
+#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))\r
+\r
+///\r
+/// Size of SMM variable communicate header, without including the payload.\r
+///\r
+#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))\r
+\r
+///\r
+/// This structure is used to communicate with SMI handler by SetVariable and GetVariable.\r
+///\r
+typedef struct {\r
+  EFI_GUID    Guid;\r
+  UINTN       DataSize;\r
+  UINTN       NameSize;\r
+  UINT32      Attributes;  \r
+  CHAR16      Name[1];\r
+} SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE;\r
+\r
+///\r
+/// This structure is used to communicate with SMI handler by GetNextVariableName.\r
+///\r
+typedef struct {\r
+  EFI_GUID    Guid;\r
+  UINTN       NameSize;\r
+  CHAR16      Name[1];\r
+} SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME;\r
+\r
+///\r
+/// This structure is used to communicate with SMI handler by QueryVariableInfo.\r
+///\r
+typedef struct {\r
+  UINT64          MaximumVariableStorageSize;\r
+  UINT64          RemainingVariableStorageSize;\r
+  UINT64          MaximumVariableSize;\r
+  UINT32          Attributes; \r
+} SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO;\r
+\r
+#endif // _SMM_VARIABLE_COMMON_H_
\ No newline at end of file
index 0db3a22f34ff4b409d9cd9be5ad09237d87a15c7..a7902f16828eb796c2ddcd3ee51403ff00a20f10 100644 (file)
@@ -2,7 +2,7 @@
   The variable data structures are related to EDK II-specific implementation of UEFI variables.\r
   VariableFormat.h defines variable data headers and variable storage region headers.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -157,90 +157,4 @@ struct _VARIABLE_INFO_ENTRY {
   BOOLEAN             Volatile;    ///< TRUE if volatile, FALSE if non-volatile.\r
 };\r
 \r
-//\r
-// This structure is used for SMM variable. the collected statistics data is saved in SMRAM. It can be got from \r
-// SMI handler. The communication buffer should be: \r
-// EFI_SMM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.\r
-//\r
-typedef struct {\r
-  UINTN       Function;\r
-  EFI_STATUS  ReturnStatus;\r
-  UINT8       Data[1];\r
-} SMM_VARIABLE_COMMUNICATE_HEADER;\r
-\r
-//\r
-// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
-//\r
-#define SMM_VARIABLE_FUNCTION_GET_VARIABLE            1\r
-//\r
-// The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME.\r
-// \r
-#define SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME  2\r
-//\r
-// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
-// \r
-#define SMM_VARIABLE_FUNCTION_SET_VARIABLE            3\r
-//\r
-// The payload for this function is SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.\r
-// \r
-#define SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO     4\r
-//\r
-// It is a notify event, no extra payload for this function.\r
-// \r
-#define SMM_VARIABLE_FUNCTION_READY_TO_BOOT           5\r
-//\r
-// It is a notify event, no extra payload for this function.\r
-// \r
-#define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE       6\r
-//\r
-// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_SMM_COMMUNICATE_HEADER \r
-// is gEfiSmmVariableProtocolGuid.\r
-//\r
-#define SMM_VARIABLE_FUNCTION_GET_STATISTICS          7\r
-\r
-///\r
-/// Size of SMM communicate header, without including the payload.\r
-///\r
-#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))\r
-\r
-///\r
-/// Size of SMM variable communicate header, without including the payload.\r
-///\r
-#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))\r
-\r
-///\r
-/// This structure is used to communicate with SMI handler by SetVariable and GetVariable.\r
-///\r
-typedef struct {\r
-  EFI_GUID    Guid;\r
-  UINTN       DataSize;\r
-  UINTN       NameSize;\r
-  UINT32      Attributes;  \r
-  CHAR16      Name[1];\r
-} SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE;\r
-\r
-///\r
-/// This structure is used to communicate with SMI handler by GetNextVariableName.\r
-///\r
-typedef struct {\r
-  EFI_GUID    Guid;\r
-  UINTN       NameSize;\r
-  CHAR16      Name[1];\r
-} SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME;\r
-\r
-///\r
-/// This structure is used to communicate with SMI handler by QueryVariableInfo.\r
-///\r
-typedef struct {\r
-  UINT64          MaximumVariableStorageSize;\r
-  UINT64          RemainingVariableStorageSize;\r
-  UINT64          MaximumVariableSize;\r
-  UINT32          Attributes; \r
-} SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO;\r
-\r
-///\r
-/// This structure is used to communicate with SMI handler to get variable statistics information.\r
-///\r
-typedef VARIABLE_INFO_ENTRY  SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY;\r
-\r
 #endif // _EFI_VARIABLE_H_\r
index 5bb55ebf382d60a5516ea8c11e8e4973e61373d3..ae0d6527befc7dc153979abacaa4d96ee54616ac 100644 (file)
   #  Include/Guid/VariableFormat.h\r
   gEfiVariableGuid           = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}\r
 \r
+  ## Guid is defined for SMM variable module to notify SMM variable wrapper module when variable write service was ready.\r
+  #  Include/Guid/SmmVariableCommon.h\r
+  gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}\r
+  \r
   ## Performance protocol guid that also acts as the performance HOB guid and performance variable GUID\r
   #  Include/Guid/Performance.h\r
   gPerformanceProtocolGuid       = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 }}\r
index 75f5cad469abdd0d4cc8941252ff78eda72539cd..8d949c396513e147c29de21ad75e0cc72e8564f7 100644 (file)
@@ -4,7 +4,7 @@
   implements  an SMI handler to communicate with the DXE runtime driver \r
   to provide variable services.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2011, 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
@@ -14,18 +14,20 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.  \r
 \r
 **/\r
+#include <Protocol/SmmVariable.h>\r
+#include <Protocol/SmmFirmwareVolumeBlock.h>\r
 #include <Protocol/SmmFaultTolerantWrite.h>\r
 #include <Library/SmmServicesTableLib.h>\r
 \r
+#include <Guid/VariableFormat.h>\r
+#include <Guid/SmmVariableCommon.h>\r
 #include "Variable.h"\r
-#include "VariableSmmCommon.h"\r
 \r
-extern SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY  *gVariableInfo;\r
+extern VARIABLE_INFO_ENTRY                           *gVariableInfo;\r
 EFI_HANDLE                                           mSmmVariableHandle      = NULL;\r
 EFI_HANDLE                                           mVariableHandle         = NULL;\r
 BOOLEAN                                              mAtRuntime              = FALSE;\r
 EFI_GUID                                             mZeroGuid               = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};\r
-EFI_GUID                                             mSmmVariableWriteGuid   = EFI_SMM_VARIABLE_WRITE_GUID;\r
   \r
 EFI_SMM_VARIABLE_PROTOCOL      gSmmVariable = {\r
   VariableServiceGetVariable,\r
@@ -254,11 +256,11 @@ GetFvbCountAndBuffer (
 **/\r
 EFI_STATUS\r
 SmmVariableGetStatistics (\r
-  IN OUT SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY  *InfoEntry,\r
+  IN OUT VARIABLE_INFO_ENTRY                           *InfoEntry,\r
   IN OUT UINTN                                         *InfoSize\r
   )\r
 {\r
-  SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY         *VariableInfo;\r
+  VARIABLE_INFO_ENTRY                                  *VariableInfo;\r
   UINTN                                                NameLength;\r
   UINTN                                                StatisticsInfoSize;\r
   CHAR16                                               *InfoName;\r
@@ -269,8 +271,8 @@ SmmVariableGetStatistics (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  StatisticsInfoSize = sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY) + StrSize (VariableInfo->Name);\r
-  if (*InfoSize < sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY)) {\r
+  StatisticsInfoSize = sizeof (VARIABLE_INFO_ENTRY) + StrSize (VariableInfo->Name);\r
+  if (*InfoSize < sizeof (VARIABLE_INFO_ENTRY)) {\r
     *InfoSize = StatisticsInfoSize;\r
     return EFI_BUFFER_TOO_SMALL;\r
   }\r
@@ -280,7 +282,7 @@ SmmVariableGetStatistics (
     //\r
     // Return the first variable info\r
     //\r
-    CopyMem (InfoEntry, VariableInfo, sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY));\r
+    CopyMem (InfoEntry, VariableInfo, sizeof (VARIABLE_INFO_ENTRY));\r
     CopyMem (InfoName, VariableInfo->Name, StrSize (VariableInfo->Name));\r
     *InfoSize = StatisticsInfoSize;\r
     return EFI_SUCCESS;\r
@@ -313,13 +315,13 @@ SmmVariableGetStatistics (
   //\r
   // Output the new variable info\r
   //\r
-  StatisticsInfoSize = sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY) + StrSize (VariableInfo->Name);\r
+  StatisticsInfoSize = sizeof (VARIABLE_INFO_ENTRY) + StrSize (VariableInfo->Name);\r
   if (*InfoSize < StatisticsInfoSize) {\r
     *InfoSize = StatisticsInfoSize;\r
     return EFI_BUFFER_TOO_SMALL;\r
   }\r
 \r
-  CopyMem (InfoEntry, VariableInfo, sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY));\r
+  CopyMem (InfoEntry, VariableInfo, sizeof (VARIABLE_INFO_ENTRY));\r
   CopyMem (InfoName, VariableInfo->Name, StrSize (VariableInfo->Name));\r
   *InfoSize = StatisticsInfoSize;\r
   \r
@@ -361,7 +363,7 @@ SmmVariableHandler (
   SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE         *SmmVariableHeader;\r
   SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME  *GetNextVariableName;\r
   SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO     *QueryVariableInfo;\r
-  SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY     *VariableInfo;\r
+  VARIABLE_INFO_ENTRY                              *VariableInfo;\r
   UINTN                                            InfoSize;\r
 \r
   ASSERT (CommBuffer != NULL);\r
@@ -420,7 +422,7 @@ SmmVariableHandler (
       break;\r
 \r
     case SMM_VARIABLE_FUNCTION_GET_STATISTICS:\r
-      VariableInfo = (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY *) SmmVariableFunctionHeader->Data;\r
+      VariableInfo = (VARIABLE_INFO_ENTRY *) SmmVariableFunctionHeader->Data;\r
       InfoSize = *CommBufferSize - OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data);\r
       Status = SmmVariableGetStatistics (VariableInfo, &InfoSize);\r
       *CommBufferSize = InfoSize + OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data);\r
@@ -498,7 +500,7 @@ SmmFtwNotificationEvent (
   //\r
   Status = gBS->InstallProtocolInterface (\r
                   &mSmmVariableHandle,\r
-                  &mSmmVariableWriteGuid,\r
+                  &gSmmVariableWriteGuid,\r
                   EFI_NATIVE_INTERFACE,\r
                   NULL\r
                   );\r
@@ -511,7 +513,7 @@ SmmFtwNotificationEvent (
 /**\r
   Variable Driver main entry point. The Variable driver places the 4 EFI\r
   runtime services in the EFI System Table and installs arch protocols \r
-  for variable read and write services being availible. It also registers\r
+  for variable read and write services being available. It also registers\r
   a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
 \r
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
index adaa13d9364265127070286a53f8b6f5f01043e1..20481768a6f80ac79129b451a9e8c467ac86a777 100644 (file)
@@ -8,7 +8,7 @@
 #  This module should be used with SMM Runtime DXE module together. The 
 #  SMM Runtime DXE module would install variable arch protocol and variable 
 #  write arch protocol based on SMM variable module.
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2011, 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
@@ -41,7 +41,6 @@
   Variable.c
   VariableSmm.c
   Variable.h
-  VariableSmmCommon.h
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -66,6 +65,7 @@
 [Guids]
   gEfiVariableGuid                              ## PRODUCES ## Configuration Table Guid 
   gEfiGlobalVariableGuid                        ## PRODUCES ## Variable Guid
+  gSmmVariableWriteGuid                         ## PRODUCES ## SMM Variable Write Guid 
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmCommon.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmCommon.h
deleted file mode 100644 (file)
index 06541ec..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file\r
-\r
-  The internal header file includes the common header files shared \r
-  by VariableSmm module and VariableSmmRuntimeDxe module.\r
-\r
-Copyright (c) 2010, 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
-http://opensource.org/licenses/bsd-license.php                                            \r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.  \r
-\r
-**/\r
-\r
-#ifndef _VARIABLE_SMM_COMMON_H_\r
-#define _VARIABLE_SMM_COMMON_H_\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Protocol/SmmVariable.h>\r
-#include <Protocol/SmmFirmwareVolumeBlock.h>\r
-#include <Guid/VariableFormat.h>\r
-\r
-#define EFI_SMM_VARIABLE_WRITE_GUID \\r
-  { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 } }\r
-\r
-///\r
-/// Size of SMM communicate header, without including the payload.\r
-///\r
-#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))\r
-\r
-///\r
-/// Size of SMM variable communicate header, without including the payload.\r
-///\r
-#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))\r
-\r
-\r
-#endif\r
index d7fdcc86554c99c66df25443d478312aa4b64976..982eea0f145ae40ef33166936edff14335e33d89 100644 (file)
@@ -4,7 +4,7 @@
   and volatile storage space and install variable architecture protocol\r
   based on SMM variable module.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2011, 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
@@ -14,10 +14,11 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
 \r
 **/\r
-\r
+#include <PiDxe.h>\r
 #include <Protocol/VariableWrite.h>\r
 #include <Protocol/Variable.h>\r
 #include <Protocol/SmmCommunication.h>\r
+#include <Protocol/SmmVariable.h>\r
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
@@ -31,7 +32,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseLib.h>\r
 \r
 #include <Guid/EventGroup.h>\r
-#include "VariableSmmCommon.h"\r
+#include <Guid/VariableFormat.h>\r
+#include <Guid/SmmVariableCommon.h>\r
 \r
 EFI_HANDLE                       mHandle                    = NULL; \r
 EFI_SMM_VARIABLE_PROTOCOL       *mSmmVariable               = NULL;\r
@@ -39,7 +41,6 @@ EFI_EVENT                        mVirtualAddressChangeEvent = NULL;
 EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication          = NULL;\r
 UINT8                           *mVariableBuffer            = NULL;\r
 UINT8                           *mVariableBufferPhysical    = NULL;\r
-EFI_GUID                         mSmmVariableWriteGuid      = EFI_SMM_VARIABLE_WRITE_GUID;\r
 UINTN                            mVariableBufferSize;\r
 \r
 \r
@@ -367,7 +368,7 @@ RuntimeServiceQueryVariableInfo (
   // Init the communicate buffer. The buffer data size is:\r
   // SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + PayloadSize;\r
   //\r
-  PayloadSize = sizeof (SMM_VARIABLE_COMMUNICATE_VARIABLE_INFO_ENTRY);\r
+  PayloadSize = sizeof (SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO);\r
   Status = InitCommunicateBuffer ((VOID **)&SmmQueryVariableInfo, PayloadSize, SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -550,7 +551,7 @@ SmmVariableWriteReady (
   //\r
   // Check whether the protocol is installed or not.\r
   //\r
-  Status = gBS->LocateProtocol (&mSmmVariableWriteGuid, NULL, (VOID **) &ProtocolOps);\r
+  Status = gBS->LocateProtocol (&gSmmVariableWriteGuid, NULL, (VOID **) &ProtocolOps);\r
   if (EFI_ERROR (Status)) {\r
     return;\r
   }\r
@@ -568,7 +569,7 @@ SmmVariableWriteReady (
 /**\r
   Variable Driver main entry point. The Variable driver places the 4 EFI\r
   runtime services in the EFI System Table and installs arch protocols \r
-  for variable read and write services being availible. It also registers\r
+  for variable read and write services being available. It also registers\r
   a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
 \r
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
@@ -604,7 +605,7 @@ VariableSmmRuntimeInitialize (
   // Smm Non-Volatile variable write service is ready\r
   //\r
   EfiCreateProtocolNotifyEvent (\r
-    &mSmmVariableWriteGuid, \r
+    &gSmmVariableWriteGuid, \r
     TPL_CALLBACK, \r
     SmmVariableWriteReady, \r
     NULL, \r
index f2606066eb9f3d1d434a62b68592c27293eafeb7..05dd49d368c40d0791517c709419c5e474162704 100644 (file)
@@ -4,7 +4,7 @@
 #  This module is the Runtime DXE part correspond to SMM variable module. It \r
 #  installs variable arch protocol and variable write arch protocol and works \r
 #  with SMM variable module together. \r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -34,7 +34,6 @@
 \r
 [Sources]\r
   VariableSmmRuntimeDxe.c\r
-  VariableSmmCommon.h\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
@@ -58,6 +57,7 @@
 \r
 [Guids]\r
   gEfiEventVirtualAddressChangeGuid             ## PRODUCES ## Event\r
+  gSmmVariableWriteGuid\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize\r