MdeModulePkg PiDxeS3BootScriptLib: Use a specific name for mSmst
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>
This commit is contained in:
		@@ -130,7 +130,7 @@ VOID                             *mRegistrationSmmLegacyBoot = NULL;
 | 
				
			|||||||
VOID                             *mRegistrationSmmReadyToLock = NULL;
 | 
					VOID                             *mRegistrationSmmReadyToLock = NULL;
 | 
				
			||||||
BOOLEAN                          mS3BootScriptTableAllocated = FALSE;
 | 
					BOOLEAN                          mS3BootScriptTableAllocated = FALSE;
 | 
				
			||||||
BOOLEAN                          mS3BootScriptTableSmmAllocated = FALSE;
 | 
					BOOLEAN                          mS3BootScriptTableSmmAllocated = FALSE;
 | 
				
			||||||
EFI_SMM_SYSTEM_TABLE2            *mSmst = NULL;
 | 
					EFI_SMM_SYSTEM_TABLE2            *mBootScriptSmst = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
  This is an internal function to add a terminate node the entry, recalculate the table 
 | 
					  This is an internal function to add a terminate node the entry, recalculate the table 
 | 
				
			||||||
@@ -493,7 +493,7 @@ S3BootScriptLibInitialize (
 | 
				
			|||||||
  //
 | 
					  //
 | 
				
			||||||
  // Good, we are in SMM
 | 
					  // Good, we are in SMM
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  Status = SmmBase2->GetSmstLocation (SmmBase2, &mSmst);
 | 
					  Status = SmmBase2->GetSmstLocation (SmmBase2, &mBootScriptSmst);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    return RETURN_SUCCESS;
 | 
					    return RETURN_SUCCESS;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -503,11 +503,11 @@ S3BootScriptLibInitialize (
 | 
				
			|||||||
  // The Boot script private data in SMM is not be initialized. create it
 | 
					  // The Boot script private data in SMM is not be initialized. create it
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  if (S3TableSmmPtr == 0) {
 | 
					  if (S3TableSmmPtr == 0) {
 | 
				
			||||||
    Status = mSmst->SmmAllocatePool (
 | 
					    Status = mBootScriptSmst->SmmAllocatePool (
 | 
				
			||||||
                     EfiRuntimeServicesData,
 | 
					                                EfiRuntimeServicesData,
 | 
				
			||||||
                     sizeof(SCRIPT_TABLE_PRIVATE_DATA),
 | 
					                                sizeof(SCRIPT_TABLE_PRIVATE_DATA),
 | 
				
			||||||
                     (VOID **) &S3TableSmmPtr
 | 
					                                (VOID **) &S3TableSmmPtr
 | 
				
			||||||
                     );
 | 
					                                );
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    mS3BootScriptTableSmmAllocated = TRUE;
 | 
					    mS3BootScriptTableSmmAllocated = TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -518,18 +518,18 @@ S3BootScriptLibInitialize (
 | 
				
			|||||||
    //
 | 
					    //
 | 
				
			||||||
    // Register SmmExitBootServices and SmmLegacyBoot notification.
 | 
					    // Register SmmExitBootServices and SmmLegacyBoot notification.
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    Status = mSmst->SmmRegisterProtocolNotify (
 | 
					    Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                     &gEdkiiSmmExitBootServicesProtocolGuid,
 | 
					                                &gEdkiiSmmExitBootServicesProtocolGuid,
 | 
				
			||||||
                     S3BootScriptSmmAtRuntimeCallBack,
 | 
					                                S3BootScriptSmmAtRuntimeCallBack,
 | 
				
			||||||
                     &mRegistrationSmmExitBootServices
 | 
					                                &mRegistrationSmmExitBootServices
 | 
				
			||||||
                     );
 | 
					                                );
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Status = mSmst->SmmRegisterProtocolNotify (
 | 
					    Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                     &gEdkiiSmmLegacyBootProtocolGuid,
 | 
					                                &gEdkiiSmmLegacyBootProtocolGuid,
 | 
				
			||||||
                     S3BootScriptSmmAtRuntimeCallBack,
 | 
					                                S3BootScriptSmmAtRuntimeCallBack,
 | 
				
			||||||
                     &mRegistrationSmmLegacyBoot
 | 
					                                &mRegistrationSmmLegacyBoot
 | 
				
			||||||
                     );
 | 
					                                );
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  mS3BootScriptTableSmmPtr = S3TableSmmPtr;
 | 
					  mS3BootScriptTableSmmPtr = S3TableSmmPtr;
 | 
				
			||||||
@@ -537,11 +537,11 @@ S3BootScriptLibInitialize (
 | 
				
			|||||||
  //
 | 
					  //
 | 
				
			||||||
  // Register SmmReadyToLock notification.
 | 
					  // Register SmmReadyToLock notification.
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  Status = mSmst->SmmRegisterProtocolNotify (
 | 
					  Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                   &gEfiSmmReadyToLockProtocolGuid,
 | 
					                              &gEfiSmmReadyToLockProtocolGuid,
 | 
				
			||||||
                   S3BootScriptSmmEventCallBack,
 | 
					                              S3BootScriptSmmEventCallBack,
 | 
				
			||||||
                   &mRegistrationSmmReadyToLock
 | 
					                              &mRegistrationSmmReadyToLock
 | 
				
			||||||
                   );
 | 
					                              );
 | 
				
			||||||
  ASSERT_EFI_ERROR (Status);
 | 
					  ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return RETURN_SUCCESS;
 | 
					  return RETURN_SUCCESS;
 | 
				
			||||||
@@ -579,38 +579,38 @@ S3BootScriptLibDeinitialize (
 | 
				
			|||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (mSmst != NULL) {
 | 
					  if (mBootScriptSmst != NULL) {
 | 
				
			||||||
    if (mRegistrationSmmExitBootServices != NULL) {
 | 
					    if (mRegistrationSmmExitBootServices != NULL) {
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      // Unregister SmmExitBootServices notification.
 | 
					      // Unregister SmmExitBootServices notification.
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      Status = mSmst->SmmRegisterProtocolNotify (
 | 
					      Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                       &gEdkiiSmmExitBootServicesProtocolGuid,
 | 
					                                  &gEdkiiSmmExitBootServicesProtocolGuid,
 | 
				
			||||||
                       NULL,
 | 
					                                  NULL,
 | 
				
			||||||
                       &mRegistrationSmmExitBootServices
 | 
					                                  &mRegistrationSmmExitBootServices
 | 
				
			||||||
                       );
 | 
					                                  );
 | 
				
			||||||
      ASSERT_EFI_ERROR (Status);
 | 
					      ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (mRegistrationSmmLegacyBoot != NULL) {
 | 
					    if (mRegistrationSmmLegacyBoot != NULL) {
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      // Unregister SmmLegacyBoot notification.
 | 
					      // Unregister SmmLegacyBoot notification.
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      Status = mSmst->SmmRegisterProtocolNotify (
 | 
					      Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                       &gEdkiiSmmLegacyBootProtocolGuid,
 | 
					                                  &gEdkiiSmmLegacyBootProtocolGuid,
 | 
				
			||||||
                       NULL,
 | 
					                                  NULL,
 | 
				
			||||||
                       &mRegistrationSmmLegacyBoot
 | 
					                                  &mRegistrationSmmLegacyBoot
 | 
				
			||||||
                       );
 | 
					                                  );
 | 
				
			||||||
      ASSERT_EFI_ERROR (Status);
 | 
					      ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (mRegistrationSmmReadyToLock != NULL) {
 | 
					    if (mRegistrationSmmReadyToLock != NULL) {
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      // Unregister SmmReadyToLock notification.
 | 
					      // Unregister SmmReadyToLock notification.
 | 
				
			||||||
      //
 | 
					      //
 | 
				
			||||||
      Status = mSmst->SmmRegisterProtocolNotify (
 | 
					      Status = mBootScriptSmst->SmmRegisterProtocolNotify (
 | 
				
			||||||
                       &gEfiSmmReadyToLockProtocolGuid,
 | 
					                                  &gEfiSmmReadyToLockProtocolGuid,
 | 
				
			||||||
                       NULL,
 | 
					                                  NULL,
 | 
				
			||||||
                       &mRegistrationSmmReadyToLock
 | 
					                                  &mRegistrationSmmReadyToLock
 | 
				
			||||||
                       );
 | 
					                                  );
 | 
				
			||||||
      ASSERT_EFI_ERROR (Status);
 | 
					      ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -624,8 +624,8 @@ S3BootScriptLibDeinitialize (
 | 
				
			|||||||
    Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0);
 | 
					    Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0);
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if ((mSmst != NULL) && mS3BootScriptTableSmmAllocated) {
 | 
					  if ((mBootScriptSmst != NULL) && mS3BootScriptTableSmmAllocated) {
 | 
				
			||||||
    Status = mSmst->SmmFreePool (mS3BootScriptTableSmmPtr);
 | 
					    Status = mBootScriptSmst->SmmFreePool (mS3BootScriptTableSmmPtr);
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0);
 | 
					    Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0);
 | 
				
			||||||
    ASSERT_EFI_ERROR (Status);
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user