Commit graph

303 commits

Author SHA1 Message Date
Konstantin Belousov 7cf0b203f5 Revert "acpidump: dump AMD IVRS table describing IOMMU layout"
and related helping commits on stable/13. This reverts commits
256ee428f5
f95a254aa7
f7fd7f8b88

The acpi-ca version on stable/13 is too old.
2024-04-17 12:40:04 +03:00
Konstantin Belousov 256ee428f5 acpidump: add Foundation copyright
(cherry picked from commit f1519a8229)
2024-04-17 11:13:18 +03:00
Konstantin Belousov f95a254aa7 acpidump: dump AMD IVRS table describing IOMMU layout
(cherry picked from commit 6d789b6126)
2024-04-17 11:13:18 +03:00
Konstantin Belousov f7fd7f8b88 acpidump: add printfield() helper
(cherry picked from commit 969a4b8be5)
2024-04-17 11:13:18 +03:00
Konstantin Belousov 84944bf5e2 acpidump: bump WARNS to 6
(cherry picked from commit 29a6b72775)
2024-04-17 11:13:17 +03:00
Konstantin Belousov 930c76a733 acpidump: the acpi_get_fadt_revision() argument is unused
(cherry picked from commit 4262ad56a0)
2024-04-17 11:13:17 +03:00
Konstantin Belousov f77abc3526 acpidump: silent the warning about unaligned uuid
(cherry picked from commit de937ecb75)
2024-04-17 11:13:17 +03:00
Warner Losh b144e70a33 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit fa9896e082)
2023-08-23 11:43:31 -06:00
Warner Losh 023fc80ee3 Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0e)
2023-08-23 11:43:30 -06:00
Warner Losh 34041aac83 Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 42b388439b)
2023-08-23 11:43:22 -06:00
Warner Losh 17da660ad5 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit b3e7694832)
2023-08-23 11:43:21 -06:00
Warner Losh caa41f6417 spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix

(cherry picked from commit 4d846d260e)
2023-07-25 09:13:49 -06:00
John Baldwin 0218596e92 acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace.
This function intentionally saves a pointer to an on-stack variable in
a global as a dubious way of reading the stack pointer.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37535

(cherry picked from commit f4432625ed)
2023-05-02 17:05:54 -07:00
Alexander Motin 9644bc4a11 Decode couple arrays in NFIT table.
MFC after:	1 week

(cherry picked from commit 3b7935f33b)
2022-08-25 22:49:39 -04:00
Gordon Bergling 306c6832cb acpi(4): Fix a typo in a debug statement
- s/Efficency/tEfficiency/

Obtained from:	NetBSD

(cherry picked from commit 0b4302aa93)
2022-06-10 14:27:06 +02:00
Andrew Turner 6d518e308c Add the Arm SPE interrupt to acpidump
To support the Arm Statistical Profiling Extension (SPE) ACPI 6.3 added
a place to hold the SPE interrupt. Add to acpidump to show when printing
the Arm Generic Interrupt data.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c363da4ae8)
2022-02-22 16:23:07 +00:00
Andrew Turner efa2061377 Only change the fadt revision in acpidump on i386
There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by:	emaste, jkim, jhb (all earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573

(cherry picked from commit 01593a0ff9)
2021-12-14 10:58:01 +00:00
Alexander Motin 549d832929 Print DeviceHandle and PhysicalId in hex.
The first is actually a bitfield.  The second is printed in hex by
dmidecode, so uniformidy should be good.

MFC after:	1 week

(cherry picked from commit 92d0d6bb14)
2021-02-11 23:03:15 -05:00
Alexander Motin 5bbaea5d06 Improve ACPI_NFIT_CONTROL_REGION formatting.
MFC after:	1 week

(cherry picked from commit 35e39fd95f)
2021-02-11 23:03:14 -05:00
Alexander Motin 3f185aacc5 Decode NFIT Platform Capabilities.
(cherry picked from commit 1b109c69ed)
2021-01-31 20:53:23 -05:00
Alexander Motin ebc22d0495 Decode APEI tables (BERT, EINJ, ERST, HEST).
MFC after:	2 weeks
2020-06-30 21:40:34 +00:00
Andrew Turner bc71118183 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
2020-05-18 15:05:59 +00:00
Eric van Gyzen fac6dee9eb Remove tests for obsolete compilers in the build system
Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree.
Assume clang is at least 6, which was in 11.2-RELEASE.  Drop conditions
for older compilers.

Reviewed by:	imp (earlier version), emaste, jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24802
2020-05-12 15:22:40 +00:00
Hiroki Sato 294de6bbd6 Add _BIX (Battery Information Extended) object support.
ACPI Control Method Batteries have a _BIF and/or _BIX object which
provide static properties of the battery.  FreeBSD acpi_cmbat module
supported _BIF object only, which was deprecated as of ACPI 4.0.
_BIX is an extended version of _BIF defined in ACPI 4.0 or later.

As of writing, _BIX has two revisions.  One is in ACPI 4.0 (rev.0) and
another is in ACPI 6.0 (rev.1).  It seems that hardware vendors still
stick to _BIF only or _BIX rev.0 + _BIF for the maximum compatibility.
Microsoft requires _BIX rev.0 for Windows machines, so there are some
laptop machines with _BIX rev.0 only. In this case, FreeBSD does not
recognize the battery information.

After this change, the acpi_cmbat module gets battery information from
_BIX or _BIF object and internally uses _BIX rev.1 data structure as
the primary information store in the kernel.  ACPIIO_BATT_GET_BI[FX]
returns an acpi_bi[fx] structure built by using information obtained
from a _BIF or a _BIX object found on the system.  The revision number
field can be used to check which field is available.  The acpiconf(8)
utility will show additional information if _BIX is available.

Although ABIs of ACPIIO_BATT_* were changed, the existing APIs for
userland utilities are not changed and the backward-compatible ABIs
are provided.  This means that older versions of acpiconf(8) can also
work with the new kernel. The (union acpi_battery_ioctl_arg) was
padded to 256 byte long to avoid another ABI change in the future.
A _BIX object with its revision number >1 will be treated as
compatible with the rev.1 _BIX format.

Reviewed by:	takawata
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23728
2020-02-19 06:28:55 +00:00
Jung-uk Kim a009b7dcab Merge ACPICA 20191018. 2019-10-19 14:56:44 +00:00
Jung-uk Kim 278f0de60d Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
Cy Schubert 7aef71382b Fix 32-bit buildworld broken by r343438. 2019-01-25 20:53:29 +00:00
Takanori Watanabe 877fc2e350 Use ACPI TPM2 table to probe tpmtis and tpmcrb device.
Differential Revision: https://reviews.freebsd.org/D18937
2019-01-25 16:16:10 +00:00
Alexey Dokuchaev 2cb73efc0d Amend the `-i batt' option description and explain that the battery
is specified by its number (index), starting with zero.  Previously,
sometimes users would try to literally invoke `acpiconf -i batt' in
their console and become confused as to why this did not work.

Approved by:		bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D18659
2018-12-27 08:48:54 +00:00
Eugene Grosbein b25a469f94 rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
and runs scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is the port sysutils/cpupdate that defines
extra_commands="resume" to reload CPU microcode cleared
by suspend/resume sequence.

This change does nothing for a system having no scripts with KEYWORD: resume.

MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D15247
2018-10-27 17:21:13 +00:00
Jung-uk Kim 6f1f1a6395 Update ACPICA to 20181003.
Approved by:	re (gjb)
2018-10-09 18:40:36 +00:00
Jung-uk Kim 51f42bad71 Merge ACPICA 20180810. 2018-08-13 16:26:26 +00:00
Ben Widawsky 5857fba5fd acpidump(8): Add ACPI LPIT (Low Power Idle Table)
The LPIT is the part of the "standardized" way that one can enumerate
various power state information on Intel platforms.

The documentation for this change can be found here:
http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf

Reviewed By: jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D15931
2018-07-11 01:37:01 +00:00
Ed Maste 75e6ea22c5 acpidump.8: include NFIT in the man page list of tables
Was missed in r321298.

Reported by:	Ben Widawsky (in review D15931)
MFC after:	1 week
2018-06-20 19:40:54 +00:00
Jung-uk Kim ff879b0799 MFV: r329072
Merge ACPICA 20180209.
2018-02-09 21:49:38 +00:00
Dimitry Andric de82c38b72 Add explanatory comment for r327622: clang 6.0.0 and higher warn about
the ACPI_ROOT_OBJECT and ACPI_TO_POINTER macros from acpica's actypes.h
header, that they use arithmetic on a null pointer treated as a cast
from integer to pointer, which is a GNU extension.  We turn off the
warning, because this is in contributed code.

Requested by:	rakuco
2018-01-08 18:42:40 +00:00
Dimitry Andric ec2bf1e7b1 Revert r327338, undoing the changes to the ACPI_ADD_PTR and ACPI_SUB_PTR
macros.  Instead, turn off clang 6.0.0 warnings about null pointer
arithmetic in usr.sbin/acpi/acpidb instead.
2018-01-06 15:52:21 +00:00
Niclas Zeising fba6127915 Improve options and error handling.
Improve options handling and error out if multiple mutually exclusive
options are passed to acpiconf.  Switch from using atoi() to strtol() for
argument parsing, and add error checking and handling, instead of blindly
trusting that the integer conversion is OK.
Cange err() to errx() in once case, the errno value was garbage there.

Reviewed by:	emaste
Approved by:	emaste
Differential Revision:	D13430
2017-12-09 15:59:10 +00:00
Pedro F. Giffuni 1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Jung-uk Kim 67d9aa4422 Merge ACPICA 20170929 (take 2). 2017-10-10 19:33:24 +00:00
Jung-uk Kim d7bbccdd82 Revert r324109. This commit broke a number of systems.
Reported by:	lwhsu, kib
Requested by:	ngie
2017-09-30 20:28:50 +00:00
Jung-uk Kim c39c15e23f Merge ACPICA 20170929. 2017-09-29 23:02:49 +00:00
Scott Long ed26c389bf Add support for parsing the Watchdog Descriptor Table (WDDT)
Sponsored by:	Netflix
2017-09-15 15:41:07 +00:00
Jung-uk Kim 2f6a1a81bb Merge ACPICA 20170831. 2017-08-31 22:47:04 +00:00
Alexander Motin d4c2de2e0b Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.
It looked like incomplete copy/paste, printing absolute garbage.

While there, print ValidFields field ax hex, since it is a bitmask.

MFC after:	3 days
2017-08-31 09:08:06 +00:00
Alexander Motin fb1cf2a9e5 Add two NFIT fields missed in r321298.
MFC after:	2 weeks
2017-08-10 10:59:05 +00:00
Jung-uk Kim 5f9b24fa43 Merge ACPICA 20170728. 2017-07-28 22:23:29 +00:00
Ed Maste cebb7b191c acpidump: add GIC ITS srat type
From ACPI 6.2, 5.2.16.5

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-07-20 17:36:17 +00:00
Ed Maste 340c00225f acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11479
2017-07-20 17:31:27 +00:00