]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg PiDxeS3BootScriptLib: Use a specific name for mSmst
authorStar Zeng <star.zeng@intel.com>
Fri, 24 Jun 2016 04:34:59 +0000 (12:34 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 27 Jun 2016 03:11:09 +0000 (11:11 +0800)
When a driver also uses a same name, there will be a link error:
one or more multiply defined symbols found.
Use a specific name for mSmst to avoid the link error.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c

index 0ff73211acc44a7de6aba29bc45485bca3a1b761..0459bae4c60adc5c666919384508a7a772756a74 100644 (file)
@@ -130,7 +130,7 @@ VOID                             *mRegistrationSmmLegacyBoot = NULL;
 VOID                             *mRegistrationSmmReadyToLock = NULL;\r
 BOOLEAN                          mS3BootScriptTableAllocated = FALSE;\r
 BOOLEAN                          mS3BootScriptTableSmmAllocated = FALSE;\r
-EFI_SMM_SYSTEM_TABLE2            *mSmst = NULL;\r
+EFI_SMM_SYSTEM_TABLE2            *mBootScriptSmst = NULL;\r
 \r
 /**\r
   This is an internal function to add a terminate node the entry, recalculate the table \r
@@ -493,7 +493,7 @@ S3BootScriptLibInitialize (
   //\r
   // Good, we are in SMM\r
   //\r
-  Status = SmmBase2->GetSmstLocation (SmmBase2, &mSmst);\r
+  Status = SmmBase2->GetSmstLocation (SmmBase2, &mBootScriptSmst);\r
   if (EFI_ERROR (Status)) {\r
     return RETURN_SUCCESS;\r
   }\r
@@ -503,11 +503,11 @@ S3BootScriptLibInitialize (
   // The Boot script private data in SMM is not be initialized. create it\r
   //\r
   if (S3TableSmmPtr == 0) {\r
-    Status = mSmst->SmmAllocatePool (\r
-                     EfiRuntimeServicesData,\r
-                     sizeof(SCRIPT_TABLE_PRIVATE_DATA),\r
-                     (VOID **) &S3TableSmmPtr\r
-                     );\r
+    Status = mBootScriptSmst->SmmAllocatePool (\r
+                                EfiRuntimeServicesData,\r
+                                sizeof(SCRIPT_TABLE_PRIVATE_DATA),\r
+                                (VOID **) &S3TableSmmPtr\r
+                                );\r
     ASSERT_EFI_ERROR (Status);\r
     mS3BootScriptTableSmmAllocated = TRUE;\r
 \r
@@ -518,18 +518,18 @@ S3BootScriptLibInitialize (
     //\r
     // Register SmmExitBootServices and SmmLegacyBoot notification.\r
     //\r
-    Status = mSmst->SmmRegisterProtocolNotify (\r
-                     &gEdkiiSmmExitBootServicesProtocolGuid,\r
-                     S3BootScriptSmmAtRuntimeCallBack,\r
-                     &mRegistrationSmmExitBootServices\r
-                     );\r
+    Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                                &gEdkiiSmmExitBootServicesProtocolGuid,\r
+                                S3BootScriptSmmAtRuntimeCallBack,\r
+                                &mRegistrationSmmExitBootServices\r
+                                );\r
     ASSERT_EFI_ERROR (Status);\r
 \r
-    Status = mSmst->SmmRegisterProtocolNotify (\r
-                     &gEdkiiSmmLegacyBootProtocolGuid,\r
-                     S3BootScriptSmmAtRuntimeCallBack,\r
-                     &mRegistrationSmmLegacyBoot\r
-                     );\r
+    Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                                &gEdkiiSmmLegacyBootProtocolGuid,\r
+                                S3BootScriptSmmAtRuntimeCallBack,\r
+                                &mRegistrationSmmLegacyBoot\r
+                                );\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
   mS3BootScriptTableSmmPtr = S3TableSmmPtr;\r
@@ -537,11 +537,11 @@ S3BootScriptLibInitialize (
   //\r
   // Register SmmReadyToLock notification.\r
   //\r
-  Status = mSmst->SmmRegisterProtocolNotify (\r
-                   &gEfiSmmReadyToLockProtocolGuid,\r
-                   S3BootScriptSmmEventCallBack,\r
-                   &mRegistrationSmmReadyToLock\r
-                   );\r
+  Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                              &gEfiSmmReadyToLockProtocolGuid,\r
+                              S3BootScriptSmmEventCallBack,\r
+                              &mRegistrationSmmReadyToLock\r
+                              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return RETURN_SUCCESS;\r
@@ -579,38 +579,38 @@ S3BootScriptLibDeinitialize (
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
-  if (mSmst != NULL) {\r
+  if (mBootScriptSmst != NULL) {\r
     if (mRegistrationSmmExitBootServices != NULL) {\r
       //\r
       // Unregister SmmExitBootServices notification.\r
       //\r
-      Status = mSmst->SmmRegisterProtocolNotify (\r
-                       &gEdkiiSmmExitBootServicesProtocolGuid,\r
-                       NULL,\r
-                       &mRegistrationSmmExitBootServices\r
-                       );\r
+      Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                                  &gEdkiiSmmExitBootServicesProtocolGuid,\r
+                                  NULL,\r
+                                  &mRegistrationSmmExitBootServices\r
+                                  );\r
       ASSERT_EFI_ERROR (Status);\r
     }\r
     if (mRegistrationSmmLegacyBoot != NULL) {\r
       //\r
       // Unregister SmmLegacyBoot notification.\r
       //\r
-      Status = mSmst->SmmRegisterProtocolNotify (\r
-                       &gEdkiiSmmLegacyBootProtocolGuid,\r
-                       NULL,\r
-                       &mRegistrationSmmLegacyBoot\r
-                       );\r
+      Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                                  &gEdkiiSmmLegacyBootProtocolGuid,\r
+                                  NULL,\r
+                                  &mRegistrationSmmLegacyBoot\r
+                                  );\r
       ASSERT_EFI_ERROR (Status);\r
     }\r
     if (mRegistrationSmmReadyToLock != NULL) {\r
       //\r
       // Unregister SmmReadyToLock notification.\r
       //\r
-      Status = mSmst->SmmRegisterProtocolNotify (\r
-                       &gEfiSmmReadyToLockProtocolGuid,\r
-                       NULL,\r
-                       &mRegistrationSmmReadyToLock\r
-                       );\r
+      Status = mBootScriptSmst->SmmRegisterProtocolNotify (\r
+                                  &gEfiSmmReadyToLockProtocolGuid,\r
+                                  NULL,\r
+                                  &mRegistrationSmmReadyToLock\r
+                                  );\r
       ASSERT_EFI_ERROR (Status);\r
     }\r
   }\r
@@ -624,8 +624,8 @@ S3BootScriptLibDeinitialize (
     Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
-  if ((mSmst != NULL) && mS3BootScriptTableSmmAllocated) {\r
-    Status = mSmst->SmmFreePool (mS3BootScriptTableSmmPtr);\r
+  if ((mBootScriptSmst != NULL) && mS3BootScriptTableSmmAllocated) {\r
+    Status = mBootScriptSmst->SmmFreePool (mS3BootScriptTableSmmPtr);\r
     ASSERT_EFI_ERROR (Status);\r
     Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0);\r
     ASSERT_EFI_ERROR (Status);\r