summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Acpi
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-30 04:23:40 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-30 04:23:40 +0000
commit37623a5c029e5415fe24b86bf4f6481f8fdfad94 (patch)
tree925965b7341d07571b8bb22d51cacd39262ac0b7 /MdeModulePkg/Universal/Acpi
parentcb38c322f037a9a5d2751a4c7e351b0ee7302e96 (diff)
downloadedk2-platforms-37623a5c029e5415fe24b86bf4f6481f8fdfad94.tar.xz
Add missing status code in several modules.
Signed-off-by: Li Elvin <elvin.li@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com> Reviewed-by: Tian Feng <feng.tian@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13890 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
-rw-r--r--MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
index 971e429f39..3bddda1316 100644
--- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
+++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
@@ -68,9 +68,12 @@ S3BootScriptExecutorEntryFunction (
// for that parameter.
//
Status = S3BootScriptExecute ();
- if (EFI_ERROR (Status)) {
- return Status;
- }
+
+ //
+ // Need report status back to S3ResumePeim.
+ // If boot script execution is failed, S3ResumePeim wil report the error status code.
+ //
+ PeiS3ResumeState->ReturnStatus = (UINT64)(UINTN)Status;
AsmWbinvd ();
@@ -79,13 +82,6 @@ S3BootScriptExecutorEntryFunction (
//
Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable));
- if ((Facs == NULL) ||
- (Facs->Signature != EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) ||
- ((Facs->FirmwareWakingVector == 0) && (Facs->XFirmwareWakingVector == 0)) ) {
- CpuDeadLoop();
- return EFI_INVALID_PARAMETER;
- }
-
//
// We need turn back to S3Resume - install boot script done ppi and report status code on S3resume.
//
@@ -97,12 +93,16 @@ S3BootScriptExecutorEntryFunction (
DEBUG ((EFI_D_ERROR, "Call AsmDisablePaging64() to return to S3 Resume in PEI Phase\n"));
PeiS3ResumeState->AsmTransferControl = (EFI_PHYSICAL_ADDRESS)(UINTN)AsmTransferControl32;
- //
- // more step needed - because relative address is handled differently between X64 and IA32.
- //
- AsmTransferControl16Address = (UINTN)AsmTransferControl16;
- AsmFixAddress16 = (UINT32)AsmTransferControl16Address;
- AsmJmpAddr32 = (UINT32)((Facs->FirmwareWakingVector & 0xF) | ((Facs->FirmwareWakingVector & 0xFFFF0) << 12));
+ if ((Facs != NULL) &&
+ (Facs->Signature == EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) &&
+ (Facs->FirmwareWakingVector != 0) ) {
+ //
+ // more step needed - because relative address is handled differently between X64 and IA32.
+ //
+ AsmTransferControl16Address = (UINTN)AsmTransferControl16;
+ AsmFixAddress16 = (UINT32)AsmTransferControl16Address;
+ AsmJmpAddr32 = (UINT32)((Facs->FirmwareWakingVector & 0xF) | ((Facs->FirmwareWakingVector & 0xFFFF0) << 12));
+ }
AsmDisablePaging64 (
PeiS3ResumeState->ReturnCs,
@@ -132,7 +132,10 @@ S3BootScriptExecutorEntryFunction (
CpuDeadLoop();
return EFI_UNSUPPORTED;
}
-
+
+ //
+ // S3ResumePeim does not provide a way to jump back to itself, so resume to OS here directly
+ //
if (Facs->XFirmwareWakingVector != 0) {
//
// Switch to native waking vector