mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
ArmVirtPkg/XenAcpiPlatformDxe: Install FACS table from DT
The FACS may still exist when the reduced hardware flag is set in FADT; it is optional. Since it contains the hardware signature field which indicates that a hibernated system should boot cleanly instead of attempting to resume, a platform may choose to expose it. Propagate it correctly. Also avoid a NULL pointer dereference if the platform doesn't provide a DSDT. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Message-Id: <881dd0a2558ecbdfa02c844722d8a1103ab97ab3.camel@infradead.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: uncrustify]
This commit is contained in:
parent
f881b4d129
commit
ba96acd963
@ -128,10 +128,12 @@ InstallXenArmTables (
|
|||||||
EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
|
EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
|
||||||
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtTable;
|
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtTable;
|
||||||
EFI_ACPI_DESCRIPTION_HEADER *DsdtTable;
|
EFI_ACPI_DESCRIPTION_HEADER *DsdtTable;
|
||||||
|
EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *FacsTable;
|
||||||
|
|
||||||
XenAcpiRsdpStructurePtr = NULL;
|
XenAcpiRsdpStructurePtr = NULL;
|
||||||
FadtTable = NULL;
|
FadtTable = NULL;
|
||||||
DsdtTable = NULL;
|
DsdtTable = NULL;
|
||||||
|
FacsTable = NULL;
|
||||||
TableHandle = 0;
|
TableHandle = 0;
|
||||||
NumberOfTableEntries = 0;
|
NumberOfTableEntries = 0;
|
||||||
|
|
||||||
@ -191,6 +193,8 @@ InstallXenArmTables (
|
|||||||
FadtTable = (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *)
|
FadtTable = (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *)
|
||||||
(UINTN)CurrentTablePointer;
|
(UINTN)CurrentTablePointer;
|
||||||
DsdtTable = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)FadtTable->Dsdt;
|
DsdtTable = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)FadtTable->Dsdt;
|
||||||
|
FacsTable = (EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)
|
||||||
|
(UINTN)FadtTable->FirmwareCtrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,14 +202,31 @@ InstallXenArmTables (
|
|||||||
//
|
//
|
||||||
// Install DSDT table.
|
// Install DSDT table.
|
||||||
//
|
//
|
||||||
Status = AcpiProtocol->InstallAcpiTable (
|
if (DsdtTable != NULL) {
|
||||||
AcpiProtocol,
|
Status = AcpiProtocol->InstallAcpiTable (
|
||||||
DsdtTable,
|
AcpiProtocol,
|
||||||
DsdtTable->Length,
|
DsdtTable,
|
||||||
&TableHandle
|
DsdtTable->Length,
|
||||||
);
|
&TableHandle
|
||||||
if (EFI_ERROR (Status)) {
|
);
|
||||||
return Status;
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Install FACS table.
|
||||||
|
//
|
||||||
|
if (FacsTable != NULL) {
|
||||||
|
Status = AcpiProtocol->InstallAcpiTable (
|
||||||
|
AcpiProtocol,
|
||||||
|
FacsTable,
|
||||||
|
FacsTable->Length,
|
||||||
|
&TableHandle
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user