--- ./source/compiler/aslanalyze.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c 2018-04-10 19:35:34.491034616 +0300 @@ -355,7 +355,7 @@ */ if (ThisNodeBtype != 0) { - sprintf (MsgBuffer, + snprintf (MsgBuffer, sizeof(MsgBuffer), "Method returns [%s], %s operator requires [%s]", StringBuffer, OpInfo->Name, StringBuffer2); --- ./source/compiler/aslcompiler.h 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h 2018-05-05 05:21:37.595959872 +0300 @@ -1105,6 +1105,7 @@ UINT8 Event); void + UtDisplaySummary ( UINT32 FileId); --- ./source/compiler/aslerror.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslerror.c 2018-04-10 19:35:34.501439617 +0300 @@ -1268,7 +1268,7 @@ BOOLEAN Abort) { - sprintf (MsgBuffer, "%s %s", AcpiFormatException (Status), ExtraMessage); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s %s", AcpiFormatException (Status), ExtraMessage); if (Op) { --- ./source/compiler/aslfileio.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslfileio.c 2018-04-10 19:35:34.502806290 +0300 @@ -68,7 +68,7 @@ UINT8 ErrorId) { - sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename, + snprintf (MsgBuffer, sizeof(MsgBuffer), "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename, Gbl_Files[FileId].Description, strerror (errno)); AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer); --- ./source/compiler/aslfiles.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslfiles.c 2018-04-10 19:35:34.503831557 +0300 @@ -450,7 +450,7 @@ /* We could not open the include file after trying very hard */ ErrorExit: - sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno)); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s, %s", Op->Asl.Value.String, strerror (errno)); AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer); } --- ./source/compiler/aslload.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslload.c 2018-05-05 05:21:37.597804184 +0300 @@ -684,7 +684,7 @@ * Which is used to workaround the fact that the MS interpreter * does not allow Scope() forward references. */ - sprintf (MsgBuffer, "%s [%s], changing type to [Scope]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s [%s], changing type to [Scope]", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_REMARK, ASL_MSG_SCOPE_TYPE, Op, MsgBuffer); @@ -703,7 +703,7 @@ /* All other types are an error */ - sprintf (MsgBuffer, "%s [%s]", Op->Asl.ExternalName, + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s [%s]", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_SCOPE_TYPE, Op, MsgBuffer); --- ./source/compiler/asllookup.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/asllookup.c 2018-04-10 19:35:34.964086786 +0300 @@ -228,7 +228,7 @@ * Issue a remark even if it is a reserved name (starts * with an underscore). */ - sprintf (MsgBuffer, "Name [%4.4s] is within a method [%4.4s]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Name [%4.4s] is within a method [%4.4s]", Node->Name.Ascii, Next->Name.Ascii); AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), MsgBuffer); --- ./source/compiler/aslpredef.c 2018-04-27 22:45:00.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslpredef.c 2018-04-10 19:35:35.015559033 +0300 @@ -114,7 +114,7 @@ if (MethodInfo->NumArguments != 0) { - sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s requires %u", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); @@ -136,7 +136,7 @@ if (MethodInfo->NumArguments != RequiredArgCount) { - sprintf (MsgBuffer, "%4.4s requires %u", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s requires %u", ThisName->Info.Name, RequiredArgCount); if (MethodInfo->NumArguments < RequiredArgCount) @@ -162,7 +162,7 @@ AcpiUtGetExpectedReturnTypes (StringBuffer, ThisName->Info.ExpectedBtypes); - sprintf (MsgBuffer, "%s required for %4.4s", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s required for %4.4s", StringBuffer, ThisName->Info.Name); AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, @@ -700,12 +700,12 @@ if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { - sprintf (MsgBuffer, "%4.4s: found %s, %s required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s, %s required", PredefinedName, TypeName, StringBuffer); } else { - sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s at index %u, %s required", PredefinedName, TypeName, PackageIndex, StringBuffer); } --- ./source/compiler/aslprepkg.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslprepkg.c 2018-04-10 19:35:35.016699964 +0300 @@ -809,7 +809,7 @@ UINT32 ExpectedCount) { - sprintf (MsgBuffer, "%s: length %u, required minimum is %u", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length %u, required minimum is %u", PredefinedName, Count, ExpectedCount); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); @@ -838,7 +838,7 @@ ACPI_PARSE_OBJECT *Op) { - sprintf (MsgBuffer, "%s: length is zero", PredefinedName); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length is zero", PredefinedName); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); } @@ -867,7 +867,7 @@ UINT32 ExpectedCount) { - sprintf (MsgBuffer, "%s: length is %u, only %u required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length is %u, only %u required", PredefinedName, Count, ExpectedCount); AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); --- ./source/compiler/aslutils.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslutils.c 2018-05-05 05:21:37.600341125 +0300 @@ -434,7 +434,7 @@ /* Compiler name and version number */ FlPrintFile (FileId, "%s version %X [%s]\n\n", - ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, __DATE__); + ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, "2017-01-19"); } /* Summary of main input and output files */ @@ -562,7 +562,7 @@ if ((Op->Asl.Value.Integer < LowValue) || (Op->Asl.Value.Integer > HighValue)) { - sprintf (MsgBuffer, "0x%X, allowable: 0x%X-0x%X", + snprintf (MsgBuffer, sizeof(MsgBuffer), "0x%X, allowable: 0x%X-0x%X", (UINT32) Op->Asl.Value.Integer, LowValue, HighValue); AslError (ASL_ERROR, ASL_MSG_RANGE, Op, MsgBuffer); @@ -788,7 +788,7 @@ Status = AcpiUtStrtoul64 (String, &ConvertedInteger); if (ACPI_FAILURE (Status)) { - sprintf (ErrBuf, "While creating 64-bit constant: %s\n", + snprintf (ErrBuf, sizeof(ErrBuf), "While creating 64-bit constant: %s\n", AcpiFormatException (Status)); AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber, --- ./source/compiler/aslwalks.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslwalks.c 2018-04-10 19:35:35.044517597 +0300 @@ -511,7 +511,7 @@ AnFormatBtype (StringBuffer, ThisNodeBtype); AnFormatBtype (StringBuffer2, RequiredBtypes); - sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "[%s] found, %s operator requires [%s]", StringBuffer, OpInfo->Name, StringBuffer2); AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, --- ./source/compiler/aslxref.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/aslxref.c 2018-05-05 05:21:37.600985698 +0300 @@ -773,7 +773,7 @@ if (Message) { - sprintf (MsgBuffer, + snprintf (MsgBuffer, sizeof(MsgBuffer), "Size mismatch, Tag: %u bit%s, Field: %u bit%s", TagBitLength, (TagBitLength > 1) ? "s" : "", FieldBitLength, (FieldBitLength > 1) ? "s" : ""); @@ -844,7 +844,7 @@ */ if (Node->Type != ACPI_TYPE_METHOD) { - sprintf (MsgBuffer, "%s is a %s", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s is a %s", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer); @@ -885,7 +885,7 @@ */ if (PassedArgs != Node->Value) { - sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s requires %u", Op->Asl.ExternalName, Node->Value); if (PassedArgs < Node->Value) --- ./source/compiler/dtcompile.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/dtcompile.c 2018-04-10 19:35:35.051560710 +0300 @@ -215,7 +215,8 @@ Gbl_RootTable = NULL; Gbl_SubtableStack = NULL; - sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION); + snprintf (VersionString, sizeof(VersionString), "%X", + (UINT32) ACPI_CA_VERSION); return (AE_OK); } @@ -296,7 +297,7 @@ Signature = DtGetFieldValue (*FieldList); if (!Signature) { - sprintf (MsgBuffer, "Expected \"%s\"", "Signature"); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", "Signature"); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, *FieldList, MsgBuffer); return (AE_ERROR); @@ -504,7 +505,7 @@ if (!LocalField) { - sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Found NULL field - Field name \"%s\" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); Status = AE_BAD_DATA; --- ./source/compiler/dtfield.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/dtfield.c 2018-04-10 19:35:35.054112387 +0300 @@ -172,7 +172,7 @@ if (Length > ByteLength) { - sprintf (MsgBuffer, "Maximum %u characters", ByteLength); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Maximum %u characters", ByteLength); DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer); Length = ByteLength; } @@ -252,7 +252,7 @@ Status = AuValidateUuid (InString); if (ACPI_FAILURE (Status)) { - sprintf (MsgBuffer, "%s", Field->Value); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s", Field->Value); DtNameError (ASL_ERROR, ASL_MSG_INVALID_UUID, Field, MsgBuffer); } else @@ -354,7 +354,7 @@ if (Value > MaxValue) { - sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%8.8X%8.8X - max %u bytes", ACPI_FORMAT_UINT64 (Value), ByteLength); DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } @@ -604,7 +604,7 @@ if (Value >= ((UINT64) 1 << BitLength)) { - sprintf (MsgBuffer, "Maximum %u bit", BitLength); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Maximum %u bit", BitLength); DtError (ASL_ERROR, ASL_MSG_FLAG_VALUE, Field, MsgBuffer); Value = 0; } --- ./source/compiler/dtsubtable.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/dtsubtable.c 2018-04-10 19:35:35.057954675 +0300 @@ -347,7 +347,7 @@ Error: if (!Field) { - sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Found NULL field - Field name \"%s\" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); } --- ./source/compiler/dtutils.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/dtutils.c 2018-04-10 19:35:35.067540874 +0300 @@ -532,7 +532,7 @@ else { /* At this point, this is a fatal error */ - sprintf (MsgBuffer, "Expected \"%s\"", Info->Name); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); return (0); } @@ -564,7 +564,7 @@ else { /* At this point, this is a fatal error */ - sprintf (MsgBuffer, "Expected \"%s\"", Info->Name); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); return (0); } --- ./source/compiler/prutils.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/compiler/prutils.c 2018-04-10 19:35:35.073538953 +0300 @@ -303,7 +303,8 @@ /* We could not open the include file after trying very hard */ ErrorExit: - sprintf (Gbl_MainTokenBuffer, "%s, %s", Filename, strerror (errno)); + snprintf (Gbl_MainTokenBuffer, ASL_DEFAULT_LINE_BUFFER_SIZE, "%s, %s", + Filename, strerror (errno)); PrError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, 0); return (NULL); } --- ./source/components/debugger/dbcmds.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbcmds.c 2018-04-10 19:35:35.076147555 +0300 @@ -1035,7 +1035,7 @@ * tests both the AML->Resource conversion and the Resource->AML * conversion. */ - (void) AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS); + (void) AcpiDmTestResourceConversion (Node, __UNCONST(METHOD_NAME__CRS)); /* Execute _SRS with the resource list */ --- ./source/components/debugger/dbdisply.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbdisply.c 2018-04-10 19:35:35.078118115 +0300 @@ -111,11 +111,11 @@ static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] = { - {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"}, - {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"}, - {&AcpiGbl_TableHandler, "ACPI Table Events"}, - {&AcpiGbl_ExceptionHandler, "Control Method Exceptions"}, - {&AcpiGbl_InterfaceHandler, "OSI Invocations"} + {&AcpiGbl_GlobalNotify[0].Handler, __UNCONST("System Notifications")}, + {&AcpiGbl_GlobalNotify[1].Handler, __UNCONST("Device Notifications")}, + {&AcpiGbl_TableHandler, __UNCONST("ACPI Table Events")}, + {&AcpiGbl_ExceptionHandler, __UNCONST("Control Method Exceptions")}, + {&AcpiGbl_InterfaceHandler, __UNCONST("OSI Invocations")} }; @@ -847,7 +847,7 @@ ACPI_GPE_XRUPT_INFO *GpeXruptInfo; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; - char *GpeType; + const char *GpeType; ACPI_GPE_NOTIFY_INFO *Notify; UINT32 GpeIndex; UINT32 Block = 0; --- ./source/components/debugger/dbexec.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbexec.c 2018-04-10 19:35:35.079122777 +0300 @@ -334,6 +334,7 @@ * ******************************************************************************/ +#ifdef ACPI_DEBUG_OUTPUT static UINT32 AcpiDbGetOutstandingAllocations ( void) @@ -350,6 +351,7 @@ return (Outstanding); } +#endif /******************************************************************************* --- ./source/components/debugger/dbinput.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbinput.c 2018-04-10 19:35:35.081870861 +0300 @@ -371,7 +371,7 @@ const char *Command, const ACPI_DB_COMMAND_HELP *Help) { - char *Invocation = Help->Invocation; + const char *Invocation = Help->Invocation; UINT32 LineCount; @@ -989,8 +989,7 @@ break; case CMD_METHODS: - - Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]); + Status = AcpiDbDisplayObjects (__UNCONST("METHOD"), AcpiGbl_DbArgs[1]); break; case CMD_NAMESPACE: --- ./source/components/debugger/dbnames.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbnames.c 2018-05-05 05:21:37.603356956 +0300 @@ -205,7 +205,7 @@ } if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf), - "\\")) + __UNCONST("\\"))) { Status = AE_BUFFER_OVERFLOW; goto ErrorExit; --- ./source/components/debugger/dbtest.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/debugger/dbtest.c 2018-05-05 05:21:37.604454435 +0300 @@ -755,7 +755,7 @@ ACPI_OBJECT *Temp1 = NULL; ACPI_OBJECT *Temp2 = NULL; ACPI_OBJECT *Temp3 = NULL; - char *ValueToWrite = "Test String from AML Debugger"; + char *ValueToWrite = __UNCONST("Test String from AML Debugger"); ACPI_OBJECT WriteValue; ACPI_STATUS Status; @@ -1139,7 +1139,7 @@ case ACPI_TYPE_STRING: ThisParam->String.Pointer = - "This is the default argument string"; + __UNCONST("This is the default argument string"); ThisParam->String.Length = strlen (ThisParam->String.Pointer); break; --- ./source/components/disassembler/dmcstyle.c 2018-04-27 22:45:01.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/disassembler/dmcstyle.c 2018-04-10 19:35:35.090729127 +0300 @@ -55,7 +55,7 @@ /* Local prototypes */ -static char * +static const char * AcpiDmGetCompoundSymbol ( UINT16 AslOpcode); @@ -100,7 +100,7 @@ ACPI_PARSE_OBJECT *Op, ACPI_OP_WALK_INFO *Info) { - char *OperatorSymbol = NULL; + const char *OperatorSymbol = NULL; ACPI_PARSE_OBJECT *Argument1; ACPI_PARSE_OBJECT *Argument2; ACPI_PARSE_OBJECT *Target; @@ -820,11 +820,11 @@ * ******************************************************************************/ -static char * +static const char * AcpiDmGetCompoundSymbol ( UINT16 AmlOpcode) { - char *Symbol; + const char *Symbol; switch (AmlOpcode) --- ./source/components/disassembler/dmresrcl2.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/disassembler/dmresrcl2.c 2018-04-10 19:35:35.096430152 +0300 @@ -45,6 +45,10 @@ #include "accommon.h" #include "acdisasm.h" +#ifdef _KERNEL +#define MpSaveGpioInfo(a, b, c, d, e) +#define MpSaveSerialInfo(a, b, c) +#endif #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcl2") @@ -199,7 +203,7 @@ if (Resource->Gpio.ResSourceOffset) { DeviceName = ACPI_ADD_PTR (char, - Resource, Resource->Gpio.ResSourceOffset), + Resource, Resource->Gpio.ResSourceOffset); AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); } --- ./source/components/dispatcher/dscontrol.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/dispatcher/dscontrol.c 2018-04-10 19:35:35.100397115 +0300 @@ -366,7 +366,7 @@ /* Call to the OSL in case OS wants a piece of the action */ Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT, - "Executed AML Breakpoint opcode"); + __UNCONST("Executed AML Breakpoint opcode")); break; case AML_BREAK_OP: --- ./source/components/dispatcher/dspkginit.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/dispatcher/dspkginit.c 2018-04-10 19:35:35.107496593 +0300 @@ -416,7 +416,7 @@ ACPI_OPERAND_OBJECT *Element = *ElementPtr; ACPI_NAMESPACE_NODE *ResolvedNode; ACPI_NAMESPACE_NODE *OriginalNode; - char *ExternalPath = ""; + char *ExternalPath = __UNCONST(""); ACPI_OBJECT_TYPE Type; --- ./source/components/executer/exdebug.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/executer/exdebug.c 2018-04-10 19:35:35.199152395 +0300 @@ -66,10 +66,9 @@ * * This function is not compiled if ACPI_NO_ERROR_MESSAGES is set. * - * This function is only enabled if AcpiGbl_EnableAmlDebugObject is set, or - * if ACPI_LV_DEBUG_OBJECT is set in the AcpiDbgLevel. Thus, in the normal - * operational case, stores to the debug object are ignored but can be easily - * enabled if necessary. + * This function is only enabled if AcpiGbl_EnableAmlDebugObject is set. + * Thus, in the normal operational case, stores to the debug object are + * ignored but can be easily enabled if necessary. * ******************************************************************************/ @@ -88,10 +87,9 @@ ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); - /* Output must be enabled via the DebugObject global or the DbgLevel */ + /* Output must be enabled via the DebugObject global */ - if (!AcpiGbl_EnableAmlDebugObject && - !(AcpiDbgLevel & ACPI_LV_DEBUG_OBJECT)) + if (!AcpiGbl_EnableAmlDebugObject) { return_VOID; } --- ./source/components/executer/exdump.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/executer/exdump.c 2018-04-10 19:35:35.200638854 +0300 @@ -408,7 +408,7 @@ } Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset); - Name = Info->Name; + Name = __UNCONST(Info->Name); switch (Info->Opcode) { --- ./source/components/hardware/hwesleep.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/hardware/hwesleep.c 2018-04-10 19:35:35.412828980 +0300 @@ -252,8 +252,8 @@ /* Execute the wake methods */ - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), ACPI_SST_WAKING); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__WAK), SleepState); /* * Some BIOS code assumes that WAK_STS will be cleared on resume @@ -263,6 +263,6 @@ (void) AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus); AcpiGbl_SystemAwakeAndRunning = TRUE; - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), ACPI_SST_WORKING); return_ACPI_STATUS (AE_OK); } --- ./source/components/hardware/hwsleep.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/hardware/hwsleep.c 2018-04-10 19:35:35.415635455 +0300 @@ -304,7 +304,7 @@ /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID; - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), ACPI_SST_WAKING); /* * GPEs must be enabled before _WAK is called as GPEs @@ -330,7 +330,7 @@ * Now we can execute _WAK, etc. Some machines require that the GPEs * are enabled before the wake methods are executed. */ - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__WAK), SleepState); /* * Some BIOS code assumes that WAK_STS will be cleared on resume @@ -351,7 +351,7 @@ AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), ACPI_SST_WORKING); return_ACPI_STATUS (Status); } --- ./source/components/hardware/hwxfsleep.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/hardware/hwxfsleep.c 2018-04-10 19:35:35.418062108 +0300 @@ -403,7 +403,7 @@ * Set the system indicators to show the desired sleep state. * _SST is an optional method (return no error if not found) */ - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue); + AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), SstValue); return_ACPI_STATUS (AE_OK); } --- ./source/components/namespace/nsaccess.c 2018-04-27 22:45:02.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/namespace/nsaccess.c 2018-04-10 19:35:36.892000229 +0300 @@ -146,7 +146,7 @@ if (!Val) { - Val = InitVal->Val; + Val = __UNCONST(InitVal->Val); } /* @@ -383,7 +383,7 @@ NumSegments = 0; ThisNode = AcpiGbl_RootNode; - Path = ""; + Path = __UNCONST(""); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Null Pathname (Zero segments), Flags=%X\n", Flags)); --- ./source/components/namespace/nsrepair2.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/namespace/nsrepair2.c 2018-04-10 19:35:36.904625768 +0300 @@ -121,7 +121,7 @@ UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, - char *SortKeyName); + const char *SortKeyName); /* Values for SortDirection above */ @@ -870,7 +870,7 @@ UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, - char *SortKeyName) + const char *SortKeyName) { UINT32 OuterElementCount; ACPI_OPERAND_OBJECT **OuterElements; --- ./source/components/namespace/nsxfeval.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/namespace/nsxfeval.c 2018-04-10 19:35:36.908250906 +0300 @@ -84,7 +84,7 @@ ACPI_STATUS AcpiEvaluateObjectTyped ( ACPI_HANDLE Handle, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_OBJECT_LIST *ExternalParams, ACPI_BUFFER *ReturnBuffer, ACPI_OBJECT_TYPE ReturnType) @@ -94,7 +94,6 @@ ACPI_HANDLE TargetHandle; char *FullPathname; - ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped); @@ -216,7 +215,7 @@ ACPI_STATUS AcpiEvaluateObject ( ACPI_HANDLE Handle, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_OBJECT_LIST *ExternalParams, ACPI_BUFFER *ReturnBuffer) { @@ -283,7 +282,7 @@ goto Cleanup; } - Info->RelativePathname = Pathname; + Info->RelativePathname = __UNCONST(Pathname); /* * Convert all external objects passed as arguments to the @@ -297,7 +296,7 @@ if (Info->ParamCount > ACPI_METHOD_NUM_ARGS) { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + ACPI_WARN_PREDEFINED ((AE_INFO, __UNCONST(Pathname), ACPI_WARN_ALWAYS, "Excess arguments (%u) - using only %u", Info->ParamCount, ACPI_METHOD_NUM_ARGS)); --- ./source/components/namespace/nsxfname.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/namespace/nsxfname.c 2018-04-10 19:35:36.909342806 +0300 @@ -84,12 +84,13 @@ ACPI_STATUS AcpiGetHandle ( ACPI_HANDLE Parent, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_HANDLE *RetHandle) { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node = NULL; ACPI_NAMESPACE_NODE *PrefixNode = NULL; + ACPI_STRING UPathname = __UNCONST(Pathname); ACPI_FUNCTION_ENTRY (); @@ -141,7 +142,7 @@ /* Find the Node and convert to a handle */ - Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH, &Node); + Status = AcpiNsGetNode (PrefixNode, UPathname, ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_SUCCESS (Status)) { *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); --- ./source/components/parser/psopinfo.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/parser/psopinfo.c 2018-04-10 19:35:36.924408409 +0300 @@ -178,10 +178,10 @@ /* Always guaranteed to return a valid pointer */ - return (Op->Name); + return __UNCONST(Op->Name); #else - return ("OpcodeName unavailable"); + return __UNCONST("OpcodeName unavailable"); #endif } --- ./source/components/resources/rsdumpinfo.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/resources/rsdumpinfo.c 2018-04-10 19:35:37.113399596 +0300 @@ -395,18 +395,20 @@ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed), "Max Relocatability", AcpiGbl_MaxDecode} }; +static const char *AcpiGbl_MemoryRange[] = { "Memory Range" }; ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] = { - {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", (void *) "Memory Range"}, + {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", AcpiGbl_MemoryRange}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching), "Caching", AcpiGbl_MemDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType), "Range Type", AcpiGbl_MtpDecode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation), "Translation", AcpiGbl_TtpDecode} }; +static const char *AcpiGbl_IORange[] = { "I/O Range" }; ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] = { - {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", (void *) "I/O Range"}, + {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", AcpiGbl_IORange }, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType), "Range Type", AcpiGbl_RngDecode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation), "Translation", AcpiGbl_TtpDecode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType), "Translation Type", AcpiGbl_TrsDecode} --- ./source/components/resources/rsdump.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/resources/rsdump.c 2018-05-05 05:21:37.801217703 +0300 @@ -109,7 +109,7 @@ static void AcpiRsDumpResourceLabel ( - char *Title, + const char *Title, ACPI_RESOURCE_LABEL *ResourceLabel); static void @@ -506,7 +506,7 @@ static void AcpiRsDumpResourceLabel ( - char *Title, + const char *Title, ACPI_RESOURCE_LABEL *ResourceLabel) { ACPI_FUNCTION_ENTRY (); --- ./source/components/resources/rsutils.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/resources/rsutils.c 2018-04-10 19:35:37.119849019 +0300 @@ -819,7 +819,7 @@ } Info->PrefixNode = Node; - Info->RelativePathname = METHOD_NAME__SRS; + Info->RelativePathname = __UNCONST(METHOD_NAME__SRS); Info->Parameters = Args; Info->Flags = ACPI_IGNORE_RETURN_VALUE; --- ./source/components/resources/rsxface.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/resources/rsxface.c 2018-04-10 19:35:37.120982267 +0300 @@ -612,7 +612,6 @@ ACPI_RESOURCE *Resource; ACPI_RESOURCE *ResourceEnd; - ACPI_FUNCTION_TRACE (AcpiWalkResourceBuffer); @@ -703,7 +702,7 @@ ACPI_STATUS AcpiWalkResources ( ACPI_HANDLE DeviceHandle, - char *Name, + const char *Name, ACPI_WALK_RESOURCE_CALLBACK UserFunction, void *Context) { @@ -728,7 +727,7 @@ /* Get the _CRS/_PRS/_AEI/_DMA resource list */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer); + Status = AcpiRsGetMethodData (DeviceHandle, __UNCONST(Name), &Buffer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); --- ./source/components/tables/tbinstal.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/tables/tbinstal.c 2018-05-05 05:21:37.802242538 +0300 @@ -252,7 +252,7 @@ ACPI_TABLE_HEADER *Table; ACPI_PHYSICAL_ADDRESS Address; UINT32 Length; - ACPI_ERROR_ONLY (char *OverrideType); + ACPI_ERROR_ONLY (const char *OverrideType); /* (1) Attempt logical override (returns a logical address) */ @@ -349,7 +349,11 @@ if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) == ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) { - ACPI_FREE (ACPI_PHYSADDR_TO_PTR (TableDesc->Address)); + void *ptr = ACPI_PHYSADDR_TO_PTR (TableDesc->Address); + if (ptr) + { + ACPI_FREE (ptr); + } } TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL); --- ./source/components/tables/tbdata.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/tables/tbdata.c 2018-04-10 19:35:37.122716190 +0300 @@ -548,7 +548,7 @@ ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, - char *Signature, + const char *Signature, UINT32 *TableIndex) { ACPI_STATUS Status = AE_OK; --- ./source/components/tables/tbfadt.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/tables/tbfadt.c 2018-04-10 19:35:37.123938631 +0300 @@ -552,7 +552,7 @@ * Expand the 32-bit DSDT addresses to 64-bit as necessary. * Later ACPICA code will always use the X 64-bit field. */ - AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT", + AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress (__UNCONST("DSDT"), AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt); /* If Hardware Reduced flag is set, we are all done */ @@ -579,7 +579,7 @@ Length = *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length); - Name = FadtInfoTable[i].Name; + Name = __UNCONST(FadtInfoTable[i].Name); Flags = FadtInfoTable[i].Flags; /* @@ -784,7 +784,7 @@ Source64->SpaceId, Pm1RegisterByteWidth, Source64->Address + (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth), - "PmRegisters", 0); + __UNCONST("PmRegisters"), 0); } } } --- ./source/components/tables/tbxface.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/tables/tbxface.c 2018-04-10 19:35:37.126994944 +0300 @@ -266,14 +266,11 @@ * * DESCRIPTION: Finds an ACPI table header. * - * NOTE: Caller is responsible in unmapping the header with - * AcpiOsUnmapMemory - * ******************************************************************************/ ACPI_STATUS AcpiGetTableHeader ( - char *Signature, + ACPI_CONST_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER *OutTableHeader) { @@ -281,7 +278,6 @@ UINT32 j; ACPI_TABLE_HEADER *Header; - /* Parameter validation */ if (!Signature || !OutTableHeader) @@ -364,7 +360,7 @@ ACPI_STATUS AcpiGetTable ( - char *Signature, + ACPI_CONST_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER **OutTable) { @@ -373,7 +369,6 @@ ACPI_STATUS Status = AE_NOT_FOUND; ACPI_TABLE_DESC *TableDesc; - /* Parameter validation */ if (!Signature || !OutTable) --- ./source/components/tables/tbxfload.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/tables/tbxfload.c 2018-04-10 19:35:37.127656943 +0300 @@ -166,6 +166,17 @@ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); +#ifdef __ia64__ + /* + * For ia64 ski emulator + */ + if (AcpiGbl_DsdtIndex == ACPI_INVALID_TABLE_INDEX) + { + Status = AE_NO_ACPI_TABLES; + goto UnlockAndExit; + } +#endif + /* * Load the namespace. The DSDT is required, but any SSDT and * PSDT tables are optional. Verify the DSDT. --- ./source/components/utilities/utcache.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utcache.c 2018-04-10 19:35:37.459763467 +0300 @@ -66,7 +66,7 @@ ACPI_STATUS AcpiOsCreateCache ( - char *CacheName, + const char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth, ACPI_MEMORY_LIST **ReturnCache) @@ -91,9 +91,8 @@ } /* Populate the cache object and return it */ - memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->ListName = CacheName; + Cache->ListName = __UNCONST(CacheName); Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; --- ./source/components/utilities/uteval.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/uteval.c 2018-04-10 19:35:37.493892159 +0300 @@ -93,7 +93,7 @@ } Info->PrefixNode = PrefixNode; - Info->RelativePathname = Path; + Info->RelativePathname = __UNCONST(Path); /* Evaluate the object/method */ --- ./source/components/utilities/utnonansi.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utnonansi.c 2018-04-10 19:35:37.527213433 +0300 @@ -240,7 +240,7 @@ void AcpiUtSafeStrncpy ( char *Dest, - char *Source, + const char *Source, ACPI_SIZE DestSize) { /* Always terminate destination string */ --- ./source/components/utilities/utobject.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utobject.c 2018-04-10 19:35:37.529896420 +0300 @@ -102,7 +102,7 @@ ACPI_FUNCTION_TRACE_STR (UtCreateInternalObjectDbg, - AcpiUtGetTypeName (Type)); + __UNCONST(AcpiUtGetTypeName (Type))); /* Allocate the raw object descriptor */ --- ./source/components/utilities/utosi.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utosi.c 2018-04-10 19:35:37.531887096 +0300 @@ -90,7 +90,7 @@ */ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] = { - /* Operating System Vendor Strings */ + /* Operating System Vendor Strings */ {"Windows 2000", NULL, 0, ACPI_OSI_WIN_2000}, /* Windows 2000 */ {"Windows 2001", NULL, 0, ACPI_OSI_WIN_XP}, /* Windows XP */ @@ -110,7 +110,7 @@ {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */ - /* Feature Group Strings */ + /* Feature Group Strings */ {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0}, @@ -208,7 +208,7 @@ { /* Only interfaces added at runtime can be freed */ - ACPI_FREE (NextInterface->Name); + ACPI_FREE (__UNCONST(NextInterface->Name)); ACPI_FREE (NextInterface); } else @@ -270,7 +270,7 @@ /* Initialize new info and insert at the head of the global list */ - strcpy (InterfaceInfo->Name, InterfaceName); + strcpy (__UNCONST(InterfaceInfo->Name), InterfaceName); InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; @@ -322,7 +322,7 @@ PreviousInterface->Next = NextInterface->Next; } - ACPI_FREE (NextInterface->Name); + ACPI_FREE (__UNCONST(NextInterface->Name)); ACPI_FREE (NextInterface); } else --- ./source/components/utilities/utprint.c 2018-04-27 22:45:03.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utprint.c 2018-05-05 05:21:37.808865687 +0300 @@ -40,7 +40,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" @@ -413,7 +412,9 @@ return (String); } - +#undef sprintf +#undef snprintf +#undef vsnprintf /******************************************************************************* * * FUNCTION: vsnprintf --- ./source/components/utilities/uttrack.c 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/uttrack.c 2018-04-29 23:21:34.481625951 +0300 @@ -449,7 +449,7 @@ Allocation->Component = Component; Allocation->Line = Line; - AcpiUtSafeStrncpy (Allocation->Module, (char *) Module, ACPI_MAX_MODULE_NAME); + AcpiUtSafeStrncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); if (!Element) { --- ./source/components/utilities/utuuid.c 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/utilities/utuuid.c 2018-04-10 19:35:37.691958063 +0300 @@ -48,7 +48,7 @@ ACPI_MODULE_NAME ("utuuid") -#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP) +#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP || defined ACPI_DISASSEMBLER) /* * UUID support functions. * @@ -85,7 +85,7 @@ void AcpiUtConvertStringToUuid ( - char *InString, + const char *InString, UINT8 *UuidBuffer) { UINT32 i; --- ./source/include/acapps.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acapps.h 2018-05-05 05:21:37.771322308 +0300 @@ -66,6 +66,13 @@ #endif /* Macros for signons and file headers */ +#ifdef ACPI_REPRO +#define ACPI_DATE "18 Dec 2013" +#define ACPI_TIME "00:00:00" +#else +#define ACPI_DATE __DATE__ +#define ACPI_TIME __TIME__ +#endif #define ACPI_COMMON_SIGNON(UtilityName) \ "\n%s\n%s version %8.8X\n%s\n\n", \ @@ -81,7 +88,7 @@ Prefix #define ACPI_COMMON_BUILD_TIME \ - "Build date/time: %s %s\n", __DATE__, __TIME__ + "Build date/time: %s %s\n", ACPI_DATE, ACPI_TIME /* Macros for usage messages */ --- ./source/include/acdebug.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acdebug.h 2018-04-10 19:35:35.422296511 +0300 @@ -63,8 +63,8 @@ typedef struct acpi_db_command_help { UINT8 LineCount; /* Number of help lines */ - char *Invocation; /* Command Invocation */ - char *Description; /* Command Description */ + const char *Invocation; /* Command Invocation */ + const char *Description; /* Command Description */ } ACPI_DB_COMMAND_HELP; --- ./source/include/acdisasm.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acdisasm.h 2018-04-10 19:35:35.423619670 +0300 @@ -51,7 +51,7 @@ #define BLOCK_PAREN 1 #define BLOCK_BRACE 2 #define BLOCK_COMMA_LIST 4 -#define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD" +#define ACPI_DEFAULT_RESNAME *(const UINT32 *) "__RD" /* * Raw table data header. Used by disassembler and data table compiler. --- ./source/include/acexcep.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acexcep.h 2018-04-10 19:35:35.426206829 +0300 @@ -74,10 +74,10 @@ */ typedef struct acpi_exception_info { - char *Name; + const char *Name; #ifdef ACPI_HELP_APP - char *Description; + const char *Description; #endif } ACPI_EXCEPTION_INFO; --- ./source/include/acglobal.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acglobal.h 2018-04-10 19:35:35.427122996 +0300 @@ -288,10 +288,10 @@ /* Event counters */ -ACPI_GLOBAL (UINT32, AcpiMethodCount); -ACPI_GLOBAL (UINT32, AcpiGpeCount); -ACPI_GLOBAL (UINT32, AcpiSciCount); -ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]); +ACPI_GLOBAL (UINT64, AcpiMethodCount); +ACPI_GLOBAL (UINT64, AcpiGpeCount); +ACPI_GLOBAL (UINT64, AcpiSciCount); +ACPI_GLOBAL (UINT64, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]); /* Dynamic control method tracing mechanism */ --- ./source/include/aclocal.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/aclocal.h 2018-04-10 19:35:35.430196072 +0300 @@ -91,7 +91,6 @@ #define ACPI_MAX_MUTEX 5 #define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1) - /* Lock structure for reader/writer interfaces */ typedef struct acpi_rw_lock @@ -866,7 +865,7 @@ typedef struct acpi_opcode_info { #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) - char *Name; /* Opcode name (disassembler/debug only) */ + const char *Name; /* Opcode name (disassembler/debug only) */ #endif UINT32 ParseArgs; /* Grammar/Parse time arguments */ UINT32 RuntimeArgs; /* Interpret time arguments */ @@ -926,7 +925,7 @@ ACPI_DISASM_ONLY_MEMBERS (\ UINT16 DisasmFlags; /* Used during AML disassembly */\ UINT8 DisasmOpcode; /* Subtype used for disassembly */\ - char *OperatorSymbol; /* Used for C-style operator name strings */\ + const char *OperatorSymbol; /* Used for C-style operator name strings */\ char AmlOpName[16]) /* Op name (debug only) */\ ACPI_CONVERTER_ONLY_MEMBERS (\ char *InlineComment; /* Inline comment */\ @@ -1260,7 +1259,7 @@ typedef struct acpi_interface_info { - char *Name; + const char *Name; struct acpi_interface_info *Next; UINT8 Flags; UINT8 Value; @@ -1275,7 +1274,7 @@ typedef struct acpi_port_info { - char *Name; + const char *Name; UINT16 Start; UINT16 End; UINT8 OsiDependency; @@ -1521,15 +1520,15 @@ typedef struct ah_device_id { - char *Name; - char *Description; + const char *Name; + const char *Description; } AH_DEVICE_ID; typedef struct ah_uuid { - char *Description; - char *String; + const char *Description; + const char *String; } AH_UUID; --- ./source/include/acmacros.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acmacros.h 2018-04-10 19:35:35.431148630 +0300 @@ -87,31 +87,31 @@ /* Hi...Lo Lo...Hi */ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[1];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[0];} +#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[1];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[0];} #define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d))=0;\ - ((UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\ - ((UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];} + ((UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[1];\ + ((UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[0];} #define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\ - ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\ - ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];} + ((UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\ + ((UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];} /* 32-bit source, 16/32/64 destination */ #define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\ - (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\ - (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];} +#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[3];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[2];\ + (( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[1];\ + (( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[0];} #define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\ - ((UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\ - ((UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\ - ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\ - ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];} + ((UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[3];\ + ((UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[2];\ + ((UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\ + ((UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];} /* 64-bit source, 16/32/64 destination */ @@ -119,14 +119,14 @@ #define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\ - (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\ - (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];\ - (( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\ - (( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\ - (( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\ - (( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];} +#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[7];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[6];\ + (( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[5];\ + (( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[4];\ + (( UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[3];\ + (( UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[2];\ + (( UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\ + (( UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];} #else /* * Macros for little-endian machines @@ -138,21 +138,21 @@ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d, s) *(UINT16 *)(void *)(d) = *(UINT16 *)(void *)(s) -#define ACPI_MOVE_16_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT16 *)(void *)(s) -#define ACPI_MOVE_16_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT16 *)(void *)(s) +#define ACPI_MOVE_16_TO_16(d, s) *(UINT16 *)(void *)(d) = *(const UINT16 *)(const void *)(s) +#define ACPI_MOVE_16_TO_32(d, s) *(UINT32 *)(void *)(d) = *(const UINT16 *)(const void *)(s) +#define ACPI_MOVE_16_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT16 *)(const void *)(s) /* 32-bit source, 16/32/64 destination */ #define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s) -#define ACPI_MOVE_32_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s) +#define ACPI_MOVE_32_TO_32(d, s) *(UINT32 *)(void *)(d) = *(const UINT32 *)(const void *)(s) +#define ACPI_MOVE_32_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT32 *)(const void *)(s) /* 64-bit source, 16/32/64 destination */ #define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ #define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT64 *)(void *)(s) +#define ACPI_MOVE_64_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT64 *)(const void *)(s) #else /* @@ -163,8 +163,8 @@ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];} +#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];} #define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);} #define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);} @@ -173,10 +173,10 @@ #define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\ - (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\ - (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];} +#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];\ + (( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[2];\ + (( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[3];} #define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d, s);} @@ -184,14 +184,14 @@ #define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ #define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\ - (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\ - (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\ - (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];\ - (( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[4];\ - (( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[5];\ - (( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[6];\ - (( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[7];} +#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\ + (( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];\ + (( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[2];\ + (( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[3];\ + (( UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[4];\ + (( UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[5];\ + (( UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[6];\ + (( UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[7];} #endif #endif --- ./source/include/acoutput.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acoutput.h 2018-04-10 19:35:35.435196893 +0300 @@ -366,10 +366,10 @@ AcpiUtTrace (ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer) + ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, const void *, Pointer) #define ACPI_FUNCTION_TRACE_U32(Name, Value) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value) + ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, const UINT32, Value) #define ACPI_FUNCTION_TRACE_STR(Name, String) \ ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, const char *, String) --- ./source/include/platform/acgcc.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/platform/acgcc.h 2018-04-10 19:35:36.674144699 +0300 @@ -56,9 +56,13 @@ #define va_arg(v, l) __builtin_va_arg(v, l) #define va_copy(d, s) __builtin_va_copy(d, s) #else +#if defined(_KERNEL) || defined(_STANDALONE) +#include +#else #include #endif #endif +#endif #define ACPI_INLINE __inline__ --- ./source/include/platform/acnetbsd.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h 2018-04-10 19:35:36.888938049 +0300 @@ -1,6 +1,7 @@ /****************************************************************************** * * Name: acnetbsd.h - OS specific defines, etc. + * $Revision: 1.17 $ * *****************************************************************************/ @@ -64,22 +65,44 @@ #include #include -#include -#include +#include #define asm __asm #define ACPI_USE_NATIVE_DIVIDE #define ACPI_USE_NATIVE_MATH64 +#define ACPI_ASM_MACROS /* tell acenv.h */ + #define ACPI_SYSTEM_XFACE #define ACPI_EXTERNAL_XFACE #define ACPI_INTERNAL_XFACE #define ACPI_INTERNAL_VAR_XFACE +/* + * XXX: The internal memory tracking of ACPICA, available when + * ACPI_DBG_TRACK_ALLOCATIONS is defined, has been removed + * from ACPI_DEBUG. + * + * This is due to the instability of the ABI of ACPICA. + * + * If the memory tracking is enabled, ACPICA will insert a header + * to each memory allocation. As a consequence, when ACPI specific + * code is loaded as a kernel module and the running kernel has + * been compiled with ACPI_DEBUG, the result is an instant panic. + * This happens because of unaligned memory access when the code + * tries to use ACPI_FREE for a buffer obtained via ACPI_ALLOCATE, + * AcpiEvaluateObject(), and related calls. + * + * If the involved memory statistics are required, a separate constant + * ACPI_DEBUG_ALLOC is available in options(4) for ACPI_DEBUG kernels. + */ + #ifdef ACPI_DEBUG #define ACPI_DEBUG_OUTPUT +#ifdef ACPI_DEBUG_ALLOC #define ACPI_DBG_TRACK_ALLOCATIONS +#endif #ifdef DEBUGGER_THREADING #undef DEBUGGER_THREADING #endif /* DEBUGGER_THREADING */ @@ -103,6 +126,8 @@ #define __sti() #define __cdecl +/* XXX */ +#define __inline inline #endif /* defined(_KERNEL) || defined(_STANDALONE) */ /* Always use NetBSD code over our local versions */ --- ./source/include/acpiosxf.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acpiosxf.h 2018-04-10 19:35:35.437042150 +0300 @@ -275,7 +275,7 @@ #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache ACPI_STATUS AcpiOsCreateCache ( - char *CacheName, + const char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth, ACPI_CACHE_T **ReturnCache); --- ./source/include/acpixf.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acpixf.h 2018-05-05 05:21:37.772192077 +0300 @@ -174,7 +174,7 @@ /* * Optionally enable output from the AML Debug Object. */ -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE); +ACPI_INIT_GLOBAL (_Bool, AcpiGbl_EnableAmlDebugObject, FALSE); /* * Optionally copy the entire DSDT to local memory (instead of simply @@ -594,14 +594,14 @@ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTableHeader ( - ACPI_STRING Signature, + ACPI_CONST_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER *OutTableHeader)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTable ( - ACPI_STRING Signature, + ACPI_CONST_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER **OutTable)) @@ -661,7 +661,7 @@ ACPI_STATUS AcpiGetHandle ( ACPI_HANDLE Parent, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_HANDLE *RetHandle)) ACPI_EXTERNAL_RETURN_STATUS ( @@ -700,7 +700,7 @@ ACPI_STATUS AcpiEvaluateObject ( ACPI_HANDLE Object, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_OBJECT_LIST *ParameterObjects, ACPI_BUFFER *ReturnObjectBuffer)) @@ -708,7 +708,7 @@ ACPI_STATUS AcpiEvaluateObjectTyped ( ACPI_HANDLE Object, - ACPI_STRING Pathname, + ACPI_CONST_STRING Pathname, ACPI_OBJECT_LIST *ExternalParams, ACPI_BUFFER *ReturnBuffer, ACPI_OBJECT_TYPE ReturnType)) @@ -1063,7 +1063,7 @@ ACPI_STATUS AcpiWalkResources ( ACPI_HANDLE Device, - char *Name, + const char *Name, ACPI_WALK_RESOURCE_CALLBACK UserFunction, void *Context)) --- ./source/include/actables.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/actables.h 2018-04-10 19:35:35.442999020 +0300 @@ -98,7 +98,7 @@ ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, - char *Signature, + const char *Signature, UINT32 *TableIndex); BOOLEAN --- ./source/include/actypes.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/actypes.h 2018-05-28 07:36:14.574365847 +0300 @@ -460,6 +460,7 @@ typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */ typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */ typedef char * ACPI_STRING; /* Null terminated ASCII string */ +typedef const char * ACPI_CONST_STRING; /* Null terminated ASCII string */ typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */ @@ -549,8 +550,8 @@ /* Pointer/Integer type conversions */ -#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i)) -#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0) +#define ACPI_TO_POINTER(i) ((void *)((uintptr_t)(ACPI_SIZE) (i))) +#define ACPI_TO_INTEGER(p) ((uintptr_t)(p)) #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0) #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) @@ -1056,7 +1057,7 @@ { const char *Name; UINT8 Type; - char *Val; + const char *Val; } ACPI_PREDEFINED_NAMES; --- ./source/include/acutils.h 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/include/acutils.h 2018-04-10 19:35:36.665160362 +0300 @@ -954,7 +954,7 @@ void AcpiUtSafeStrncpy ( char *Dest, - char *Source, + const char *Source, ACPI_SIZE DestSize); BOOLEAN @@ -1146,10 +1146,10 @@ /* * utuuid -- UUID support functions */ -#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP) +#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP|| defined ACPI_DISASSEMBLER) void AcpiUtConvertStringToUuid ( - char *InString, + const char *InString, UINT8 *UuidBuffer); #endif --- ./source/os_specific/service_layers/oslinuxtbl.c 2018-04-27 22:45:04.000000000 +0300 +++ /current/src/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c 2018-04-10 19:35:36.913916380 +0300 @@ -1561,11 +1561,13 @@ if (Instance != 0) { - sprintf (TableFilename, "%s/%4.4s%d", Pathname, TempName, Instance); + snprintf (TableFilename, sizeof(TableFilename), "%s/%4.4s%d", + Pathname, TempName, Instance); } else { - sprintf (TableFilename, "%s/%4.4s", Pathname, TempName); + snprintf (TableFilename, sizeof(TableFilename), "%s/%4.4s", + Pathname, TempName); } break; }