Date: Sat, 30 Jan 2021 01:41:11 GMT From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 385fb5d933b5 - main - acpica: Import ACPICA 20201217. Message-ID: <202101300141.10U1fBQ5074418@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=385fb5d933b55dbfe6f0eaf4d937ee89026c9ef5 commit 385fb5d933b55dbfe6f0eaf4d937ee89026c9ef5 Author: Jung-uk Kim <jkim@FreeBSD.org> AuthorDate: 2021-01-04 22:20:55 +0000 Commit: Jung-uk Kim <jkim@FreeBSD.org> CommitDate: 2021-01-30 00:48:02 +0000 acpica: Import ACPICA 20201217. (cherry picked from commit a4634ed7779f0905e3bfeb781e58d40a5bdf9bb7) --- sys/contrib/dev/acpica/changes.txt | 35 ++++++++++++++++++++++ sys/contrib/dev/acpica/compiler/aslanalyze.c | 2 +- sys/contrib/dev/acpica/compiler/aslcompiler.l | 4 +-- sys/contrib/dev/acpica/compiler/aslerror.c | 2 +- sys/contrib/dev/acpica/compiler/aslmethod.c | 1 + sys/contrib/dev/acpica/compiler/aslparseop.c | 4 +-- sys/contrib/dev/acpica/compiler/aslwalks.c | 2 +- sys/contrib/dev/acpica/compiler/dtfield.c | 2 +- sys/contrib/dev/acpica/compiler/dttemplate.c | 3 +- .../dev/acpica/components/debugger/dbinput.c | 4 +-- .../dev/acpica/components/debugger/dbobject.c | 2 +- .../dev/acpica/components/disassembler/dmwalk.c | 8 ++--- .../dev/acpica/components/dispatcher/dscontrol.c | 2 +- .../dev/acpica/components/dispatcher/dsdebug.c | 2 +- .../dev/acpica/components/dispatcher/dswexec.c | 3 +- .../dev/acpica/components/dispatcher/dswload.c | 2 +- .../dev/acpica/components/dispatcher/dswload2.c | 2 +- .../dev/acpica/components/executer/exfldio.c | 2 +- .../dev/acpica/components/executer/exresop.c | 4 +-- .../dev/acpica/components/executer/exstore.c | 4 +-- sys/contrib/dev/acpica/components/hardware/hwgpe.c | 2 +- sys/contrib/dev/acpica/components/parser/psloop.c | 3 +- sys/contrib/dev/acpica/components/parser/psparse.c | 2 +- .../dev/acpica/components/utilities/utdelete.c | 2 +- .../dev/acpica/components/utilities/utstrsuppt.c | 4 +-- sys/contrib/dev/acpica/include/acexcep.h | 10 +++---- sys/contrib/dev/acpica/include/acpixf.h | 2 +- sys/contrib/dev/acpica/include/actypes.h | 5 ++++ sys/contrib/dev/acpica/include/platform/acgcc.h | 15 ++++++++++ 29 files changed, 95 insertions(+), 40 deletions(-) diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index e7cc572a0cc3..d27547d31b76 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,5 +1,40 @@ ---------------------------------------- +17 December 2020. Summary of changes for version 20201217: +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Note: The implementation of ACPI 6.4 is underway, and is expected to be +mostly finished next month, when ACPI 6.4 is released. + +From qzed:- fixed-ae-class-macros. Fix exception code class checks. Added +several new macros, such as ACPI_CNTL_EXCEPTION(Status) in order to +enable this. + +AcpiExec/iASL/AcpiHelp: Added a few changes for support of GCC 10.2.0. +These included a few casts, as well as a null pointer check. + +Fix -Wfallthrough: GCC 7.1 gained -Wimplicit-fallthrough to warn on +implicit fallthrough, as well as __attribute__((__fallthrough__)) and +comments to explicitly denote that cases of fallthrough were intentional. +Clang also supports this warning and statement attribute, but not the +comment form. Added a new macro, ACPI_FALLTHROUGH to support this feature +of GCC. With assistance from @nickdesaulniers. + +2) iASL Compiler/Disassembler and ACPICA tools: + +Added improvement to method call analysis by saving the return type and +relaxing certain cases of type checking. + +iASL Table Compiler: Improved info messages. Added a message to the -T +option for when the default template (DSDT) is used. +Also added a note for when multiple SSDTs are created with a DSDT that +the SSDTs are created in the same file as the DSDT. + + +---------------------------------------- 13 November 2020. Summary of changes for version 20201113: diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c index df37dac214ab..fe1f2f8cd410 100644 --- a/sys/contrib/dev/acpica/compiler/aslanalyze.c +++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c @@ -470,7 +470,7 @@ AnCheckMethodReturnValue ( "Method returns [%s], %s operator requires [%s]", AslGbl_StringBuffer, OpInfo->Name, AslGbl_StringBuffer2); - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer); + AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer); } } diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l index 524dd0a67ff5..3127447710a5 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.l +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l @@ -812,9 +812,9 @@ NamePathTail [.]{NameSeg} "__PATH__" { count (0); return (PARSEOP___PATH__); } "__METHOD__" { count (0); return (PARSEOP___METHOD__); } "__EXPECT__"{ErrorCode} { char *s; - int index = 0; + unsigned int index = 0; count (0); - while (!isdigit (AslCompilertext[index])) + while (!isdigit ((int) AslCompilertext[index])) { index++; } diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c index 924e8d715712..48ac99ef62c2 100644 --- a/sys/contrib/dev/acpica/compiler/aslerror.c +++ b/sys/contrib/dev/acpica/compiler/aslerror.c @@ -1456,7 +1456,7 @@ AslIsExceptionDisabled ( { return (TRUE); } - /* Fall through */ + ACPI_FALLTHROUGH; case ASL_WARNING: case ASL_REMARK: diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c index 859e0d8e69ac..e474b957074d 100644 --- a/sys/contrib/dev/acpica/compiler/aslmethod.c +++ b/sys/contrib/dev/acpica/compiler/aslmethod.c @@ -288,6 +288,7 @@ MtMethodAnalysisWalkBegin ( NextType = Next->Asl.Child; MethodInfo->ValidReturnTypes = MtProcessTypeOp (NextType); + Op->Asl.AcpiBtype |= MethodInfo->ValidReturnTypes; /* Get the ParameterType node */ diff --git a/sys/contrib/dev/acpica/compiler/aslparseop.c b/sys/contrib/dev/acpica/compiler/aslparseop.c index c3b9630a53fe..e21f91509aa4 100644 --- a/sys/contrib/dev/acpica/compiler/aslparseop.c +++ b/sys/contrib/dev/acpica/compiler/aslparseop.c @@ -414,7 +414,7 @@ TrCreateValuedLeafOp ( for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { - if (islower (Op->Asl.Value.Name[i])) + if (islower ((int) Op->Asl.Value.Name[i])) { AcpiUtStrupr (&Op->Asl.Value.Name[i]); AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMESEG, Op, Op->Asl.Value.Name); @@ -431,7 +431,7 @@ TrCreateValuedLeafOp ( StringPtr = Op->Asl.Value.Name; for (i = 0; *StringPtr; i++) { - if (islower (*StringPtr)) + if (islower ((int) *StringPtr)) { AcpiUtStrupr (&Op->Asl.Value.Name[i]); AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMEPATH, Op, Op->Asl.Value.Name); diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c index 09bf205f5f8d..902a1700718b 100644 --- a/sys/contrib/dev/acpica/compiler/aslwalks.c +++ b/sys/contrib/dev/acpica/compiler/aslwalks.c @@ -516,7 +516,7 @@ AnOperandTypecheckWalkEnd ( break; } - /* Fallthrough */ + ACPI_FALLTHROUGH; case ARGI_STORE_TARGET: diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c index ab9f7903f033..b81f77edf733 100644 --- a/sys/contrib/dev/acpica/compiler/dtfield.c +++ b/sys/contrib/dev/acpica/compiler/dtfield.c @@ -227,7 +227,7 @@ DtCompileOneField ( break; } - /* Fall through. */ + ACPI_FALLTHROUGH; case DT_FIELD_TYPE_BUFFER: diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c index 1beb67ac3b34..ad15f6e74bf0 100644 --- a/sys/contrib/dev/acpica/compiler/dttemplate.c +++ b/sys/contrib/dev/acpica/compiler/dttemplate.c @@ -255,6 +255,7 @@ DtCreateTemplates ( if (AcpiGbl_Optind < 3) { + fprintf (stderr, "Creating default template: [DSDT]\n"); Status = DtCreateOneTemplateFile (ACPI_SIG_DSDT, 0); goto Exit; } @@ -640,7 +641,7 @@ DtCreateOneTemplate ( { fprintf (stderr, "Created ACPI table templates for [%4.4s] " - "and %u [SSDT], written to \"%s\"\n", + "and %u [SSDT] in same file, written to \"%s\"\n", Signature, TableCount, DisasmFilename); } diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c index 50463d06d461..76a3aa112299 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbinput.c +++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c @@ -642,7 +642,7 @@ AcpiDbGetNextToken ( /* Remove any spaces at the beginning, ignore blank lines */ - while (*String && isspace (*String)) + while (*String && isspace ((int) *String)) { String++; } @@ -754,7 +754,7 @@ AcpiDbGetNextToken ( /* Find end of token */ - while (*String && !isspace (*String)) + while (*String && !isspace ((int) *String)) { String++; } diff --git a/sys/contrib/dev/acpica/components/debugger/dbobject.c b/sys/contrib/dev/acpica/components/debugger/dbobject.c index f6bca7ea65b1..eb38f1315e73 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbobject.c +++ b/sys/contrib/dev/acpica/components/debugger/dbobject.c @@ -201,7 +201,7 @@ AcpiDbDumpMethodInfo ( /* Ignore control codes, they are not errors */ - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (Status)) { return; } diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c index 88658cfac8f8..5c41c5a2e308 100644 --- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c +++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c @@ -400,7 +400,7 @@ AcpiDmBlockType ( return (BLOCK_NONE); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_PACKAGE_OP: case AML_VARIABLE_PACKAGE_OP: @@ -422,7 +422,7 @@ AcpiDmBlockType ( return (BLOCK_NONE); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: @@ -688,7 +688,7 @@ AcpiDmDescendingOp ( return (AE_OK); } - /* Fallthrough */ + ACPI_FALLTHROUGH; default: @@ -772,7 +772,7 @@ AcpiDmDescendingOp ( AcpiDmNamestring (NextOp->Common.Value.Name); AcpiOsPrintf (", "); - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c index 5452cc8e763b..22821f258ce3 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c @@ -210,7 +210,7 @@ AcpiDsExecBeginControlOp ( } } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_IF_OP: /* diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c index 42566e7ce7cf..33ed97ce8f87 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c @@ -254,7 +254,7 @@ AcpiDsDumpMethodStack ( /* Ignore control codes, they are not errors */ - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (Status)) { return_VOID; } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c index 267cca7e6507..329e29749046 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c @@ -772,8 +772,7 @@ AcpiDsExecEndOp ( break; } - /* Fall through */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case AML_INT_EVAL_SUBTREE_OP: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c index 02b215aff735..0bd36d81c623 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c @@ -375,7 +375,7 @@ AcpiDsLoad1BeginOp ( break; } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c index e47f0c23d47a..7c1994296459 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c @@ -366,7 +366,7 @@ AcpiDsLoad2BeginOp ( break; } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c index 3f9407e80f09..7ca430b267a2 100644 --- a/sys/contrib/dev/acpica/components/executer/exfldio.c +++ b/sys/contrib/dev/acpica/components/executer/exfldio.c @@ -616,7 +616,7 @@ AcpiExFieldDatumIo ( * RegionField case and write the datum to the Operation Region */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_LOCAL_REGION_FIELD: /* diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c index ad9f0132ee05..4ed21ab6aec0 100644 --- a/sys/contrib/dev/acpica/components/executer/exresop.c +++ b/sys/contrib/dev/acpica/components/executer/exresop.c @@ -358,7 +358,7 @@ AcpiExResolveOperands ( TargetOp = AML_DEBUG_OP; - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_LOCAL: @@ -422,7 +422,7 @@ AcpiExResolveOperands ( * Else not a string - fall through to the normal Reference * case below */ - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ARGI_REFERENCE: /* References: */ case ARGI_INTEGER_REF: diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c index f90b702627af..067ee8b9e4bb 100644 --- a/sys/contrib/dev/acpica/components/executer/exstore.c +++ b/sys/contrib/dev/acpica/components/executer/exstore.c @@ -248,7 +248,7 @@ AcpiExStore ( return_ACPI_STATUS (AE_OK); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; default: @@ -585,7 +585,7 @@ AcpiExStoreObjectToNode ( break; } - /* Fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_DEVICE: case ACPI_TYPE_EVENT: diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c index 8d8ab0a11211..f645396b136d 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c +++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c @@ -254,7 +254,7 @@ AcpiHwLowSetGpe ( return (AE_BAD_PARAMETER); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_GPE_ENABLE: diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c index 781575cfaf7a..2d56407c5bcf 100644 --- a/sys/contrib/dev/acpica/components/parser/psloop.c +++ b/sys/contrib/dev/acpica/components/parser/psloop.c @@ -410,8 +410,7 @@ AcpiPsParseLoop ( */ WalkState->Op = NULL; Status = AcpiDsGetPredicateValue (WalkState, ACPI_TO_POINTER (TRUE)); - if (ACPI_FAILURE (Status) && - ((Status & AE_CODE_MASK) != AE_CODE_CONTROL)) + if (ACPI_FAILURE (Status) && !ACPI_CNTL_EXCEPTION (Status)) { if (Status == AE_AML_NO_RETURN_VALUE) { diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c index 75ec3dca1aad..41a8e4626287 100644 --- a/sys/contrib/dev/acpica/components/parser/psparse.c +++ b/sys/contrib/dev/acpica/components/parser/psparse.c @@ -533,7 +533,7 @@ AcpiPsNextParseState ( default: Status = CallbackStatus; - if ((CallbackStatus & AE_CODE_MASK) == AE_CODE_CONTROL) + if (ACPI_CNTL_EXCEPTION (CallbackStatus)) { Status = AE_OK; } diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c index 032bf9fae7bf..8ce9196343ca 100644 --- a/sys/contrib/dev/acpica/components/utilities/utdelete.c +++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c @@ -266,7 +266,7 @@ AcpiUtDeleteInternalObj ( (void) AcpiEvDeleteGpeBlock (Object->Device.GpeBlock); } - /*lint -fallthrough */ + ACPI_FALLTHROUGH; case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: diff --git a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c index 3c5e591735b0..18e95a254e0d 100644 --- a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c +++ b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c @@ -274,7 +274,7 @@ AcpiUtConvertDecimalString ( * 1) Runtime: terminate with no error, per the ACPI spec * 2) Compiler: return an error */ - if (!isdigit (*String)) + if (!isdigit ((int) *String)) { #ifdef ACPI_ASL_COMPILER Status = AE_BAD_DECIMAL_CONSTANT; @@ -336,7 +336,7 @@ AcpiUtConvertHexString ( * 1) Runtime: terminate with no error, per the ACPI spec * 2) Compiler: return an error */ - if (!isxdigit (*String)) + if (!isxdigit ((int) *String)) { #ifdef ACPI_ASL_COMPILER Status = AE_BAD_HEX_CONSTANT; diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h index 11c81398e915..8cbd75498642 100644 --- a/sys/contrib/dev/acpica/include/acexcep.h +++ b/sys/contrib/dev/acpica/include/acexcep.h @@ -204,11 +204,11 @@ typedef struct acpi_exception_info #define AE_OK (ACPI_STATUS) 0x0000 -#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL) -#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML) -#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER) -#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES) -#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL) +#define ACPI_ENV_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ENVIRONMENTAL) +#define ACPI_AML_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_AML) +#define ACPI_PROG_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_PROGRAMMER) +#define ACPI_TABLE_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ACPI_TABLES) +#define ACPI_CNTL_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_CONTROL) /* diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index 60eb6818b7e3..3e00747aebca 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20201113 +#define ACPI_CA_VERSION 0x20201217 #include <contrib/dev/acpica/include/acconfig.h> #include <contrib/dev/acpica/include/actypes.h> diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h index 48388c2198ed..1f0a189ab4ba 100644 --- a/sys/contrib/dev/acpica/include/actypes.h +++ b/sys/contrib/dev/acpica/include/actypes.h @@ -1537,5 +1537,10 @@ typedef enum #define ACPI_OPT_END -1 +/* Definitions for explicit fallthrough */ + +#ifndef ACPI_FALLTHROUGH +#define ACPI_FALLTHROUGH do {} while(0) +#endif #endif /* __ACTYPES_H__ */ diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h index 1b48d6040c64..29ee8a30307a 100644 --- a/sys/contrib/dev/acpica/include/platform/acgcc.h +++ b/sys/contrib/dev/acpica/include/platform/acgcc.h @@ -198,4 +198,19 @@ typedef __builtin_va_list va_list; #define ACPI_USE_NATIVE_MATH64 +/* GCC did not support __has_attribute until 5.1. */ + +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + +/* + * Explictly mark intentional explicit fallthrough to silence + * -Wimplicit-fallthrough in GCC 7.1+. + */ + +#if __has_attribute(__fallthrough__) +#define ACPI_FALLTHROUGH __attribute__((__fallthrough__)) +#endif + #endif /* __ACGCC_H__ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101300141.10U1fBQ5074418>