Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/acpitools/acpidump FACS is optional if the HW_REDUC...
details: https://anonhg.NetBSD.org/src/rev/4b617b1d8b75
branches: trunk
changeset: 445184:4b617b1d8b75
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Oct 16 21:44:37 2018 +0000
description:
FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.
diffstat:
usr.sbin/acpitools/acpidump/acpi.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diffs (40 lines):
diff -r a7d426386127 -r 4b617b1d8b75 usr.sbin/acpitools/acpidump/acpi.c
--- a/usr.sbin/acpitools/acpidump/acpi.c Tue Oct 16 16:38:22 2018 +0000
+++ b/usr.sbin/acpitools/acpidump/acpi.c Tue Oct 16 21:44:37 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.32 2018/10/05 05:09:31 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.33 2018/10/16 21:44:37 jmcneill Exp $ */
/*-
* Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: acpi.c,v 1.32 2018/10/05 05:09:31 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.33 2018/10/16 21:44:37 jmcneill Exp $");
#include <sys/param.h>
#include <sys/endian.h>
@@ -819,11 +819,16 @@
fadt = (ACPI_TABLE_FADT *)sdp;
acpi_print_fadt(sdp);
- facs = (ACPI_TABLE_FACS *)acpi_map_sdt(
- acpi_select_address(fadt->Facs, fadt->XFacs));
- if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64)
- errx(EXIT_FAILURE, "FACS is corrupt");
- acpi_print_facs(facs);
+ if (acpi_select_address(fadt->Facs, fadt->XFacs) == 0) {
+ if ((fadt->Flags & ACPI_FADT_HW_REDUCED) == 0)
+ errx(EXIT_FAILURE, "Missing FACS and HW_REDUCED_ACPI flag not set in FADT");
+ } else {
+ facs = (ACPI_TABLE_FACS *)acpi_map_sdt(
+ acpi_select_address(fadt->Facs, fadt->XFacs));
+ if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64)
+ errx(EXIT_FAILURE, "FACS is corrupt");
+ acpi_print_facs(facs);
+ }
dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(
acpi_select_address(fadt->Dsdt, fadt->XDsdt));
Home |
Main Index |
Thread Index |
Old Index