From 48ee8e3e8c1c65bd1cd853e48a8820ae3a4c60e8 Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Mon, 20 Aug 2012 06:09:25 +0000 Subject: Initialize TempAcpiS3Context and TempEfiBootScriptExecutorVariable. Signed-off-by: Star Zeng Reviewed-by: Eric Dong git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13649 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c') diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c index de3aec85e1..07d83cc875 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -874,6 +874,9 @@ S3RestoreConfig2 ( VOID *GuidHob; BOOLEAN Build4GPageTableOnly; + TempAcpiS3Context = 0; + TempEfiBootScriptExecutorVariable = 0; + DEBUG ((EFI_D_ERROR, "Enter S3 PEIM\r\n")); VarSize = sizeof (EFI_PHYSICAL_ADDRESS); @@ -884,9 +887,6 @@ S3RestoreConfig2 ( ); ASSERT_EFI_ERROR (Status); - AcpiS3Context = (ACPI_S3_CONTEXT *)(UINTN)TempAcpiS3Context; - ASSERT (AcpiS3Context != NULL); - Status = RestoreLockBox ( &gEfiAcpiS3ContextGuid, NULL, @@ -894,7 +894,10 @@ S3RestoreConfig2 ( ); ASSERT_EFI_ERROR (Status); - VarSize = sizeof (TempEfiBootScriptExecutorVariable); + AcpiS3Context = (ACPI_S3_CONTEXT *)(UINTN)TempAcpiS3Context; + ASSERT (AcpiS3Context != NULL); + + VarSize = sizeof (EFI_PHYSICAL_ADDRESS); Status = RestoreLockBox ( &gEfiBootScriptExecutorVariableGuid, &TempEfiBootScriptExecutorVariable, @@ -910,6 +913,7 @@ S3RestoreConfig2 ( ASSERT_EFI_ERROR (Status); EfiBootScriptExecutorVariable = (BOOT_SCRIPT_EXECUTOR_VARIABLE *) (UINTN) TempEfiBootScriptExecutorVariable; + ASSERT (EfiBootScriptExecutorVariable != NULL); DEBUG (( EFI_D_ERROR, "AcpiS3Context = %x\n", AcpiS3Context)); DEBUG (( EFI_D_ERROR, "Waking Vector = %x\n", ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)))->FirmwareWakingVector)); -- cgit v1.2.3