]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
Puts SMM variable common definitions in SmmVariableCommon.h.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / VariableSmmRuntimeDxe.c
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