ACPI4.0/5.0 have clear description:

FIRMWARE_CTRL: If the X_FIRMWARE_CTRL field contains a non zero value then this field must be zero.
X_FIRMWARE_CTRL: This field is used when the physical address of the FACS is above 4GB. If the FIRMWARE_CTRL field contains a non zero value then this field must be zero.

Update code in AcpiSupport/AcpiTable when it produces this field to set one only.
Update code in AcpiS3Save when it consumes this field, check 0 value.


Signed-off-by: jiewen.yao@intel.com
Reviewed-by: star.zeng@intel.com

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13980 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jyao1
2012-11-30 09:03:15 +00:00
parent 93b21ade88
commit c93776c2d4
3 changed files with 193 additions and 49 deletions

View File

@@ -1,7 +1,7 @@
/** @file
ACPI Support Protocol implementation
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -776,14 +776,24 @@ AddTableToList (
//
// Update pointers in FADT. If tables don't exist this will put NULL pointers there.
// Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and
// vice-versa.
//
AcpiSupportInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiSupportInstance->Facs3;
Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;
CopyMem (
&AcpiSupportInstance->Fadt3->XFirmwareCtrl,
&Buffer64,
sizeof (UINT64)
);
if ((UINT64)(UINTN)AcpiSupportInstance->Facs3 < BASE_4GB) {
AcpiSupportInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiSupportInstance->Facs3;
ZeroMem (
&AcpiSupportInstance->Fadt3->XFirmwareCtrl,
sizeof (UINT64)
);
} else {
AcpiSupportInstance->Fadt3->FirmwareCtrl = 0;
Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;
CopyMem (
&AcpiSupportInstance->Fadt3->XFirmwareCtrl,
&Buffer64,
sizeof (UINT64)
);
}
AcpiSupportInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiSupportInstance->Dsdt3;
Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Dsdt3;
CopyMem (
@@ -900,13 +910,20 @@ AddTableToList (
// If FADT already exists, update table pointers.
//
if (AcpiSupportInstance->Fadt3 != NULL) {
AcpiSupportInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiSupportInstance->Facs3;
Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;
CopyMem (
&AcpiSupportInstance->Fadt3->XFirmwareCtrl,
&Buffer64,
sizeof (UINT64)
);
//
// Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and
// vice-versa.
//
if ((UINT64)(UINTN)AcpiSupportInstance->Facs3 < BASE_4GB) {
AcpiSupportInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiSupportInstance->Facs3;
} else {
Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;
CopyMem (
&AcpiSupportInstance->Fadt3->XFirmwareCtrl,
&Buffer64,
sizeof (UINT64)
);
}
//
// Checksum FADT table