diff options
author | njl <njl@FreeBSD.org> | 2004-10-05 02:18:53 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-10-05 02:18:53 +0000 |
commit | 7195f265b611311cb80747362b5277bf1cdf09e9 (patch) | |
tree | dc6e4a0b343daea3209a7955830989770594001d /usr.sbin/acpi/acpidump/acpi.c | |
parent | a8b1fd9efbf31e6a704f5f931cf33e9a689d5aac (diff) | |
download | FreeBSD-src-7195f265b611311cb80747362b5277bf1cdf09e9.zip FreeBSD-src-7195f265b611311cb80747362b5277bf1cdf09e9.tar.gz |
Add the -s flag to make dumping SSDTs optional (disabled by default).
Since we can only override the DSDT, a custom ASL dumped previously that
contained SSDTs would result in lots of multiple definition errors.
A longer-term fix involves adding the ability to override SSDTs to ACPI-CA.
MFC after: 3 days
Diffstat (limited to 'usr.sbin/acpi/acpidump/acpi.c')
-rw-r--r-- | usr.sbin/acpi/acpidump/acpi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index af8ea27..fee5f53 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -719,6 +719,7 @@ sdt_load_devmem(void) return (rsdp); } +/* Write the DSDT to a file, concatenating any SSDTs (if present). */ static int write_dsdt(int fd, struct ACPIsdt *rsdt, struct ACPIsdt *dsdt) { @@ -726,12 +727,13 @@ write_dsdt(int fd, struct ACPIsdt *rsdt, struct ACPIsdt *dsdt) struct ACPIsdt *ssdt; uint8_t sum; + /* Create a new checksum to account for the DSDT and any SSDTs. */ sdt = *dsdt; if (rsdt != NULL) { sdt.check = 0; sum = acpi_checksum(dsdt->body, dsdt->len - SIZEOF_SDT_HDR); ssdt = sdt_from_rsdt(rsdt, "SSDT", NULL); - while (ssdt != NULL) { + while (sflag && ssdt != NULL) { sdt.len += ssdt->len - SIZEOF_SDT_HDR; sum += acpi_checksum(ssdt->body, ssdt->len - SIZEOF_SDT_HDR); @@ -740,9 +742,13 @@ write_dsdt(int fd, struct ACPIsdt *rsdt, struct ACPIsdt *dsdt) sum += acpi_checksum(&sdt, SIZEOF_SDT_HDR); sdt.check -= sum; } + + /* Write out the DSDT header and body. */ write(fd, &sdt, SIZEOF_SDT_HDR); write(fd, dsdt->body, dsdt->len - SIZEOF_SDT_HDR); - if (rsdt != NULL) { + + /* Write out any SSDTs (if present and the user requested this.) */ + if (sflag && rsdt != NULL) { ssdt = sdt_from_rsdt(rsdt, "SSDT", NULL); while (ssdt != NULL) { write(fd, ssdt->body, ssdt->len - SIZEOF_SDT_HDR); |