Only change the fadt revision in acpidump on i386

There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by:	emaste, jkim, jhb (all earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573
This commit is contained in:
Andrew Turner 2021-10-20 10:19:55 +01:00
parent 12615938c6
commit 01593a0ff9

View File

@ -219,16 +219,22 @@ acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt)
if (addr_size == 8) {
fadt_revision = 2;
#if defined(__i386__)
/*
* A few systems (e.g., IBM T23) have an RSDP that claims
* revision 2 but the 64 bit addresses are invalid. If
* revision 2 and the 32 bit address is non-zero but the
* 32 and 64 bit versions don't match, prefer the 32 bit
* version for all subsequent tables.
*
* The only known ACPI systems this affects are early
* implementations on 32-bit x86. Because of this limit the
* workaround to i386.
*/
if (fadt->Facs != 0 &&
(fadt->XFacs & 0xffffffff) != fadt->Facs)
fadt_revision = 1;
#endif
} else
fadt_revision = 1;
return (fadt_revision);