Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/acpi/acpidump/acpi.c
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | |||||
acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt) | acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt) | ||||
{ | { | ||||
int fadt_revision; | int fadt_revision; | ||||
/* Set the FADT revision separately from the RSDP version. */ | /* Set the FADT revision separately from the RSDP version. */ | ||||
if (addr_size == 8) { | if (addr_size == 8) { | ||||
fadt_revision = 2; | fadt_revision = 2; | ||||
#if defined(__i386__) | |||||
/* | /* | ||||
jhb: Minor nit, I would put the comment under #ifdef as well. | |||||
Not Done Inline ActionsI was thinking the same thing but thought it was too minor even for a comment :) Since I'm now commenting, perhaps also extend the comment to mention that only very early ACPI implementations are expected to be affected and the workaround breaks newer systems, so apply only to 32-bit x86. emaste: I was thinking the same thing but thought it was too minor even for a comment :)
Since I'm now… | |||||
* A few systems (e.g., IBM T23) have an RSDP that claims | * A few systems (e.g., IBM T23) have an RSDP that claims | ||||
* revision 2 but the 64 bit addresses are invalid. If | * revision 2 but the 64 bit addresses are invalid. If | ||||
* revision 2 and the 32 bit address is non-zero but the | * revision 2 and the 32 bit address is non-zero but the | ||||
* 32 and 64 bit versions don't match, prefer the 32 bit | * 32 and 64 bit versions don't match, prefer the 32 bit | ||||
* version for all subsequent tables. | * 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 && | if (fadt->Facs != 0 && | ||||
(fadt->XFacs & 0xffffffff) != fadt->Facs) | (fadt->XFacs & 0xffffffff) != fadt->Facs) | ||||
fadt_revision = 1; | fadt_revision = 1; | ||||
#endif | |||||
} else | } else | ||||
fadt_revision = 1; | fadt_revision = 1; | ||||
return (fadt_revision); | return (fadt_revision); | ||||
} | } | ||||
static void | static void | ||||
acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) | acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 2,065 Lines • Show Last 20 Lines |
Minor nit, I would put the comment under #ifdef as well.