From nobody Wed Oct 02 06:37:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XJQ8K46X8z5Y3L5; Wed, 02 Oct 2024 06:37:05 +0000 (UTC) (envelope-from git@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XJQ8K3ZqJz4cxw; Wed, 2 Oct 2024 06:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727851025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvwcK97TF6cIg8PFkMJsIn/7pRacQSfFZj/UFA996lE=; b=KiH550ZumsXn1qlkMVgw2tBK6SljrCrqwxlpFPnkISPRsmq5xS0V+9lJyitwty77mzZckD Os3r4B5QtZhw4X4TYIZUi33Rf4tT/lreEjZKGbgFwofBFfbJHqoRgCyYTKYk6k5WpniTuL Gm+IMbZu4f+142rAxA+qalCxFVMQ7Hruk3tIWKHvJ5QK3FjQ1IU8p47/0yJoGmXHcwtnnc G7M/BCqTy61MsT0Idvn8O9rQ4s+x2O8Gutq+GoUuSGEV2+j16G6eB1J0LycZ41fH9jrsOG e4An9/KtaO5qKAwHfazrxpKRzIYGbEcrWWq9PRbqsM1fMrdpqr9x2WKBiZG3aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727851025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvwcK97TF6cIg8PFkMJsIn/7pRacQSfFZj/UFA996lE=; b=SLIQ/NTiVIpQWTvvHjHTZ3xjeRQ2nx9jp1XE3gBF8g5qKlTffyXagj/XARWmjGCr/kcIe5 QzOFueI7i66xw+bnbADvkgghdevr0EP80App7bn7SbIFvyajqkCbV+Qsqp/A7yjp8hAcvO VKnVScP92SMEUnh3eM0MeUrq+ABOh9qdCiFn4FuW9gkG71Sjy4aYqtuZoLArLkYu8AFIsH mUeaDZ+VTiMMGXByDgPYVH2vaEvX8uGwuEZBEbyAy4ZsyH8LShb1AeCiCD2NMYt8T4m/It JY1viiXz2tpWozy+Rg3ogapZKOIVajIft7rmsjED1Ifk/1vhMaLpL5RV18Lr3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727851025; a=rsa-sha256; cv=none; b=MiZKdQtew7hDWbIubxNqIwREl8yxSNc5+vbrfTWaWP74dIyUB99f9wWL1TnCsuO6/8nkR9 1E3S43a9s26Hm/uY2qcpngRiznnNBNhc37XIiG2M8KRV5GK0k9GnB3GajhBPdlm5tD4PkH hpK8NSj2KJKdQ7olWdSBSLynh+yMz2gyXRLY958GTRzj3A3eUeVQg08x+MxXrF32iRkoOd QCIM5FzbAvgKvjI93Bp1Vk/7fat67gekw1k9Je6osNurT1cD2XDCwioAHb8UOw/BRFukeD n/dUMmd+gHvfX9tusQLI0FUGOaJJB2Ej1eMpQfHUbdLhtgmM+0dfbV/GecQt+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XJQ8K2rkFz19lc; Wed, 2 Oct 2024 06:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4926b5UK000308; Wed, 2 Oct 2024 06:37:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4926b5Ns000305; Wed, 2 Oct 2024 06:37:05 GMT (envelope-from git) Date: Wed, 2 Oct 2024 06:37:05 GMT Message-Id: <202410020637.4926b5Ns000305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Takanori Watanabe Subject: git: f5a04b16b189 - main - acpidump: add 's' option to parse dsdt and ssdt's separately. In some machine, they may not be parsed if they are concatinated into one image. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: takawata X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5a04b16b1895b331d6b54534321a8395fc2d5de Auto-Submitted: auto-generated The branch main has been updated by takawata: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a04b16b1895b331d6b54534321a8395fc2d5de commit f5a04b16b1895b331d6b54534321a8395fc2d5de Author: Takanori Watanabe AuthorDate: 2023-06-22 10:08:21 +0000 Commit: Takanori Watanabe CommitDate: 2024-10-02 06:36:41 +0000 acpidump: add 's' option to parse dsdt and ssdt's separately. In some machine, they may not be parsed if they are concatinated into one image. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46796 --- usr.sbin/acpi/acpidump/acpi.c | 16 ++++++++++++++++ usr.sbin/acpi/acpidump/acpidump.8 | 14 +++++++++++++- usr.sbin/acpi/acpidump/acpidump.c | 11 +++++++++-- usr.sbin/acpi/acpidump/acpidump.h | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index af0068649fbb..fe68b5062351 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -2643,6 +2643,22 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp) perror("rmdir"); } +void +aml_disassemble_separate(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp) +{ + ACPI_TABLE_HEADER *ssdt = NULL; + + aml_disassemble(NULL, dsdp); + if (rsdt != NULL) { + for (;;) { + ssdt = sdt_from_rsdt(rsdt, "SSDT", ssdt); + if (ssdt == NULL) + break; + aml_disassemble(NULL, ssdt); + } + } +} + void sdt_print_all(ACPI_TABLE_HEADER *rsdp) { diff --git a/usr.sbin/acpi/acpidump/acpidump.8 b/usr.sbin/acpi/acpidump/acpidump.8 index dc8f724ea738..f193b9a3511a 100644 --- a/usr.sbin/acpi/acpidump/acpidump.8 +++ b/usr.sbin/acpi/acpidump/acpidump.8 @@ -133,13 +133,25 @@ The following options are supported by .Nm : .Bl -tag -width indent .It Fl d -Disassemble the DSDT into ASL using +Concatenate the DSDT and the SSDT's into single image and disassemble the image into ASL using .Xr iasl 8 and print the results to stdout. .It Fl t Dump the contents of the various fixed tables listed above. .It Fl h Displays usage and exit. +.It Fl s +Disassemble each of the DSDT and the SSDT's into ASL using +.Xr iasl 8 +and print the results to stdout. +This will avoid +.Xr iasl 8 +error on disassembling concatenated image. +If both +.Fl d +and +.Fl s +are specified, the last option is effective. .It Fl v Enable verbose messages. .It Fl f Ar dsdt_input diff --git a/usr.sbin/acpi/acpidump/acpidump.c b/usr.sbin/acpi/acpidump/acpidump.c index 23978aca010b..0fad7e68ef47 100644 --- a/usr.sbin/acpi/acpidump/acpidump.c +++ b/usr.sbin/acpi/acpidump/acpidump.c @@ -65,7 +65,7 @@ main(int argc, char *argv[]) if (argc < 2) usage(progname); - while ((c = getopt(argc, argv, "dhtvf:o:")) != -1) { + while ((c = getopt(argc, argv, "dhtvsf:o:")) != -1) { switch (c) { case 'd': dflag = 1; @@ -82,6 +82,9 @@ main(int argc, char *argv[]) case 'o': dsdt_output_file = optarg; break; + case 's': + dflag = 2; + break; case 'h': default: usage(progname); @@ -136,7 +139,11 @@ main(int argc, char *argv[]) if (dflag) { if (vflag) warnx("disassembling DSDT, iasl messages follow"); - aml_disassemble(rsdt, sdt); + if (dflag == 1) { + aml_disassemble(rsdt, sdt); + } else { + aml_disassemble_separate(rsdt, sdt); + } if (vflag) warnx("iasl processing complete"); } diff --git a/usr.sbin/acpi/acpidump/acpidump.h b/usr.sbin/acpi/acpidump/acpidump.h index 80f86a748d76..872facbad59d 100644 --- a/usr.sbin/acpi/acpidump/acpidump.h +++ b/usr.sbin/acpi/acpidump/acpidump.h @@ -144,6 +144,7 @@ void sdt_print_all(ACPI_TABLE_HEADER *); /* Disassemble the AML in the DSDT */ void aml_disassemble(ACPI_TABLE_HEADER *, ACPI_TABLE_HEADER *); +void aml_disassemble_separate(ACPI_TABLE_HEADER *, ACPI_TABLE_HEADER *); /* Routines for accessing tables in physical memory */ ACPI_TABLE_RSDP *acpi_find_rsd_ptr(void);