Merge branch 'CloverHackyColor:master' into master

This commit is contained in:
LAbyOne 2021-09-03 12:06:26 +02:00 committed by GitHub
commit b861f0d1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -937,8 +937,10 @@ void DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam
CopyMem(&OemTableId[0], &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8); CopyMem(&OemTableId[0], &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8);
OemTableId[8] = 0; OemTableId[8] = 0;
stripTrailingSpaces(OemTableId); stripTrailingSpaces(OemTableId);
int innLen = ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length;
if (innLen < 0 || innLen > 0x20000) break;
DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId, DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId,
((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length); ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, innLen);
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
DBG("%02hhX ", ((UINT8*)adr)[k]); DBG("%02hhX ", ((UINT8*)adr)[k]);
} }
@ -1123,7 +1125,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST
// Acpi 2.0 or up // Acpi 2.0 or up
// may have it in XDsdt or XFirmwareCtrl // may have it in XDsdt or XFirmwareCtrl
DBG(", XDsdt: %llx, XFacs: %llx", Fadt->XDsdt, Fadt->XFirmwareCtrl); DBG(", XDsdt: %llx, XFacs: %llx", Fadt->XDsdt, Fadt->XFirmwareCtrl);
if (Fadt->XDsdt != 0) { if ((Fadt->XDsdt != 0) && (Fadt->XDsdt < 0xFFFFFFF0ull)){
DsdtAdr = Fadt->XDsdt; DsdtAdr = Fadt->XDsdt;
} }
if (Fadt->XFirmwareCtrl != 0) { if (Fadt->XFirmwareCtrl != 0) {
@ -1349,9 +1351,10 @@ void DumpTables(void *RsdPtrVoid, CONST CHAR16 *DirName)
DBG(" No Rsdt and Xsdt - exiting.\n"); DBG(" No Rsdt and Xsdt - exiting.\n");
return; return;
} }
UINT32 Count = 0;
if (Xsdt) { if (Xsdt) {
UINT64 *Ptr, *EndPtr; UINT64 *Ptr, *EndPtr;
UINT32 Count = XsdtTableCount(); Count = XsdtTableCount();
DBG(" Tables in Xsdt: %d\n", Count); DBG(" Tables in Xsdt: %d\n", Count);
if (Count > 100) Count = 100; //it's enough if (Count > 100) Count = 100; //it's enough
@ -1390,13 +1393,13 @@ void DumpTables(void *RsdPtrVoid, CONST CHAR16 *DirName)
} }
} // if Xsdt } // if Xsdt
if (Rsdt) { if (!Count && Rsdt) {
UINT32 *Ptr, *EndPtr; UINT32 *Ptr, *EndPtr;
// additional Rsdt tables which are not present in Xsdt will have "RSDT-" prefix, like RSDT-FACS.aml // additional Rsdt tables which are not present in Xsdt will have "RSDT-" prefix, like RSDT-FACS.aml
FileNamePrefix = L"RSDT-"; FileNamePrefix = L"RSDT-";
// Take tables from Rsdt // Take tables from Rsdt
// if saved from Xsdt already, then just print debug // if saved from Xsdt already, then just print debug
UINT32 Count = RsdtTableCount(); Count = RsdtTableCount();
DBG(" Tables in Rsdt: %d\n", Count); DBG(" Tables in Rsdt: %d\n", Count);
if (Count > 100) Count = 100; //it's enough if (Count > 100) Count = 100; //it's enough
Ptr = RsdtEntryPtrFromIndex(0); Ptr = RsdtEntryPtrFromIndex(0);