Home | History | Annotate | Download | only in acpidump
History log of /src/usr.sbin/acpitools/acpidump/acpi.c
RevisionDateAuthorComments
 1.56  12-May-2024  msaitoh s/iast/iasl/ from FreeBSD.
 1.55  24-May-2022  andvar fix various typos in comment, documentation and log messages.
 1.54  13-Feb-2022  andvar fix few typos in comments and log message.
 1.53  08-Nov-2021  skrll acpi_print_gicc_flags: print {en,dis}abled
 1.52  19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.51  14-Sep-2021  rillig acpidump: fix lint errors

When lint runs on the code, it defines the preprocessor macro 'lint' to
be 1. Due to that, this name cannot be used as a regular identifier.

acpi.c(86): error: syntax error '1' [249]
acpi.c(1004): error: syntax error '1' [249]
acpi.c(2422): error: void function acpi_print_lpit cannot return value
[213]

The FreeBSD code doesn't need this name change since lint is specific to
NetBSD.

No functional change.
 1.50  20-Jan-2021  skrll Consistently use ACPI_SIG_SSDT
 1.49  14-Dec-2020  jmcneill MAsk -> Mask, spotted by rillig@
 1.48  12-Dec-2020  jmcneill Add support for decoding Platform Communications Channel Tables ("PCCT").
 1.47  06-Dec-2020  jmcneill acpidump: Do not print FACS if HW_REDUCED flag is set.

According to ACPI 6.3 spec, FACS is optional when HW_REDUCED is set. ACPICA
ignores the FACS completely when HW_REDUCED is set, so we need to follow
suit since it is not available through /dev/acpi as the table is not
installed.
 1.46  22-Jun-2019  maxv Dump TPM2.
 1.45  29-Apr-2019  dogcow acpica 20190405 changed some internal macros; update code to match
 1.44  09-Feb-2019  msaitoh Add missing newline.
 1.43  30-Dec-2018  msaitoh Fix acpi_print_string(). Treat NUL termination correctly to not to print
NUL character. For example, this change prints an OEMID "41 4d 44 00 41 4d"
with "AMD". Tested by Patrick Welche.
 1.42  02-Dec-2018  msaitoh Decode IO Remapping Table.
 1.41  11-Nov-2018  maya & promotes to int already, so clang warns about the hh modifier.
(and we use -Werror)

ok xtos
 1.40  05-Nov-2018  msaitoh Decode Boot Graghics Resource Table (BGRT).
 1.39  01-Nov-2018  msaitoh Decode CSRT (Core System Resources Table).
 1.38  18-Oct-2018  msaitoh Fix output of Cache type in PPTT.
 1.37  18-Oct-2018  msaitoh Don't print X_PM_TMR_BLK if the address value is 0.
 1.36  18-Oct-2018  msaitoh Don't print PM_TMR_BLK if the value is 0 (see also acpi_timer.c rev. 1.23).
 1.35  18-Oct-2018  msaitoh Decode Generic Timer Description Table(GTDT) and Processor Properties Topology
Table(PPTT). Cosmetic changes and fixes might be required. Testesd by jmcneill.
 1.34  18-Oct-2018  msaitoh Print SPCR's Interface Type and ARMH GIC Interrupt Type.
 1.33  16-Oct-2018  jmcneill FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.
 1.32  05-Oct-2018  msaitoh Remove extra newline in SPMI table.
 1.31  03-Oct-2018  msaitoh - Decode DMAR's ANDD (ACPI Name Space).
- Add X2APIC_MODE flag of DMAR. Note that Intel's VT-d's document says the
flag's name is DMA_CTRL_PLATFORM_OPT_IN but actbl1.h says it's
DMAR_X2APIC_MODE.
 1.30  03-Oct-2018  msaitoh Add ACPI LPIT (Low Power Idle Table) from FreeBSD r336185.
 1.29  28-Sep-2017  msaitoh branches: 1.29.2; 1.29.4;
Print ACPI_HEST_GHES_ASSIST flag (ACPI 6.2).
 1.28  27-Sep-2017  msaitoh Cosmetic change (tab and newline).
 1.27  27-Sep-2017  msaitoh - Print SAPIC EID of Processor Local APIC/SAPIC Affinity.
- Print GIC Interrupt Translation Service(ITS) Affinity (ACPI 6.2)
- KNF
- Whilte space cleanup.
 1.26  07-Sep-2017  msaitoh Don't define GAS adddess ID constants in acpidump.h and use actypes.h's
definitions. No functional change.
 1.25  04-Sep-2017  msaitoh - Space, tab and newline change for consistency output.
- Print a type number for unknown HEST sub entry ID.
 1.24  04-Sep-2017  msaitoh - Calculate offset of a sub header correctly in acpi_handle_hest() to print
all of sub entries in HEST correctly.
- Print a SpaceID number for unknown ID in acpi_print_gas().
- Use PRINTFLAG() in acpi_print_hest_notify().
- Use %u instead of %d for unsgined values in acpi_print_hest_generic().
 1.23  04-Sep-2017  msaitoh Fix calculation the offset of the Action Table in WDAT to print each
entries correctly.
 1.22  01-Sep-2017  msaitoh Decode the following entries:
- DBG2 (Debug Port Table 2)
- SPMI (Server Platform Management Interface Table)
- WDDT (Watchdog Timer Description Table)
- UEFI (UEFI, not fully decoded yet)
 1.21  01-Sep-2017  msaitoh - Add "Performance Server" and "Tablet" for Preferred_PM_Profile.
- Don't print FADT_RESET_REG if FADT version is 1.
- Print FADT ArmBootFlags, MinorRevision, SleepControl, SleepStatus and
HypervisorId.
- Print "{}" even if any flags aren't set.
 1.20  31-Aug-2017  msaitoh Part of FreeBSD r323045:
- Print Valid Field in ACPI_NFIT_CONTROL_REGION with 0x%02x.
- Fix Flags of ACPI_NFIT_CONTROL_REGION.
 1.19  31-Aug-2017  msaitoh - Decode ACPI_HEST_GENERIC_V2.
- Decode ACPI_MADT_GENERIC_MSI_FRAME.
- Add NMI, CMCI, MCE, GPIO-Signal, ARMv8 SEA, ARMv8 SEI and GSIV
in acpi_print_hest_notify().
- Add ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS and ACPI_EINJ_GET_EXECUTE_TIMINGS
in acpi_print_einj_action().
- Add ACPI_ERST_EXECUTE_TIMINGS in acpi_print_erst_action().
- Decode NFIT (NVDIMM Firmware Interface Table) from FreeBSD.
 1.18  21-Aug-2017  msaitoh Add new function acpi_select_address() derived from acpi_get_fadt_revision().
On some systems, 32bit address is used for (X)Dsdt even if (X)Facs uses 64bit.
Don't assume an address size from FADT revision.
 1.17  18-Aug-2017  msaitoh Check DSDT signature in acpi_handle_fadt() for broken ACPI table.
 1.16  04-Aug-2017  msaitoh Sync with FreeBSD's r321294:
- Dump TCG ACPI spec table (TCPA) more.
- Dump DMA Remapping Reporting table (DMAR).
- Consistently cast ACPICA 64-bit integer types when we print them.
- Display the 'Flags' field in the HPET Description Table.
- Do not crash when RSDT/XSDT contains an empty entry.
- Print 64-bit addresses clearly with leading zeros to avoid confusions.
- Create temp file safely.
- Add missing flags into FADT.
- Print some new ACPI 5.1 MADT entries.
- Use __arraycount().
- Warn and exit loop on invalid subtable length.
- Fix the type used to hold the value returned from getopt. On arm64 char is
unsigned so will never be -1.
 1.15  27-Feb-2016  christos branches: 1.15.8;
CID 1354301, 1354302, 1354303: Fix uninitialized variable.
 1.14  01-Feb-2016  christos PR/50741: David Binderman: Fix assignment in assert.
 1.13  19-Aug-2015  christos Put back a Trusted Computing Platform Alliance table pretty printer.
 1.12  18-Aug-2015  christos comment out end comment printing.
 1.11  18-Aug-2015  christos comment out tcpa printout since it has been split between server and client
struct.
 1.10  16-Jun-2015  christos improve error messages (remove \n, use __func__, etc)
 1.9  20-Mar-2014  riastradh Don't choke on an assertion for an RSDT with a null address entry.
 1.8  17-Feb-2011  jmcneill branches: 1.8.4; 1.8.6; 1.8.10;
- when dumping table bytes, make sure to dump our header and not the next one
- also dump tables with bad checksums, unless the -s flag is specified
 1.7  17-Feb-2011  jmcneill dump bytes for tables that acpidump doesn't decode, and print them
as characters instead of hex if '-c' flag is provided
 1.6  19-Dec-2010  jruoho branches: 1.6.2;
Fix theoretical buffer overflow by using MAXPATHLEN for realpath(3).
 1.5  22-Dec-2009  cegger Import acpidump from FreeBSD per request from jmcneill@
Changes made in the port:
- adapt path to iasl from /usr/sbin/iasl to /usr/bin/iasl
- fix realpath() usage to accomplish NetBSD's behaviour
- use EXIT_FAILURE/EXIT_SUCCESS everywhere
- fix crash on corrupt DSDT file and print proper error message
- implemented additional ACPI table parsers for
BERT, BOOT, CPEP, DBGP, EINJ, ERST, HEST, MSCT, SBST,
SLIT, SPCR, TCPA, WAET, WDAT and WDRT
 1.4  13-Feb-2008  drochner -if an RSDT entry points to a table with invalid checksum, print
a warning and continue, rather than aborting -- some BIOSes disable
tables this way (in my case the TCPA table if the TPM is disabled)
-no terminating newline in err(3) calls
 1.3  13-Feb-2008  joerg Fix quoting of string literals, printing of names and add most ACPI 3.0
opcodes. This is good enough to create output that can be compiled with
acpi-iasl to the same binary as it would create from its down ASL dump
on my laptop, when I manually fix the use of reserved identifiers in the
DSDT.
 1.2  14-Jan-2007  dogcow branches: 1.2.4;
Now compiles on amd64, mostly due to %llx -> %PRIx64, but also changing some
internal structures around. (yay for assuming that pointers can be held in
an int. bah.)

Not sure if it actually _works_ on amd64, but as the output on my i386
doesn't change pre/post-patching, that seems good enough for now.
 1.1  14-Jan-2007  christos Add acpitools
 1.2.4.1  23-Mar-2008  matt sync with HEAD
 1.6.2.1  17-Feb-2011  bouyer Sync with HEAD
 1.8.10.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.1  27-Oct-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1131):
usr.sbin/acpitools/acpidump/acpi.c: revision 1.9
Don't choke on an assertion for an RSDT with a null address entry.
 1.8.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.8.3  03-Jan-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1154):

usr.sbin/acpitools/acpidump/acpi.c: revision 1.43

Fix acpi_print_string(). Treat NUL termination correctly to not to print
NUL character. For example, this change prints an OEMID "41 4d 44 00 41 4d"
with "AMD". Tested by Patrick Welche.
 1.15.8.2  04-Dec-2018  martin Pull up the following, requested by msaitoh in ticket #1121:

usr.sbin/acpitool/acpidump/acpi.c 1.30-1.37, 1.39 via patch
usr.sbin/acpitool/acpidump/acpidump.8 1.11-1.13 via patch

- Add ACPI LPIT (Low Power Idle Table) from FreeBSD r336185.
- Decode DMAR's ANDD (ACPI Name Space).
- Add X2APIC_MODE flag of DMAR.
- Remove extra newline in SPMI table.
- FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.
- Print SPCR's Interface Type and ARMH GIC Interrupt Type.
- Decode Generic Timer Description Table(GTDT).
- Don't print PM_TMR_BLK if the value is 0.
- Don't print X_PM_TMR_BLK if the address value is 0.
- Decode CSRT (Core System Resources Table).
 1.15.8.1  22-Nov-2017  martin Pull up following revision(s) (requested by msaitoh in ticket #378):
usr.sbin/acpitools/acpidump/acpi_user.c: revision 1.4
usr.sbin/acpitools/acpidump/acpi.c: revision 1.20
usr.sbin/acpitools/acpidump/acpidump.c: revision 1.7
usr.sbin/acpitools/acpidump/acpi.c: revision 1.21
usr.sbin/acpitools/acpidump/acpidump.8: revision 1.10
usr.sbin/acpitools/acpidump/acpi.c: revision 1.22
usr.sbin/acpitools/acpidump/acpidump.h: revision 1.6
usr.sbin/acpitools/acpidump/acpi.c: revision 1.23
usr.sbin/acpitools/acpidump/acpidump.h: revision 1.7
usr.sbin/acpitools/acpidump/acpi.c: revision 1.24
usr.sbin/acpitools/acpidump/acpidump.8: revision 1.8
usr.sbin/acpitools/acpidump/acpi.c: revision 1.25
usr.sbin/acpitools/acpidump/acpidump.8: revision 1.9
usr.sbin/acpitools/acpidump/acpi.c: revision 1.26
usr.sbin/acpitools/acpidump/acpi.c: revision 1.28
usr.sbin/acpitools/acpidump/acpi.c: revision 1.16
usr.sbin/acpitools/acpidump/acpi.c: revision 1.17
usr.sbin/acpitools/acpidump/acpi.c: revision 1.18
usr.sbin/acpitools/acpidump/acpi.c: revision 1.19
Sync with FreeBSD's r321294:
- Dump TCG ACPI spec table (TCPA) more.
- Dump DMA Remapping Reporting table (DMAR).
- Consistently cast ACPICA 64-bit integer types when we print them.
- Display the 'Flags' field in the HPET Description Table.
- Do not crash when RSDT/XSDT contains an empty entry.
- Print 64-bit addresses clearly with leading zeros to avoid confusions.
- Create temp file safely.
- Add missing flags into FADT.
- Print some new ACPI 5.1 MADT entries.
- Use __arraycount().
- Warn and exit loop on invalid subtable length.
- Fix the type used to hold the value returned from getopt. On arm64 char is
unsigned so will never be -1.
Check DSDT signature in acpi_handle_fadt() for broken ACPI table.
Add new function acpi_select_address() derived from acpi_get_fadt_revision().
On some systems, 32bit address is used for (X)Dsdt even if (X)Facs uses 64bit.
Don't assume an address size from FADT revision.
- Decode ACPI_HEST_GENERIC_V2.
- Decode ACPI_MADT_GENERIC_MSI_FRAME.
- Add NMI, CMCI, MCE, GPIO-Signal, ARMv8 SEA, ARMv8 SEI and GSIV
in acpi_print_hest_notify().
- Add ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS and ACPI_EINJ_GET_EXECUTE_TIMINGS
in acpi_print_einj_action().
- Add ACPI_ERST_EXECUTE_TIMINGS in acpi_print_erst_action().
- Decode NFIT (NVDIMM Firmware Interface Table) from FreeBSD.
Part of FreeBSD r323045:
- Print Valid Field in ACPI_NFIT_CONTROL_REGION with 0x%02x.
- Fix Flags of ACPI_NFIT_CONTROL_REGION.
- Add "Performance Server" and "Tablet" for Preferred_PM_Profile.
- Don't print FADT_RESET_REG if FADT version is 1.
- Print FADT ArmBootFlags, MinorRevision, SleepControl, SleepStatus and
HypervisorId.
- Print "{}" even if any flags aren't set.
Decode the following entries:
- DBG2 (Debug Port Table 2)
- SPMI (Server Platform Management Interface Table)
- WDDT (Watchdog Timer Description Table)
- UEFI (UEFI, not fully decoded yet)
Fix calculation the offset of the Action Table in WDAT to print each
entries correctly.
- Calculate offset of a sub header correctly in acpi_handle_hest() to print
all of sub entries in HEST correctly.
- Print a SpaceID number for unknown ID in acpi_print_gas().
- Use PRINTFLAG() in acpi_print_hest_notify().
- Use %u instead of %d for unsigned values in acpi_print_hest_generic().
- Space, tab and newline change for consistency output.
- Print a type number for unknown HEST sub entry ID.
Don't define GAS address ID constants in acpidump.h and use actypes.h's
definitions. No functional change.
Cosmetic change (tab and newline).
 1.29.4.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.29.4.1  10-Jun-2019  christos Sync with HEAD
 1.29.2.4  18-Jan-2019  pgoyette Synch with HEAD
 1.29.2.3  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.29.2.2  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.29.2.1  20-Oct-2018  pgoyette Sync with head

RSS XML Feed