Fix acpica macros that subtract null pointersClang 13.0.0 produces a new -Werror warning about the ACPI_TO_INTEGER(p)and ACPI_OFFSET(d, f) macros in acpica's actypes.h: sys/contrib/dev/acpica
Fix acpica macros that subtract null pointersClang 13.0.0 produces a new -Werror warning about the ACPI_TO_INTEGER(p)and ACPI_OFFSET(d, f) macros in acpica's actypes.h: sys/contrib/dev/acpica/components/dispatcher/dsopcode.c:708:31: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ sys/contrib/dev/acpica/include/actypes.h:664:41: note: expanded from macro 'ACPI_PTR_TO_PHYSADDR' #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) ^~~~~~~~~~~~~~~~~~ sys/contrib/dev/acpica/include/actypes.h:661:41: note: expanded from macro 'ACPI_TO_INTEGER' #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sys/contrib/dev/acpica/include/actypes.h:656:82: note: expanded from macro 'ACPI_PTR_DIFF' #define ACPI_PTR_DIFF(a, b) ((ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b)))) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.This problem of undefined behavior was also reported to acpica by @cemin 2018: https://github.com/acpica/acpica/issues/407, but it seems therewas never any fix committed for it upstream.Instead fix these locally, for ACPI_TO_INTEGER by simply casting theincoming pointer to ACPI_SIZE (which corresponds roughly to uintptr_tand size_t), and for ACPI_OFFSET by reusing our __offsetof definitionfrom sys/cdefs.h.Reviewed by: emaste, kib, impDifferential Revision: https://reviews.freebsd.org/D31710(cherry picked from commit 130a690ae16e1b845629e586203b508eff699f38)
show more ...
MFV: r367652Merge ACPICA 20201113.
MFV: r366539Merge ACPICA 20200925.
MFV: r363292Merge ACPICA 20200717.
MFV: r361597Import ACPICA 20200528.
MFV: r360512Merge ACPICA 20200430.
Merge ACPICA 20200326.
MFV: r357927Merge ACPICA 20200214.
MFV: r356607Import ACPICA 20200110.
MFV: r355716Merge ACPICA 20191213.
Merge ACPICA 20191018.
MFV: r351091Fix the reported boot failures and revert r350510.Note this commit is effectively merging ACPICA 20190703 again and applyingan upstream patch.https://github.com/acpica/acpica/commi
MFV: r351091Fix the reported boot failures and revert r350510.Note this commit is effectively merging ACPICA 20190703 again and applyingan upstream patch.https://github.com/acpica/acpica/commit/73f6372Tested by: scottl
Enable ACPICA mutex debugging in INVARIANTS case.This lets us detect lock order reversal in ACPICA code to avoid deadlock.
Revert r349863 (ACPICA 20190703).This commit caused boot failures on some systems.Requested by: scottl
MFV: r349861Import ACPICA 20190703.
MFV: r347413Import ACPICA 20190509.
MFV: r345969Import ACPICA 20190405.
Merge ACPICA 20190329.
MFV: r344395Import ACPICA 20190215.
MFV: r342867Merge ACPICA 20190108.
MFV: r342049Merge ACPICA 20181213.
MFV: r339981Merge ACPICA 20181031.
Update ACPICA to 20181003.Approved by: re (gjb)
Merge ACPICA 20180810.
MFV: r335802Merge ACPICA 20180629.
12345