From owner-svn-src-all@freebsd.org Mon May 18 15:06:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21D122CD38D; Mon, 18 May 2020 15:06:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qj5406Vzz3d4H; Mon, 18 May 2020 15:06:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F332523616; Mon, 18 May 2020 15:05:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF5xM6073522; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF5x0U073521; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005181505.04IF5x0U073521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 18 May 2020 15:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361216 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 361216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:06:00 -0000 Author: andrew Date: Mon May 18 15:05:59 2020 New Revision: 361216 URL: https://svnweb.freebsd.org/changeset/base/361216 Log: Allow the FACS and XFACS to be zero in acpidump. These are allowed to be zero when the hardware reduced APCI flag is set Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D23207 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:03:52 2020 (r361215) +++ head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:05:59 2020 (r361216) @@ -245,6 +245,7 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) ACPI_TABLE_HEADER *dsdp; ACPI_TABLE_FACS *facs; ACPI_TABLE_FADT *fadt; + vm_offset_t addr; int fadt_revision; fadt = (ACPI_TABLE_FADT *)sdp; @@ -252,12 +253,17 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) fadt_revision = acpi_get_fadt_revision(fadt); if (fadt_revision == 1) - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->Facs); + addr = fadt->Facs; else - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->XFacs); - if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64) - errx(1, "FACS is corrupt"); - acpi_print_facs(facs); + addr = fadt->XFacs; + if (addr != 0) { + facs = (ACPI_TABLE_FACS *)acpi_map_sdt(addr); + + if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || + facs->Length < 64) + errx(1, "FACS is corrupt"); + acpi_print_facs(facs); + } if (fadt_revision == 1) dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt);