Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808371/?format=api
{ "id": 808371, "url": "http://patchwork.ozlabs.org/api/patches/808371/?format=api", "web_url": "http://patchwork.ozlabs.org/project/fwts/patch/20170831175104.31118-1-colin.king@canonical.com/", "project": { "id": 24, "url": "http://patchwork.ozlabs.org/api/projects/24/?format=api", "name": "Firmware Test Suite development", "link_name": "fwts", "list_id": "fwts-devel.lists.ubuntu.com", "list_email": "fwts-devel@lists.ubuntu.com", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170831175104.31118-1-colin.king@canonical.com>", "list_archive_url": null, "date": "2017-08-31T17:51:04", "name": "ACPICA: Update to version 20170831", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1631bad87171c2d03f04a54b4038247a6b4d770e", "submitter": { "id": 2900, "url": "http://patchwork.ozlabs.org/api/people/2900/?format=api", "name": "Colin Ian King", "email": "colin.king@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/fwts/patch/20170831175104.31118-1-colin.king@canonical.com/mbox/", "series": [ { "id": 887, "url": "http://patchwork.ozlabs.org/api/series/887/?format=api", "web_url": "http://patchwork.ozlabs.org/project/fwts/list/?series=887", "date": "2017-08-31T17:51:04", "name": "ACPICA: Update to version 20170831", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/887/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808371/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808371/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<fwts-devel-bounces@lists.ubuntu.com>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)", "Received": [ "from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjqgZ3Vwtz9s7c;\n\tFri, 1 Sep 2017 03:51:38 +1000 (AEST)", "from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.76)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1dnTcr-0005dE-OK; Thu, 31 Aug 2017 17:51:33 +0000", "from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.76) (envelope-from <colin.king@canonical.com>)\n\tid 1dnTcQ-0005Xy-6o\n\tfor fwts-devel@lists.ubuntu.com; Thu, 31 Aug 2017 17:51:06 +0000", "from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.76) (envelope-from <colin.king@canonical.com>)\n\tid 1dnTcO-0005Fj-P5; Thu, 31 Aug 2017 17:51:05 +0000" ], "From": "Colin King <colin.king@canonical.com>", "To": "fwts-devel@lists.ubuntu.com", "Subject": "[PATCH] ACPICA: Update to version 20170831", "Date": "Thu, 31 Aug 2017 18:51:04 +0100", "Message-Id": "<20170831175104.31118-1-colin.king@canonical.com>", "X-Mailer": "git-send-email 2.14.1", "MIME-Version": "1.0", "X-BeenThere": "fwts-devel@lists.ubuntu.com", "X-Mailman-Version": "2.1.14", "Precedence": "list", "List-Id": "Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>", "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>", "List-Archive": "<https://lists.ubuntu.com/archives/fwts-devel>", "List-Post": "<mailto:fwts-devel@lists.ubuntu.com>", "List-Help": "<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>", "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "fwts-devel-bounces@lists.ubuntu.com", "Sender": "fwts-devel-bounces@lists.ubuntu.com" }, "content": "From: Colin Ian King <colin.king@canonical.com>\n\nChanges in this release of ACPICA are detailed at the following\nlink on the ACPICA developer mailing list:\n\n https://lists.acpica.org/pipermail/devel/2017-August/001436.html\n\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n src/acpica/Makefile.am | 1 +\n src/acpica/source/common/dmtbinfo.c | 2 +-\n src/acpica/source/compiler/aslcompiler.h | 5 +\n src/acpica/source/compiler/aslcompiler.l | 4 +-\n src/acpica/source/compiler/asldebug.c | 87 ++-\n src/acpica/source/compiler/aslerror.c | 20 +-\n src/acpica/source/compiler/aslmain.c | 8 +-\n src/acpica/source/compiler/aslmessages.c | 5 +-\n src/acpica/source/compiler/aslmessages.h | 1 +\n src/acpica/source/compiler/aslresource.c | 8 +\n src/acpica/source/compiler/aslrules.y | 3 +-\n src/acpica/source/compiler/asltree.c | 33 ++\n src/acpica/source/compiler/aslutils.c | 17 +-\n src/acpica/source/compiler/dtcompile.c | 2 +\n src/acpica/source/compiler/dtcompiler.h | 4 +\n src/acpica/source/compiler/dtfield.c | 8 +-\n src/acpica/source/compiler/dtparser.y | 17 +-\n src/acpica/source/compiler/dtutils.c | 32 ++\n src/acpica/source/compiler/prparser.y | 4 +-\n src/acpica/source/components/debugger/dbconvert.c | 4 +-\n .../source/components/disassembler/dmresrc.c | 14 +\n src/acpica/source/components/dispatcher/dswexec.c | 2 +-\n src/acpica/source/components/events/evgpe.c | 6 +-\n src/acpica/source/components/executer/exconcat.c | 2 +-\n src/acpica/source/components/executer/exconvrt.c | 26 +-\n src/acpica/source/components/executer/exmisc.c | 2 +-\n src/acpica/source/components/executer/exresop.c | 2 +-\n src/acpica/source/components/hardware/hwgpe.c | 4 +-\n src/acpica/source/components/hardware/hwregs.c | 74 +--\n src/acpica/source/components/hardware/hwxface.c | 130 +----\n src/acpica/source/components/namespace/nsconvert.c | 3 +-\n src/acpica/source/components/tables/tbxface.c | 9 +-\n .../source/components/utilities/utstrsuppt.c | 613 +++++++++++++++++++++\n .../source/components/utilities/utstrtoul64.c | 472 ++++++++--------\n src/acpica/source/include/acexcep.h | 12 +-\n src/acpica/source/include/achware.h | 4 +-\n src/acpica/source/include/acinterp.h | 5 +-\n src/acpica/source/include/acpixf.h | 2 +-\n src/acpica/source/include/actbl1.h | 46 +-\n src/acpica/source/include/actbl2.h | 1 +\n src/acpica/source/include/acutils.h | 58 +-\n src/acpica/source/tools/acpiexec/aeinitfile.c | 3 +-\n 42 files changed, 1266 insertions(+), 489 deletions(-)\n create mode 100644 src/acpica/source/components/utilities/utstrsuppt.c", "diff": "diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am\nindex 58b07494..64755b41 100644\n--- a/src/acpica/Makefile.am\n+++ b/src/acpica/Makefile.am\n@@ -261,6 +261,7 @@ libfwtsacpica_la_SOURCES =\t\t\t\t\\\n \tsource/components/utilities/utexcep.c\t\t\\\n \tsource/components/utilities/utpredef.c\t\t\\\n \tsource/components/utilities/utstring.c\t\t\\\n+\tsource/components/utilities/utstrsuppt.c\t\\\n \tsource/components/utilities/utownerid.c\t\t\\\n \tsource/components/utilities/utxfinit.c\t\t\\\n \tsource/components/utilities/uterror.c\t\t\\\ndiff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c\nindex 4b902b96..5180b4db 100644\n--- a/src/acpica/source/common/dmtbinfo.c\n+++ b/src/acpica/source/common/dmtbinfo.c\n@@ -2828,7 +2828,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] =\n {ACPI_DMT_FLAG3, ACPI_PPTT1_FLAG_OFFSET (Flags,0), \"Allocation Type valid\", 0},\n {ACPI_DMT_FLAG4, ACPI_PPTT1_FLAG_OFFSET (Flags,0), \"Cache Type valid\", 0},\n {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), \"Write Policy valid\", 0},\n- {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), \"Line Size valid\", 0},\n+ {ACPI_DMT_FLAG6, ACPI_PPTT1_FLAG_OFFSET (Flags,0), \"Line Size valid\", 0},\n {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NextLevelOfCache), \"Next Level of Cache\", 0},\n {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Size), \"Size\", 0},\n {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NumberOfSets), \"Number of Sets\", 0},\ndiff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h\nindex fdf4dbf7..3b6a9c1d 100644\n--- a/src/acpica/source/compiler/aslcompiler.h\n+++ b/src/acpica/source/compiler/aslcompiler.h\n@@ -890,6 +890,11 @@ void\n TrSetOpCurrentFilename (\n ACPI_PARSE_OBJECT *Op);\n \n+void\n+TrSetOpIntegerWidth (\n+ ACPI_PARSE_OBJECT *TableSignature,\n+ ACPI_PARSE_OBJECT *Revision);\n+\n ACPI_PARSE_OBJECT *\n TrLinkOpChildren (\n ACPI_PARSE_OBJECT *Op,\ndiff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l\nindex b49233be..5fcfc188 100644\n--- a/src/acpica/source/compiler/aslcompiler.l\n+++ b/src/acpica/source/compiler/aslcompiler.l\n@@ -195,6 +195,7 @@ count (int type);\n \n LeadNameChar [A-Za-z_]\n DigitChar [0-9]\n+OctalChar [0-7]\n HexDigitChar [A-Fa-f0-9]\n RootChar [\\\\]\n Nothing []\n@@ -278,8 +279,7 @@ NamePathTail [.]{NameSeg}\n /*\n * Begin standard ASL grammar\n */\n-0[xX]{HexDigitChar}+ |\n-{DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);\n+[0-9][a-zA-Z0-9]* { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);\n count (1); return (PARSEOP_INTEGER); }\n \n \"Include\" { count (1); return (PARSEOP_INCLUDE); }\ndiff --git a/src/acpica/source/compiler/asldebug.c b/src/acpica/source/compiler/asldebug.c\nindex b0b38640..684e2224 100644\n--- a/src/acpica/source/compiler/asldebug.c\n+++ b/src/acpica/source/compiler/asldebug.c\n@@ -165,6 +165,10 @@ UtDumpParseOpName (\n UINT32 Level,\n UINT32 DataLength);\n \n+static char *\n+UtCreateEscapeSequences (\n+ char *InString);\n+\n \n /*******************************************************************************\n *\n@@ -272,7 +276,6 @@ UtDumpStringOp (\n \n \n String = Op->Asl.Value.String;\n-\n if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)\n {\n /*\n@@ -294,6 +297,8 @@ UtDumpStringOp (\n return;\n }\n \n+ String = UtCreateEscapeSequences (String);\n+\n /* Emit the ParseOp name, leaving room for the string */\n \n UtDumpParseOpName (Op, Level, strlen (String));\n@@ -301,6 +306,86 @@ UtDumpStringOp (\n }\n \n \n+/*******************************************************************************\n+ *\n+ * FUNCTION: UtCreateEscapeSequences\n+ *\n+ * PARAMETERS: InString - ASCII string to be expanded\n+ *\n+ * RETURN: Expanded string\n+ *\n+ * DESCRIPTION: Expand all non-printable ASCII bytes (0-0x1F) to escape\n+ * sequences. For example, hex 14 becomes \\x14\n+ *\n+ * NOTE: Since this function is used for debug output only, it does\n+ * not attempt to translate into the \"known\" escape sequences\n+ * such as \\a, \\f, \\t, etc.\n+ *\n+ ******************************************************************************/\n+\n+static char *\n+UtCreateEscapeSequences (\n+ char *InString)\n+{\n+ char *String = InString;\n+ char *OutString;\n+ char *OutStringPtr;\n+ UINT32 InStringLength = 0;\n+ UINT32 EscapeCount = 0;\n+\n+\n+ /*\n+ * Determine up front how many escapes are within the string.\n+ * Obtain the input string length while doing so.\n+ */\n+ while (*String)\n+ {\n+ if ((*String <= 0x1F) || (*String >= 0x7F))\n+ {\n+ EscapeCount++;\n+ }\n+\n+ InStringLength++;\n+ String++;\n+ }\n+\n+ if (!EscapeCount)\n+ {\n+ return (InString); /* No escapes, nothing to do */\n+ }\n+\n+ /* New string buffer, 3 extra chars per escape (4 total) */\n+\n+ OutString = UtLocalCalloc (InStringLength + (EscapeCount * 3));\n+ OutStringPtr = OutString;\n+\n+ /* Convert non-ascii or non-printable chars to escape sequences */\n+\n+ while (*InString)\n+ {\n+ if ((*InString <= 0x1F) || (*InString >= 0x7F))\n+ {\n+ /* Insert a \\x hex escape sequence */\n+\n+ OutStringPtr[0] = '\\\\';\n+ OutStringPtr[1] = 'x';\n+ OutStringPtr[2] = AcpiUtHexToAsciiChar (*InString, 4);\n+ OutStringPtr[3] = AcpiUtHexToAsciiChar (*InString, 0);\n+ OutStringPtr += 4;\n+ }\n+ else /* Normal ASCII character */\n+ {\n+ *OutStringPtr = *InString;\n+ OutStringPtr++;\n+ }\n+\n+ InString++;\n+ }\n+\n+ return (OutString);\n+}\n+\n+\n /*******************************************************************************\n *\n * FUNCTION: UtDumpBasicOp\ndiff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c\nindex ec91ca3e..56b5cabb 100644\n--- a/src/acpica/source/compiler/aslerror.c\n+++ b/src/acpica/source/compiler/aslerror.c\n@@ -757,6 +757,11 @@ AslCommonError (\n ASL_ERROR_MSG *Enode;\n \n \n+ if (AslIsExceptionIgnored (Level, MessageId))\n+ {\n+ return;\n+ }\n+\n Enode = UtLocalCalloc (sizeof (ASL_ERROR_MSG));\n \n if (ExtraMessage)\n@@ -949,9 +954,9 @@ AslDisableException (\n \n MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);\n \n- if ((MessageId < 2000) || (MessageId > 5999))\n+ if ((MessageId < 2000) || (MessageId > 6999))\n {\n- printf (\"\\\"%s\\\" is not a valid warning/remark ID\\n\",\n+ printf (\"\\\"%s\\\" is not a valid warning/remark/error ID\\n\",\n MessageIdString);\n return (AE_BAD_PARAMETER);\n }\n@@ -1050,8 +1055,9 @@ AslIsExceptionDisabled (\n \n case ASL_WARNING:\n case ASL_REMARK:\n+ case ASL_ERROR:\n /*\n- * Ignore this warning/remark if it has been disabled by\n+ * Ignore this error/warning/remark if it has been disabled by\n * the user (-vw option)\n */\n EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);\n@@ -1097,14 +1103,6 @@ AslError (\n ACPI_PARSE_OBJECT *Op,\n char *ExtraMessage)\n {\n-\n- /* Check if user wants to ignore this exception */\n-\n- if (AslIsExceptionIgnored (Level, MessageId))\n- {\n- return;\n- }\n-\n if (Op)\n {\n AslCommonError (Level, MessageId, Op->Asl.LineNumber,\ndiff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c\nindex 10251fb2..e4ac4229 100644\n--- a/src/acpica/source/compiler/aslmain.c\n+++ b/src/acpica/source/compiler/aslmain.c\n@@ -386,11 +386,11 @@ AslInitialize (\n \n AcpiGbl_DmOpt_Verbose = FALSE;\n \n- /* Default integer width is 64 bits */\n+ /* Default integer width is 32 bits */\n \n- AcpiGbl_IntegerBitWidth = 64;\n- AcpiGbl_IntegerNybbleWidth = 16;\n- AcpiGbl_IntegerByteWidth = 8;\n+ AcpiGbl_IntegerBitWidth = 32;\n+ AcpiGbl_IntegerNybbleWidth = 8;\n+ AcpiGbl_IntegerByteWidth = 4;\n \n for (i = 0; i < ASL_NUM_FILES; i++)\n {\ndiff --git a/src/acpica/source/compiler/aslmessages.c b/src/acpica/source/compiler/aslmessages.c\nindex b87d5499..159f9d23 100644\n--- a/src/acpica/source/compiler/aslmessages.c\n+++ b/src/acpica/source/compiler/aslmessages.c\n@@ -238,7 +238,7 @@ const char *AslCompilerMsgs [] =\n /* ASL_MSG_HID_SUFFIX */ \"_HID suffix must be all hex digits\",\n /* ASL_MSG_INCLUDE_FILE_OPEN */ \"Could not open include file\",\n /* ASL_MSG_INPUT_FILE_OPEN */ \"Could not open input file\",\n-/* ASL_MSG_INTEGER_LENGTH */ \"64-bit integer in 32-bit table, truncating (DSDT or SSDT version < 2)\",\n+/* ASL_MSG_INTEGER_LENGTH */ \"Truncating 64-bit constant found in 32-bit table\",\n /* ASL_MSG_INTEGER_OPTIMIZATION */ \"Integer optimized to single-byte AML opcode\",\n /* ASL_MSG_INTERRUPT_LIST */ \"Too many interrupts (16 max)\",\n /* ASL_MSG_INTERRUPT_NUMBER */ \"Invalid interrupt number (must be 0-15)\",\n@@ -349,7 +349,8 @@ const char *AslCompilerMsgs [] =\n /* ASL_MSG_ARG_NOT_USED */ \"Method Argument is never used\",\n /* ASL_MSG_CONSTANT_REQUIRED */ \"Non-reducible expression\",\n /* ASL_MSG_CROSS_TABLE_SCOPE */ \"Illegal open scope on external object from within DSDT\",\n-/* ASL_MSG_EXCEPTION_NOT_RECEIVED */ \"Expected remark, warning, or error did not occur. Message ID:\"\n+/* ASL_MSG_EXCEPTION_NOT_RECEIVED */ \"Expected remark, warning, or error did not occur. Message ID:\",\n+/* ASL_MSG_NULL_RESOURCE_TEMPLATE */ \"Empty Resource Template (END_TAG only)\"\n };\n \n /* Table compiler */\ndiff --git a/src/acpica/source/compiler/aslmessages.h b/src/acpica/source/compiler/aslmessages.h\nindex 68216e5c..d69c05a1 100644\n--- a/src/acpica/source/compiler/aslmessages.h\n+++ b/src/acpica/source/compiler/aslmessages.h\n@@ -352,6 +352,7 @@ typedef enum\n ASL_MSG_CONSTANT_REQUIRED,\n ASL_MSG_CROSS_TABLE_SCOPE,\n ASL_MSG_EXCEPTION_NOT_RECEIVED,\n+ ASL_MSG_NULL_RESOURCE_TEMPLATE,\n \n /* These messages are used by the Data Table compiler only */\n \ndiff --git a/src/acpica/source/compiler/aslresource.c b/src/acpica/source/compiler/aslresource.c\nindex eb0c22a1..b052c1ed 100644\n--- a/src/acpica/source/compiler/aslresource.c\n+++ b/src/acpica/source/compiler/aslresource.c\n@@ -1148,6 +1148,14 @@ RsDoResourceTemplate (\n \n DescriptorTypeOp = ASL_GET_PEER_NODE (BufferOp);\n \n+ /* DEFAULT_ARG indicates null template - ResourceTemplate(){} */\n+\n+ if (DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)\n+ {\n+ AslError (ASL_WARNING, ASL_MSG_NULL_RESOURCE_TEMPLATE,\n+ DescriptorTypeOp, DescriptorTypeOp->Asl.Value.String);\n+ }\n+\n /*\n * Process all resource descriptors in the list\n * Note: It is assumed that the EndTag node has been automatically\ndiff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y\nindex f26ea874..3b8e4839 100644\n--- a/src/acpica/source/compiler/aslrules.y\n+++ b/src/acpica/source/compiler/aslrules.y\n@@ -199,7 +199,8 @@ DefinitionBlockTerm\n String ','\n String ','\n DWordConst\n- PARSEOP_CLOSE_PAREN {TrSetOpEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}\n+ PARSEOP_CLOSE_PAREN {TrSetOpIntegerWidth ($6,$8);\n+ TrSetOpEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}\n '{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,7,\n $4,$6,$8,$10,$12,$14,$18);}\n ;\ndiff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c\nindex 8b709df7..084bc4d5 100644\n--- a/src/acpica/source/compiler/asltree.c\n+++ b/src/acpica/source/compiler/asltree.c\n@@ -376,6 +376,39 @@ TrSetOpCurrentFilename (\n }\n \n \n+/*******************************************************************************\n+ *\n+ * FUNCTION: TrSetOpIntegerWidth\n+ *\n+ * PARAMETERS: Op - An existing parse op\n+ *\n+ * RETURN: None\n+ *\n+ * DESCRIPTION:\n+ *\n+ ******************************************************************************/\n+\n+void\n+TrSetOpIntegerWidth (\n+ ACPI_PARSE_OBJECT *TableSignatureOp,\n+ ACPI_PARSE_OBJECT *RevisionOp)\n+{\n+\n+ /* TBD: Check table sig? (DSDT vs. SSDT) */\n+\n+ /* Handle command-line version override */\n+\n+ if (Gbl_RevisionOverride)\n+ {\n+ AcpiUtSetIntegerWidth (Gbl_RevisionOverride);\n+ }\n+ else\n+ {\n+ AcpiUtSetIntegerWidth ((UINT8) RevisionOp->Asl.Value.Integer);\n+ }\n+}\n+\n+\n /*******************************************************************************\n *\n * FUNCTION: TrSetOpEndLineNumber\ndiff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c\nindex c5ff42c0..8b46d38b 100644\n--- a/src/acpica/source/compiler/aslutils.c\n+++ b/src/acpica/source/compiler/aslutils.c\n@@ -1004,11 +1004,11 @@ UtAttachNamepathToOwner (\n *\n * FUNCTION: UtDoConstant\n *\n- * PARAMETERS: String - Hexadecimal or decimal string\n+ * PARAMETERS: String - Hex/Decimal/Octal\n *\n * RETURN: Converted Integer\n *\n- * DESCRIPTION: Convert a string to an integer, with error checking.\n+ * DESCRIPTION: Convert a string to an integer, with overflow/error checking.\n *\n ******************************************************************************/\n \n@@ -1017,17 +1017,20 @@ UtDoConstant (\n char *String)\n {\n ACPI_STATUS Status;\n- UINT64 Converted;\n+ UINT64 ConvertedInteger;\n char ErrBuf[64];\n \n \n- Status = AcpiUtStrtoul64 (String, ACPI_STRTOUL_64BIT, &Converted);\n+ Status = AcpiUtStrtoul64 (String, &ConvertedInteger);\n if (ACPI_FAILURE (Status))\n {\n- sprintf (ErrBuf, \"%s %s\\n\", \"Conversion error:\",\n+ sprintf (ErrBuf, \"While creating 64-bit constant: %s\\n\",\n AcpiFormatException (Status));\n- AslCompilererror (ErrBuf);\n+\n+ AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber,\n+ Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,\n+ Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, ErrBuf);\n }\n \n- return (Converted);\n+ return (ConvertedInteger);\n }\ndiff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c\nindex e74fed51..53445624 100644\n--- a/src/acpica/source/compiler/dtcompile.c\n+++ b/src/acpica/source/compiler/dtcompile.c\n@@ -319,6 +319,8 @@ DtInitialize (\n return (Status);\n }\n \n+ AcpiUtSetIntegerWidth (2); /* Set width to 64 bits */\n+\n Gbl_FieldList = NULL;\n Gbl_RootTable = NULL;\n Gbl_SubtableStack = NULL;\ndiff --git a/src/acpica/source/compiler/dtcompiler.h b/src/acpica/source/compiler/dtcompiler.h\nindex 1e81c580..90fad889 100644\n--- a/src/acpica/source/compiler/dtcompiler.h\n+++ b/src/acpica/source/compiler/dtcompiler.h\n@@ -481,6 +481,10 @@ DtFatal (\n DT_FIELD *FieldObject,\n char *ExtraMessage);\n \n+UINT64\n+DtDoConstant (\n+ char *String);\n+\n char*\n DtGetFieldValue (\n DT_FIELD *Field);\ndiff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c\nindex 13e8b638..b06877a8 100644\n--- a/src/acpica/source/compiler/dtfield.c\n+++ b/src/acpica/source/compiler/dtfield.c\n@@ -628,15 +628,9 @@ DtCompileFlag (\n UINT64 Value = 0;\n UINT32 BitLength = 1;\n UINT8 BitPosition = 0;\n- ACPI_STATUS Status;\n \n \n- Status = AcpiUtStrtoul64 (Field->Value,\n- (ACPI_STRTOUL_64BIT | ACPI_STRTOUL_BASE16), &Value);\n- if (ACPI_FAILURE (Status))\n- {\n- DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, NULL);\n- }\n+ Value = AcpiUtImplicitStrtoul64 (Field->Value);\n \n switch (Info->Opcode)\n {\ndiff --git a/src/acpica/source/compiler/dtparser.y b/src/acpica/source/compiler/dtparser.y\nindex a2943ccc..d5990fe4 100644\n--- a/src/acpica/source/compiler/dtparser.y\n+++ b/src/acpica/source/compiler/dtparser.y\n@@ -275,17 +275,24 @@ Expression\n \n | EXPOP_LABEL { $$ = DtResolveLabel (DtParsertext);}\n \n- /* Default base for a non-prefixed integer is 16 */\n+ /*\n+ * All constants for the data table compiler are in hex, whether a (optional) 0x\n+ * prefix is present or not. For example, these two input strings are equivalent:\n+ * 1234\n+ * 0x1234\n+ */\n \n- | EXPOP_NUMBER { AcpiUtStrtoul64 (DtParsertext, (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &$$);}\n+ /* Non-prefixed hex number */\n+\n+ | EXPOP_NUMBER { $$ = DtDoConstant (DtParsertext);}\n \n /* Standard hex number (0x1234) */\n \n- | EXPOP_HEX_NUMBER { AcpiUtStrtoul64 (DtParsertext, (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &$$);}\n+ | EXPOP_HEX_NUMBER { $$ = DtDoConstant (DtParsertext);}\n \n- /* TBD: Decimal number with prefix (0d1234) - Not supported by strtoul64 at this time */\n+ /* Possible TBD: Decimal number with prefix (0d1234) - Not supported this time */\n \n- | EXPOP_DECIMAL_NUMBER { AcpiUtStrtoul64 (DtParsertext, ACPI_STRTOUL_64BIT, &$$);}\n+ | EXPOP_DECIMAL_NUMBER { $$ = DtDoConstant (DtParsertext);}\n ;\n %%\n \ndiff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c\nindex 6edcf637..c6c89eaa 100644\n--- a/src/acpica/source/compiler/dtutils.c\n+++ b/src/acpica/source/compiler/dtutils.c\n@@ -303,6 +303,38 @@ DtFatal (\n }\n \n \n+/*******************************************************************************\n+ *\n+ * FUNCTION: DtDoConstant\n+ *\n+ * PARAMETERS: String - Only hex constants are supported,\n+ * regardless of whether the 0x prefix\n+ * is used\n+ *\n+ * RETURN: Converted Integer\n+ *\n+ * DESCRIPTION: Convert a string to an integer, with overflow/error checking.\n+ *\n+ ******************************************************************************/\n+\n+UINT64\n+DtDoConstant (\n+ char *String)\n+{\n+ UINT64 ConvertedInteger;\n+\n+\n+ /*\n+ * TBD: The ImplicitStrtoul64 function does not report overflow\n+ * conditions. The input string is simply truncated. If it is\n+ * desired to report overflow to the table compiler, this should\n+ * somehow be added here. Note: integers that are prefixed with 0x\n+ * or not are both hex integers.\n+ */\n+ ConvertedInteger = AcpiUtImplicitStrtoul64 (String);\n+ return (ConvertedInteger);\n+}\n+\n /******************************************************************************\n *\n * FUNCTION: DtGetFieldValue\ndiff --git a/src/acpica/source/compiler/prparser.y b/src/acpica/source/compiler/prparser.y\nindex 2ad79e45..d24a5bbe 100644\n--- a/src/acpica/source/compiler/prparser.y\n+++ b/src/acpica/source/compiler/prparser.y\n@@ -290,11 +290,11 @@ Expression\n \n /* Default base for a non-prefixed integer is 10 */\n \n- | EXPOP_NUMBER { AcpiUtStrtoul64 (PrParsertext, ACPI_STRTOUL_64BIT, &$$);}\n+ | EXPOP_NUMBER { AcpiUtStrtoul64 (PrParsertext, &$$);}\n \n /* Standard hex number (0x1234) */\n \n- | EXPOP_HEX_NUMBER { AcpiUtStrtoul64 (PrParsertext, (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &$$);}\n+ | EXPOP_HEX_NUMBER { AcpiUtStrtoul64 (PrParsertext, &$$);}\n ;\n %%\n \ndiff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c\nindex e02ddb40..e06bc026 100644\n--- a/src/acpica/source/components/debugger/dbconvert.c\n+++ b/src/acpica/source/components/debugger/dbconvert.c\n@@ -429,9 +429,7 @@ AcpiDbConvertToObject (\n default:\n \n Object->Type = ACPI_TYPE_INTEGER;\n- Status = AcpiUtStrtoul64 (String,\n- (AcpiGbl_IntegerByteWidth | ACPI_STRTOUL_BASE16),\n- &Object->Integer.Value);\n+ Status = AcpiUtStrtoul64 (String, &Object->Integer.Value);\n break;\n }\n \ndiff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c\nindex 3c24855f..c50c1c42 100644\n--- a/src/acpica/source/components/disassembler/dmresrc.c\n+++ b/src/acpica/source/components/disassembler/dmresrc.c\n@@ -539,6 +539,20 @@ AcpiDmIsResourceTemplate (\n Aml = NextOp->Named.Data;\n BufferLength = NextOp->Common.Value.Size;\n \n+ /*\n+ * Any buffer smaller than one byte cannot possibly be a resource\n+ * template. Two bytes could possibly be a \"NULL\" resource template\n+ * with a lone end tag descriptor (as generated via\n+ * \"ResourceTemplate(){}\"), but this would be an extremely unusual\n+ * case, as the template would be essentially useless. The disassembler\n+ * therefore does not recognize any two-byte buffer as a resource\n+ * template.\n+ */\n+ if (BufferLength <= 2)\n+ {\n+ return (AE_TYPE);\n+ }\n+\n /*\n * Not a template if declared buffer length != actual length of the\n * intialization byte list. Because the resource macros will create\ndiff --git a/src/acpica/source/components/dispatcher/dswexec.c b/src/acpica/source/components/dispatcher/dswexec.c\nindex dfdfeaa0..bbb9436a 100644\n--- a/src/acpica/source/components/dispatcher/dswexec.c\n+++ b/src/acpica/source/components/dispatcher/dswexec.c\n@@ -253,7 +253,7 @@ AcpiDsGetPredicateValue (\n * object. Implicitly convert the argument if necessary.\n */\n Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc,\n- ACPI_STRTOUL_BASE16);\n+ ACPI_IMPLICIT_CONVERSION);\n if (ACPI_FAILURE (Status))\n {\n goto Cleanup;\ndiff --git a/src/acpica/source/components/events/evgpe.c b/src/acpica/source/components/events/evgpe.c\nindex 13b3e049..a00dc378 100644\n--- a/src/acpica/source/components/events/evgpe.c\n+++ b/src/acpica/source/components/events/evgpe.c\n@@ -551,8 +551,8 @@ AcpiEvGpeDetect (\n ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;\n UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;\n UINT8 EnabledStatusByte;\n- UINT32 StatusReg;\n- UINT32 EnableReg;\n+ UINT64 StatusReg;\n+ UINT64 EnableReg;\n ACPI_CPU_FLAGS Flags;\n UINT32 i;\n UINT32 j;\n@@ -629,7 +629,7 @@ AcpiEvGpeDetect (\n \"RunEnable=%02X, WakeEnable=%02X\\n\",\n GpeRegisterInfo->BaseGpeNumber,\n GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),\n- StatusReg, EnableReg,\n+ (UINT32) StatusReg, (UINT32) EnableReg,\n GpeRegisterInfo->EnableForRun,\n GpeRegisterInfo->EnableForWake));\n \ndiff --git a/src/acpica/source/components/executer/exconcat.c b/src/acpica/source/components/executer/exconcat.c\nindex e5f077db..67d592cd 100644\n--- a/src/acpica/source/components/executer/exconcat.c\n+++ b/src/acpica/source/components/executer/exconcat.c\n@@ -274,7 +274,7 @@ AcpiExDoConcatenate (\n case ACPI_TYPE_INTEGER:\n \n Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1,\n- ACPI_STRTOUL_BASE16);\n+ ACPI_IMPLICIT_CONVERSION);\n break;\n \n case ACPI_TYPE_BUFFER:\ndiff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c\nindex 8c0ae75c..8577a45e 100644\n--- a/src/acpica/source/components/executer/exconvrt.c\n+++ b/src/acpica/source/components/executer/exconvrt.c\n@@ -172,10 +172,10 @@ AcpiExConvertToAscii (\n *\n * FUNCTION: AcpiExConvertToInteger\n *\n- * PARAMETERS: ObjDesc - Object to be converted. Must be an\n- * Integer, Buffer, or String\n- * ResultDesc - Where the new Integer object is returned\n- * Flags - Used for string conversion\n+ * PARAMETERS: ObjDesc - Object to be converted. Must be an\n+ * Integer, Buffer, or String\n+ * ResultDesc - Where the new Integer object is returned\n+ * ImplicitConversion - Used for string conversion\n *\n * RETURN: Status\n *\n@@ -187,14 +187,13 @@ ACPI_STATUS\n AcpiExConvertToInteger (\n ACPI_OPERAND_OBJECT *ObjDesc,\n ACPI_OPERAND_OBJECT **ResultDesc,\n- UINT32 Flags)\n+ UINT32 ImplicitConversion)\n {\n ACPI_OPERAND_OBJECT *ReturnDesc;\n UINT8 *Pointer;\n UINT64 Result;\n UINT32 i;\n UINT32 Count;\n- ACPI_STATUS Status;\n \n \n ACPI_FUNCTION_TRACE_PTR (ExConvertToInteger, ObjDesc);\n@@ -244,12 +243,17 @@ AcpiExConvertToInteger (\n * hexadecimal as per the ACPI specification. The only exception (as\n * of ACPI 3.0) is that the ToInteger() operator allows both decimal\n * and hexadecimal strings (hex prefixed with \"0x\").\n+ *\n+ * Explicit conversion is used only by ToInteger.\n+ * All other string-to-integer conversions are implicit conversions.\n */\n- Status = AcpiUtStrtoul64 (ACPI_CAST_PTR (char, Pointer),\n- (AcpiGbl_IntegerByteWidth | Flags), &Result);\n- if (ACPI_FAILURE (Status))\n+ if (ImplicitConversion)\n+ {\n+ Result = AcpiUtImplicitStrtoul64 (ACPI_CAST_PTR (char, Pointer));\n+ }\n+ else\n {\n- return_ACPI_STATUS (Status);\n+ Result = AcpiUtExplicitStrtoul64 (ACPI_CAST_PTR (char, Pointer));\n }\n break;\n \n@@ -792,7 +796,7 @@ AcpiExConvertToTargetType (\n * a Buffer or a String to an Integer if necessary.\n */\n Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,\n- ACPI_STRTOUL_BASE16);\n+ ACPI_IMPLICIT_CONVERSION);\n break;\n \n case ACPI_TYPE_STRING:\ndiff --git a/src/acpica/source/components/executer/exmisc.c b/src/acpica/source/components/executer/exmisc.c\nindex dfa4421a..8e92f7a0 100644\n--- a/src/acpica/source/components/executer/exmisc.c\n+++ b/src/acpica/source/components/executer/exmisc.c\n@@ -472,7 +472,7 @@ AcpiExDoLogicalOp (\n case ACPI_TYPE_INTEGER:\n \n Status = AcpiExConvertToInteger (Operand1, &LocalOperand1,\n- ACPI_STRTOUL_BASE16);\n+ ACPI_IMPLICIT_CONVERSION);\n break;\n \n case ACPI_TYPE_STRING:\ndiff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c\nindex 0cd216ce..e33608c2 100644\n--- a/src/acpica/source/components/executer/exresop.c\n+++ b/src/acpica/source/components/executer/exresop.c\n@@ -541,7 +541,7 @@ AcpiExResolveOperands (\n * Known as \"Implicit Source Operand Conversion\"\n */\n Status = AcpiExConvertToInteger (ObjDesc, StackPtr,\n- ACPI_STRTOUL_BASE16);\n+ ACPI_IMPLICIT_CONVERSION);\n if (ACPI_FAILURE (Status))\n {\n if (Status == AE_TYPE)\ndiff --git a/src/acpica/source/components/hardware/hwgpe.c b/src/acpica/source/components/hardware/hwgpe.c\nindex 56ccb78d..636639be 100644\n--- a/src/acpica/source/components/hardware/hwgpe.c\n+++ b/src/acpica/source/components/hardware/hwgpe.c\n@@ -217,7 +217,7 @@ AcpiHwLowSetGpe (\n {\n ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;\n ACPI_STATUS Status = AE_OK;\n- UINT32 EnableMask;\n+ UINT64 EnableMask;\n UINT32 RegisterBit;\n \n \n@@ -342,7 +342,7 @@ AcpiHwGetGpeStatus (\n ACPI_GPE_EVENT_INFO *GpeEventInfo,\n ACPI_EVENT_STATUS *EventStatus)\n {\n- UINT32 InByte;\n+ UINT64 InByte;\n UINT32 RegisterBit;\n ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;\n ACPI_EVENT_STATUS LocalEventStatus = 0;\ndiff --git a/src/acpica/source/components/hardware/hwregs.c b/src/acpica/source/components/hardware/hwregs.c\nindex b5b23831..cd8e774a 100644\n--- a/src/acpica/source/components/hardware/hwregs.c\n+++ b/src/acpica/source/components/hardware/hwregs.c\n@@ -355,9 +355,8 @@ AcpiHwValidateRegister (\n *\n * RETURN: Status\n *\n- * DESCRIPTION: Read from either memory or IO space. This is a 32-bit max\n- * version of AcpiRead, used internally since the overhead of\n- * 64-bit values is not needed.\n+ * DESCRIPTION: Read from either memory or IO space. This is a 64-bit max\n+ * version of AcpiRead.\n *\n * LIMITATIONS: <These limitations also apply to AcpiHwWrite>\n * SpaceID must be SystemMemory or SystemIO.\n@@ -366,7 +365,7 @@ AcpiHwValidateRegister (\n \n ACPI_STATUS\n AcpiHwRead (\n- UINT32 *Value,\n+ UINT64 *Value,\n ACPI_GENERIC_ADDRESS *Reg)\n {\n UINT64 Address;\n@@ -384,18 +383,18 @@ AcpiHwRead (\n \n /* Validate contents of the GAS register */\n \n- Status = AcpiHwValidateRegister (Reg, 32, &Address);\n+ Status = AcpiHwValidateRegister (Reg, 64, &Address);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\n }\n \n /*\n- * Initialize entire 32-bit return value to zero, convert AccessWidth\n+ * Initialize entire 64-bit return value to zero, convert AccessWidth\n * into number of bits based\n */\n *Value = 0;\n- AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 32);\n+ AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64);\n BitWidth = Reg->BitOffset + Reg->BitWidth;\n BitOffset = Reg->BitOffset;\n \n@@ -408,7 +407,7 @@ AcpiHwRead (\n {\n if (BitOffset >= AccessWidth)\n {\n- Value32 = 0;\n+ Value64 = 0;\n BitOffset -= AccessWidth;\n }\n else\n@@ -418,31 +417,31 @@ AcpiHwRead (\n Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)\n Address + Index * ACPI_DIV_8 (AccessWidth),\n &Value64, AccessWidth);\n- Value32 = (UINT32) Value64;\n }\n else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */\n {\n Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)\n Address + Index * ACPI_DIV_8 (AccessWidth),\n &Value32, AccessWidth);\n+ Value64 = (UINT64) Value32;\n }\n }\n \n /*\n * Use offset style bit writes because \"Index * AccessWidth\" is\n- * ensured to be less than 32-bits by AcpiHwValidateRegister().\n+ * ensured to be less than 64-bits by AcpiHwValidateRegister().\n */\n ACPI_SET_BITS (Value, Index * AccessWidth,\n- ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32);\n+ ACPI_MASK_BITS_ABOVE_64 (AccessWidth), Value64);\n \n BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;\n Index++;\n }\n \n ACPI_DEBUG_PRINT ((ACPI_DB_IO,\n- \"Read: %8.8X width %2d from %8.8X%8.8X (%s)\\n\",\n- *Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),\n- AcpiUtGetRegionName (Reg->SpaceId)));\n+ \"Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\\n\",\n+ ACPI_FORMAT_UINT64 (*Value), AccessWidth,\n+ ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));\n \n return (Status);\n }\n@@ -457,15 +456,14 @@ AcpiHwRead (\n *\n * RETURN: Status\n *\n- * DESCRIPTION: Write to either memory or IO space. This is a 32-bit max\n- * version of AcpiWrite, used internally since the overhead of\n- * 64-bit values is not needed.\n+ * DESCRIPTION: Write to either memory or IO space. This is a 64-bit max\n+ * version of AcpiWrite.\n *\n ******************************************************************************/\n \n ACPI_STATUS\n AcpiHwWrite (\n- UINT32 Value,\n+ UINT64 Value,\n ACPI_GENERIC_ADDRESS *Reg)\n {\n UINT64 Address;\n@@ -473,7 +471,6 @@ AcpiHwWrite (\n UINT32 BitWidth;\n UINT8 BitOffset;\n UINT64 Value64;\n- UINT32 Value32;\n UINT8 Index;\n ACPI_STATUS Status;\n \n@@ -483,7 +480,7 @@ AcpiHwWrite (\n \n /* Validate contents of the GAS register */\n \n- Status = AcpiHwValidateRegister (Reg, 32, &Address);\n+ Status = AcpiHwValidateRegister (Reg, 64, &Address);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\n@@ -491,7 +488,7 @@ AcpiHwWrite (\n \n /* Convert AccessWidth into number of bits based */\n \n- AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 32);\n+ AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64);\n BitWidth = Reg->BitOffset + Reg->BitWidth;\n BitOffset = Reg->BitOffset;\n \n@@ -504,10 +501,10 @@ AcpiHwWrite (\n {\n /*\n * Use offset style bit reads because \"Index * AccessWidth\" is\n- * ensured to be less than 32-bits by AcpiHwValidateRegister().\n+ * ensured to be less than 64-bits by AcpiHwValidateRegister().\n */\n- Value32 = ACPI_GET_BITS (&Value, Index * AccessWidth,\n- ACPI_MASK_BITS_ABOVE_32 (AccessWidth));\n+ Value64 = ACPI_GET_BITS (&Value, Index * AccessWidth,\n+ ACPI_MASK_BITS_ABOVE_64 (AccessWidth));\n \n if (BitOffset >= AccessWidth)\n {\n@@ -517,7 +514,6 @@ AcpiHwWrite (\n {\n if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)\n {\n- Value64 = (UINT64) Value32;\n Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)\n Address + Index * ACPI_DIV_8 (AccessWidth),\n Value64, AccessWidth);\n@@ -526,7 +522,7 @@ AcpiHwWrite (\n {\n Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)\n Address + Index * ACPI_DIV_8 (AccessWidth),\n- Value32, AccessWidth);\n+ (UINT32) Value64, AccessWidth);\n }\n }\n \n@@ -539,9 +535,9 @@ AcpiHwWrite (\n }\n \n ACPI_DEBUG_PRINT ((ACPI_DB_IO,\n- \"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\\n\",\n- Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),\n- AcpiUtGetRegionName (Reg->SpaceId)));\n+ \"Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\\n\",\n+ ACPI_FORMAT_UINT64 (Value), AccessWidth,\n+ ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));\n \n return (Status);\n }\n@@ -688,6 +684,7 @@ AcpiHwRegisterRead (\n UINT32 *ReturnValue)\n {\n UINT32 Value = 0;\n+ UINT64 Value64;\n ACPI_STATUS Status;\n \n \n@@ -726,12 +723,14 @@ AcpiHwRegisterRead (\n \n case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */\n \n- Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);\n+ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock);\n+ Value = (UINT32) Value64;\n break;\n \n case ACPI_REGISTER_PM_TIMER: /* 32-bit access */\n \n- Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);\n+ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock);\n+ Value = (UINT32) Value64;\n break;\n \n case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */\n@@ -749,7 +748,7 @@ AcpiHwRegisterRead (\n \n if (ACPI_SUCCESS (Status))\n {\n- *ReturnValue = Value;\n+ *ReturnValue = (UINT32) Value;\n }\n \n return_ACPI_STATUS (Status);\n@@ -789,6 +788,7 @@ AcpiHwRegisterWrite (\n {\n ACPI_STATUS Status;\n UINT32 ReadValue;\n+ UINT64 ReadValue64;\n \n \n ACPI_FUNCTION_TRACE (HwRegisterWrite);\n@@ -850,11 +850,12 @@ AcpiHwRegisterWrite (\n * For control registers, all reserved bits must be preserved,\n * as per the ACPI spec.\n */\n- Status = AcpiHwRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock);\n+ Status = AcpiHwRead (&ReadValue64, &AcpiGbl_FADT.XPm2ControlBlock);\n if (ACPI_FAILURE (Status))\n {\n goto Exit;\n }\n+ ReadValue = (UINT32) ReadValue64;\n \n /* Insert the bits to be preserved */\n \n@@ -910,26 +911,29 @@ AcpiHwReadMultiple (\n {\n UINT32 ValueA = 0;\n UINT32 ValueB = 0;\n+ UINT64 Value64;\n ACPI_STATUS Status;\n \n \n /* The first register is always required */\n \n- Status = AcpiHwRead (&ValueA, RegisterA);\n+ Status = AcpiHwRead (&Value64, RegisterA);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\n }\n+ ValueA = (UINT32) Value64;\n \n /* Second register is optional */\n \n if (RegisterB->Address)\n {\n- Status = AcpiHwRead (&ValueB, RegisterB);\n+ Status = AcpiHwRead (&Value64, RegisterB);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\n }\n+ ValueB = (UINT32) Value64;\n }\n \n /*\ndiff --git a/src/acpica/source/components/hardware/hwxface.c b/src/acpica/source/components/hardware/hwxface.c\nindex 3627a971..49a19e45 100644\n--- a/src/acpica/source/components/hardware/hwxface.c\n+++ b/src/acpica/source/components/hardware/hwxface.c\n@@ -247,84 +247,14 @@ AcpiRead (\n UINT64 *ReturnValue,\n ACPI_GENERIC_ADDRESS *Reg)\n {\n- UINT32 ValueLo;\n- UINT32 ValueHi;\n- UINT32 Width;\n- UINT64 Address;\n ACPI_STATUS Status;\n \n \n ACPI_FUNCTION_NAME (AcpiRead);\n \n \n- if (!ReturnValue)\n- {\n- return (AE_BAD_PARAMETER);\n- }\n-\n- /* Validate contents of the GAS register. Allow 64-bit transfers */\n-\n- Status = AcpiHwValidateRegister (Reg, 64, &Address);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n-\n- /*\n- * Two address spaces supported: Memory or I/O. PCI_Config is\n- * not supported here because the GAS structure is insufficient\n- */\n- if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)\n- {\n- Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)\n- Address, ReturnValue, Reg->BitWidth);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n- }\n- else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */\n- {\n- ValueLo = 0;\n- ValueHi = 0;\n-\n- Width = Reg->BitWidth;\n- if (Width == 64)\n- {\n- Width = 32; /* Break into two 32-bit transfers */\n- }\n-\n- Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)\n- Address, &ValueLo, Width);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n-\n- if (Reg->BitWidth == 64)\n- {\n- /* Read the top 32 bits */\n-\n- Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)\n- (Address + 4), &ValueHi, 32);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n- }\n-\n- /* Set the return value only if status is AE_OK */\n-\n- *ReturnValue = (ValueLo | ((UINT64) ValueHi << 32));\n- }\n-\n- ACPI_DEBUG_PRINT ((ACPI_DB_IO,\n- \"Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\\n\",\n- ACPI_FORMAT_UINT64 (*ReturnValue), Reg->BitWidth,\n- ACPI_FORMAT_UINT64 (Address),\n- AcpiUtGetRegionName (Reg->SpaceId)));\n-\n- return (AE_OK);\n+ Status = AcpiHwRead (ReturnValue, Reg);\n+ return (Status);\n }\n \n ACPI_EXPORT_SYMBOL (AcpiRead)\n@@ -348,67 +278,13 @@ AcpiWrite (\n UINT64 Value,\n ACPI_GENERIC_ADDRESS *Reg)\n {\n- UINT32 Width;\n- UINT64 Address;\n ACPI_STATUS Status;\n \n \n ACPI_FUNCTION_NAME (AcpiWrite);\n \n \n- /* Validate contents of the GAS register. Allow 64-bit transfers */\n-\n- Status = AcpiHwValidateRegister (Reg, 64, &Address);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n-\n- /*\n- * Two address spaces supported: Memory or IO. PCI_Config is\n- * not supported here because the GAS structure is insufficient\n- */\n- if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)\n- {\n- Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)\n- Address, Value, Reg->BitWidth);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n- }\n- else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */\n- {\n- Width = Reg->BitWidth;\n- if (Width == 64)\n- {\n- Width = 32; /* Break into two 32-bit transfers */\n- }\n-\n- Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)\n- Address, ACPI_LODWORD (Value), Width);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n-\n- if (Reg->BitWidth == 64)\n- {\n- Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)\n- (Address + 4), ACPI_HIDWORD (Value), 32);\n- if (ACPI_FAILURE (Status))\n- {\n- return (Status);\n- }\n- }\n- }\n-\n- ACPI_DEBUG_PRINT ((ACPI_DB_IO,\n- \"Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\\n\",\n- ACPI_FORMAT_UINT64 (Value), Reg->BitWidth,\n- ACPI_FORMAT_UINT64 (Address),\n- AcpiUtGetRegionName (Reg->SpaceId)));\n-\n+ Status = AcpiHwWrite (Value, Reg);\n return (Status);\n }\n \ndiff --git a/src/acpica/source/components/namespace/nsconvert.c b/src/acpica/source/components/namespace/nsconvert.c\nindex daf8f475..bb825895 100644\n--- a/src/acpica/source/components/namespace/nsconvert.c\n+++ b/src/acpica/source/components/namespace/nsconvert.c\n@@ -191,8 +191,7 @@ AcpiNsConvertToInteger (\n \n /* String-to-Integer conversion */\n \n- Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,\n- AcpiGbl_IntegerByteWidth, &Value);\n+ Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, &Value);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\ndiff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c\nindex d8cb6b18..6393bdac 100644\n--- a/src/acpica/source/components/tables/tbxface.c\n+++ b/src/acpica/source/components/tables/tbxface.c\n@@ -300,10 +300,13 @@ AcpiReallocateRootTable (\n \n \n /*\n- * Only reallocate the root table if the host provided a static buffer\n- * for the table array in the call to AcpiInitializeTables.\n+ * If there are tables unverified, it is required to reallocate the\n+ * root table list to clean up invalid table entries. Otherwise only\n+ * reallocate the root table list if the host provided a static buffer\n+ * for the table array in the call to AcpiInitializeTables().\n */\n- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)\n+ if ((AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) &&\n+ AcpiGbl_EnableTableValidation)\n {\n return_ACPI_STATUS (AE_SUPPORT);\n }\ndiff --git a/src/acpica/source/components/utilities/utstrsuppt.c b/src/acpica/source/components/utilities/utstrsuppt.c\nnew file mode 100644\nindex 00000000..9197a57a\n--- /dev/null\n+++ b/src/acpica/source/components/utilities/utstrsuppt.c\n@@ -0,0 +1,613 @@\n+/*******************************************************************************\n+ *\n+ * Module Name: utstrsuppt - Support functions for string-to-integer conversion\n+ *\n+ ******************************************************************************/\n+\n+/******************************************************************************\n+ *\n+ * 1. Copyright Notice\n+ *\n+ * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.\n+ * All rights reserved.\n+ *\n+ * 2. License\n+ *\n+ * 2.1. This is your license from Intel Corp. under its intellectual property\n+ * rights. You may have additional license terms from the party that provided\n+ * you this software, covering your right to use that party's intellectual\n+ * property rights.\n+ *\n+ * 2.2. Intel grants, free of charge, to any person (\"Licensee\") obtaining a\n+ * copy of the source code appearing in this file (\"Covered Code\") an\n+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the\n+ * base code distributed originally by Intel (\"Original Intel Code\") to copy,\n+ * make derivatives, distribute, use and display any portion of the Covered\n+ * Code in any form, with the right to sublicense such rights; and\n+ *\n+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent\n+ * license (with the right to sublicense), under only those claims of Intel\n+ * patents that are infringed by the Original Intel Code, to make, use, sell,\n+ * offer to sell, and import the Covered Code and derivative works thereof\n+ * solely to the minimum extent necessary to exercise the above copyright\n+ * license, and in no event shall the patent license extend to any additions\n+ * to or modifications of the Original Intel Code. No other license or right\n+ * is granted directly or by implication, estoppel or otherwise;\n+ *\n+ * The above copyright and patent license is granted only if the following\n+ * conditions are met:\n+ *\n+ * 3. Conditions\n+ *\n+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.\n+ * Redistribution of source code of any substantial portion of the Covered\n+ * Code or modification with rights to further distribute source must include\n+ * the above Copyright Notice, the above License, this list of Conditions,\n+ * and the following Disclaimer and Export Compliance provision. In addition,\n+ * Licensee must cause all Covered Code to which Licensee contributes to\n+ * contain a file documenting the changes Licensee made to create that Covered\n+ * Code and the date of any change. Licensee must include in that file the\n+ * documentation of any changes made by any predecessor Licensee. Licensee\n+ * must include a prominent statement that the modification is derived,\n+ * directly or indirectly, from Original Intel Code.\n+ *\n+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.\n+ * Redistribution of source code of any substantial portion of the Covered\n+ * Code or modification without rights to further distribute source must\n+ * include the following Disclaimer and Export Compliance provision in the\n+ * documentation and/or other materials provided with distribution. In\n+ * addition, Licensee may not authorize further sublicense of source of any\n+ * portion of the Covered Code, and must include terms to the effect that the\n+ * license from Licensee to its licensee is limited to the intellectual\n+ * property embodied in the software Licensee provides to its licensee, and\n+ * not to intellectual property embodied in modifications its licensee may\n+ * make.\n+ *\n+ * 3.3. Redistribution of Executable. Redistribution in executable form of any\n+ * substantial portion of the Covered Code or modification must reproduce the\n+ * above Copyright Notice, and the following Disclaimer and Export Compliance\n+ * provision in the documentation and/or other materials provided with the\n+ * distribution.\n+ *\n+ * 3.4. Intel retains all right, title, and interest in and to the Original\n+ * Intel Code.\n+ *\n+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by\n+ * Intel shall be used in advertising or otherwise to promote the sale, use or\n+ * other dealings in products derived from or relating to the Covered Code\n+ * without prior written authorization from Intel.\n+ *\n+ * 4. Disclaimer and Export Compliance\n+ *\n+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED\n+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE\n+ * IS PROVIDED \"AS IS,\" AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,\n+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY\n+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A\n+ * PARTICULAR PURPOSE.\n+ *\n+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES\n+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR\n+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,\n+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY\n+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL\n+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS\n+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY\n+ * LIMITED REMEDY.\n+ *\n+ * 4.3. Licensee shall not export, either directly or indirectly, any of this\n+ * software or system incorporating such software without first obtaining any\n+ * required license or other approval from the U. S. Department of Commerce or\n+ * any other agency or department of the United States Government. In the\n+ * event Licensee exports any such software from the United States or\n+ * re-exports any such software from a foreign destination, Licensee shall\n+ * ensure that the distribution and export/re-export of the software is in\n+ * compliance with all laws, regulations, orders, or other restrictions of the\n+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor\n+ * any of its subsidiaries will export/re-export any technical data, process,\n+ * software, or service, directly or indirectly, to any country for which the\n+ * United States government or any agency thereof requires an export license,\n+ * other governmental approval, or letter of assurance, without first obtaining\n+ * such license, approval or letter.\n+ *\n+ *****************************************************************************\n+ *\n+ * Alternatively, you may choose to be licensed under the terms of the\n+ * following license:\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ * 1. Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions, and the following disclaimer,\n+ * without modification.\n+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer\n+ * substantially similar to the \"NO WARRANTY\" disclaimer below\n+ * (\"Disclaimer\") and any redistribution must be conditioned upon\n+ * including a substantially similar Disclaimer requirement for further\n+ * binary redistribution.\n+ * 3. Neither the names of the above-listed copyright holders nor the names\n+ * of any contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ * Alternatively, you may choose to be licensed under the terms of the\n+ * GNU General Public License (\"GPL\") version 2 as published by the Free\n+ * Software Foundation.\n+ *\n+ *****************************************************************************/\n+\n+#include \"acpi.h\"\n+#include \"accommon.h\"\n+\n+#define _COMPONENT ACPI_UTILITIES\n+ ACPI_MODULE_NAME (\"utstrsuppt\")\n+\n+\n+/* Local prototypes */\n+\n+static ACPI_STATUS\n+AcpiUtInsertDigit (\n+ UINT64 *AccumulatedValue,\n+ UINT32 Base,\n+ int AsciiDigit);\n+\n+static ACPI_STATUS\n+AcpiUtStrtoulMultiply64 (\n+ UINT64 Multiplicand,\n+ UINT64 Multiplier,\n+ UINT64 *OutProduct);\n+\n+static ACPI_STATUS\n+AcpiUtStrtoulAdd64 (\n+ UINT64 Addend1,\n+ UINT64 Addend2,\n+ UINT64 *OutSum);\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtConvertOctalString\n+ *\n+ * PARAMETERS: String - Null terminated input string\n+ * ReturnValuePtr - Where the converted value is returned\n+ *\n+ * RETURN: Status and 64-bit converted integer\n+ *\n+ * DESCRIPTION: Performs a base 8 conversion of the input string to an\n+ * integer value, either 32 or 64 bits.\n+ *\n+ * NOTE: Maximum 64-bit unsigned octal value is 01777777777777777777777\n+ * Maximum 32-bit unsigned octal value is 037777777777\n+ *\n+ ******************************************************************************/\n+\n+ACPI_STATUS\n+AcpiUtConvertOctalString (\n+ char *String,\n+ UINT64 *ReturnValuePtr)\n+{\n+ UINT64 AccumulatedValue = 0;\n+ ACPI_STATUS Status = AE_OK;\n+\n+\n+ /* Convert each ASCII byte in the input string */\n+\n+ while (*String)\n+ {\n+ /* Character must be ASCII 0-7, otherwise terminate with no error */\n+\n+ if (!(ACPI_IS_OCTAL_DIGIT (*String)))\n+ {\n+ break;\n+ }\n+\n+ /* Convert and insert this octal digit into the accumulator */\n+\n+ Status = AcpiUtInsertDigit (&AccumulatedValue, 8, *String);\n+ if (ACPI_FAILURE (Status))\n+ {\n+ Status = AE_OCTAL_OVERFLOW;\n+ break;\n+ }\n+\n+ String++;\n+ }\n+\n+ /* Always return the value that has been accumulated */\n+\n+ *ReturnValuePtr = AccumulatedValue;\n+ return (Status);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtConvertDecimalString\n+ *\n+ * PARAMETERS: String - Null terminated input string\n+ * ReturnValuePtr - Where the converted value is returned\n+ *\n+ * RETURN: Status and 64-bit converted integer\n+ *\n+ * DESCRIPTION: Performs a base 10 conversion of the input string to an\n+ * integer value, either 32 or 64 bits.\n+ *\n+ * NOTE: Maximum 64-bit unsigned decimal value is 18446744073709551615\n+ * Maximum 32-bit unsigned decimal value is 4294967295\n+ *\n+ ******************************************************************************/\n+\n+ACPI_STATUS\n+AcpiUtConvertDecimalString (\n+ char *String,\n+ UINT64 *ReturnValuePtr)\n+{\n+ UINT64 AccumulatedValue = 0;\n+ ACPI_STATUS Status = AE_OK;\n+\n+\n+ /* Convert each ASCII byte in the input string */\n+\n+ while (*String)\n+ {\n+ /* Character must be ASCII 0-9, otherwise terminate with no error */\n+\n+ if (!isdigit (*String))\n+ {\n+ break;\n+ }\n+\n+ /* Convert and insert this decimal digit into the accumulator */\n+\n+ Status = AcpiUtInsertDigit (&AccumulatedValue, 10, *String);\n+ if (ACPI_FAILURE (Status))\n+ {\n+ Status = AE_DECIMAL_OVERFLOW;\n+ break;\n+ }\n+\n+ String++;\n+ }\n+\n+ /* Always return the value that has been accumulated */\n+\n+ *ReturnValuePtr = AccumulatedValue;\n+ return (Status);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtConvertHexString\n+ *\n+ * PARAMETERS: String - Null terminated input string\n+ * ReturnValuePtr - Where the converted value is returned\n+ *\n+ * RETURN: Status and 64-bit converted integer\n+ *\n+ * DESCRIPTION: Performs a base 16 conversion of the input string to an\n+ * integer value, either 32 or 64 bits.\n+ *\n+ * NOTE: Maximum 64-bit unsigned hex value is 0xFFFFFFFFFFFFFFFF\n+ * Maximum 32-bit unsigned hex value is 0xFFFFFFFF\n+ *\n+ ******************************************************************************/\n+\n+ACPI_STATUS\n+AcpiUtConvertHexString (\n+ char *String,\n+ UINT64 *ReturnValuePtr)\n+{\n+ UINT64 AccumulatedValue = 0;\n+ ACPI_STATUS Status = AE_OK;\n+\n+\n+ /* Convert each ASCII byte in the input string */\n+\n+ while (*String)\n+ {\n+ /* Must be ASCII A-F, a-f, or 0-9, otherwise terminate with no error */\n+\n+ if (!isxdigit (*String))\n+ {\n+ break;\n+ }\n+\n+ /* Convert and insert this hex digit into the accumulator */\n+\n+ Status = AcpiUtInsertDigit (&AccumulatedValue, 16, *String);\n+ if (ACPI_FAILURE (Status))\n+ {\n+ Status = AE_HEX_OVERFLOW;\n+ break;\n+ }\n+\n+ String++;\n+ }\n+\n+ /* Always return the value that has been accumulated */\n+\n+ *ReturnValuePtr = AccumulatedValue;\n+ return (Status);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtRemoveLeadingZeros\n+ *\n+ * PARAMETERS: String - Pointer to input ASCII string\n+ *\n+ * RETURN: Next character after any leading zeros. This character may be\n+ * used by the caller to detect end-of-string.\n+ *\n+ * DESCRIPTION: Remove any leading zeros in the input string. Return the\n+ * next character after the final ASCII zero to enable the caller\n+ * to check for the end of the string (NULL terminator).\n+ *\n+ ******************************************************************************/\n+\n+char\n+AcpiUtRemoveLeadingZeros (\n+ char **String)\n+{\n+\n+ while (**String == ACPI_ASCII_ZERO)\n+ {\n+ *String += 1;\n+ }\n+\n+ return (**String);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtRemoveWhitespace\n+ *\n+ * PARAMETERS: String - Pointer to input ASCII string\n+ *\n+ * RETURN: Next character after any whitespace. This character may be\n+ * used by the caller to detect end-of-string.\n+ *\n+ * DESCRIPTION: Remove any leading whitespace in the input string. Return the\n+ * next character after the final ASCII zero to enable the caller\n+ * to check for the end of the string (NULL terminator).\n+ *\n+ ******************************************************************************/\n+\n+char\n+AcpiUtRemoveWhitespace (\n+ char **String)\n+{\n+\n+ while (isspace ((UINT8) **String))\n+ {\n+ *String += 1;\n+ }\n+\n+ return (**String);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtDetectHexPrefix\n+ *\n+ * PARAMETERS: String - Pointer to input ASCII string\n+ *\n+ * RETURN: TRUE if a \"0x\" prefix was found at the start of the string\n+ *\n+ * DESCRIPTION: Detect and remove a hex \"0x\" prefix\n+ *\n+ ******************************************************************************/\n+\n+BOOLEAN\n+AcpiUtDetectHexPrefix (\n+ char **String)\n+{\n+\n+ if ((**String == ACPI_ASCII_ZERO) &&\n+ (tolower ((int) *(*String + 1)) == 'x'))\n+ {\n+ *String += 2; /* Go past the leading 0x */\n+ return (TRUE);\n+ }\n+\n+ return (FALSE); /* Not a hex string */\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtDetectOctalPrefix\n+ *\n+ * PARAMETERS: String - Pointer to input ASCII string\n+ *\n+ * RETURN: True if an octal \"0\" prefix was found at the start of the\n+ * string\n+ *\n+ * DESCRIPTION: Detect and remove an octal prefix (zero)\n+ *\n+ ******************************************************************************/\n+\n+BOOLEAN\n+AcpiUtDetectOctalPrefix (\n+ char **String)\n+{\n+\n+ if (**String == ACPI_ASCII_ZERO)\n+ {\n+ *String += 1; /* Go past the leading 0 */\n+ return (TRUE);\n+ }\n+\n+ return (FALSE); /* Not an octal string */\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtInsertDigit\n+ *\n+ * PARAMETERS: AccumulatedValue - Current value of the integer value\n+ * accumulator. The new value is\n+ * returned here.\n+ * Base - Radix, either 8/10/16\n+ * AsciiDigit - ASCII single digit to be inserted\n+ *\n+ * RETURN: Status and result of the convert/insert operation. The only\n+ * possible returned exception code is numeric overflow of\n+ * either the multiply or add conversion operations.\n+ *\n+ * DESCRIPTION: Generic conversion and insertion function for all bases:\n+ *\n+ * 1) Multiply the current accumulated/converted value by the\n+ * base in order to make room for the new character.\n+ *\n+ * 2) Convert the new character to binary and add it to the\n+ * current accumulated value.\n+ *\n+ * Note: The only possible exception indicates an integer\n+ * overflow (AE_NUMERIC_OVERFLOW)\n+ *\n+ ******************************************************************************/\n+\n+static ACPI_STATUS\n+AcpiUtInsertDigit (\n+ UINT64 *AccumulatedValue,\n+ UINT32 Base,\n+ int AsciiDigit)\n+{\n+ ACPI_STATUS Status;\n+ UINT64 Product;\n+\n+\n+ /* Make room in the accumulated value for the incoming digit */\n+\n+ Status = AcpiUtStrtoulMultiply64 (*AccumulatedValue, Base, &Product);\n+ if (ACPI_FAILURE (Status))\n+ {\n+ return (Status);\n+ }\n+\n+ /* Add in the new digit, and store the sum to the accumulated value */\n+\n+ Status = AcpiUtStrtoulAdd64 (Product, AcpiUtAsciiCharToHex (AsciiDigit),\n+ AccumulatedValue);\n+\n+ return (Status);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtStrtoulMultiply64\n+ *\n+ * PARAMETERS: Multiplicand - Current accumulated converted integer\n+ * Multiplier - Base/Radix\n+ * OutProduct - Where the product is returned\n+ *\n+ * RETURN: Status and 64-bit product\n+ *\n+ * DESCRIPTION: Multiply two 64-bit values, with checking for 64-bit overflow as\n+ * well as 32-bit overflow if necessary (if the current global\n+ * integer width is 32).\n+ *\n+ ******************************************************************************/\n+\n+static ACPI_STATUS\n+AcpiUtStrtoulMultiply64 (\n+ UINT64 Multiplicand,\n+ UINT64 Multiplier,\n+ UINT64 *OutProduct)\n+{\n+ UINT64 Product;\n+\n+\n+ /* Exit if either operand is zero */\n+\n+ *OutProduct = 0;\n+ if (!Multiplicand || !Multiplier)\n+ {\n+ return (AE_OK);\n+ }\n+\n+ /* Check for 64-bit overflow before the actual multiplication */\n+\n+ if (Multiplicand > (ACPI_UINT64_MAX / Multiplier))\n+ {\n+ return (AE_NUMERIC_OVERFLOW);\n+ }\n+\n+ Product = Multiplicand * Multiplier;\n+\n+ /* Check for 32-bit overflow if necessary */\n+\n+ if ((AcpiGbl_IntegerBitWidth == 32) && (Product > ACPI_UINT32_MAX))\n+ {\n+ return (AE_NUMERIC_OVERFLOW);\n+ }\n+\n+ *OutProduct = Product;\n+ return (AE_OK);\n+}\n+\n+\n+/*******************************************************************************\n+ *\n+ * FUNCTION: AcpiUtStrtoulAdd64\n+ *\n+ * PARAMETERS: Addend1 - Current accumulated converted integer\n+ * Addend2 - New hex value/char\n+ * OutSum - Where sum is returned (Accumulator)\n+ *\n+ * RETURN: Status and 64-bit sum\n+ *\n+ * DESCRIPTION: Add two 64-bit values, with checking for 64-bit overflow as\n+ * well as 32-bit overflow if necessary (if the current global\n+ * integer width is 32).\n+ *\n+ ******************************************************************************/\n+\n+static ACPI_STATUS\n+AcpiUtStrtoulAdd64 (\n+ UINT64 Addend1,\n+ UINT64 Addend2,\n+ UINT64 *OutSum)\n+{\n+ UINT64 Sum;\n+\n+\n+ /* Check for 64-bit overflow before the actual addition */\n+\n+ if ((Addend1 > 0) && (Addend2 > (ACPI_UINT64_MAX - Addend1)))\n+ {\n+ return (AE_NUMERIC_OVERFLOW);\n+ }\n+\n+ Sum = Addend1 + Addend2;\n+\n+ /* Check for 32-bit overflow if necessary */\n+\n+ if ((AcpiGbl_IntegerBitWidth == 32) && (Sum > ACPI_UINT32_MAX))\n+ {\n+ return (AE_NUMERIC_OVERFLOW);\n+ }\n+\n+ *OutSum = Sum;\n+ return (AE_OK);\n+}\ndiff --git a/src/acpica/source/components/utilities/utstrtoul64.c b/src/acpica/source/components/utilities/utstrtoul64.c\nindex d91e9084..34cef95b 100644\n--- a/src/acpica/source/components/utilities/utstrtoul64.c\n+++ b/src/acpica/source/components/utilities/utstrtoul64.c\n@@ -1,6 +1,7 @@\n /*******************************************************************************\n *\n- * Module Name: utstrtoul64 - string to 64-bit integer support\n+ * Module Name: utstrtoul64 - String-to-integer conversion support for both\n+ * 64-bit and 32-bit integers\n *\n ******************************************************************************/\n \n@@ -152,84 +153,47 @@\n #include \"acpi.h\"\n #include \"accommon.h\"\n \n-\n-/*******************************************************************************\n- *\n- * The functions in this module satisfy the need for 64-bit string-to-integer\n- * conversions on both 32-bit and 64-bit platforms.\n- *\n- ******************************************************************************/\n-\n #define _COMPONENT ACPI_UTILITIES\n ACPI_MODULE_NAME (\"utstrtoul64\")\n \n-/* Local prototypes */\n-\n-static UINT64\n-AcpiUtStrtoulBase10 (\n- char *String,\n- UINT32 Flags);\n-\n-static UINT64\n-AcpiUtStrtoulBase16 (\n- char *String,\n- UINT32 Flags);\n-\n \n /*******************************************************************************\n *\n- * String conversion rules as written in the ACPI specification. The error\n- * conditions and behavior are different depending on the type of conversion.\n- *\n- *\n- * Implicit data type conversion: string-to-integer\n- * --------------------------------------------------\n- *\n- * Base is always 16. This is the ACPI_STRTOUL_BASE16 case.\n- *\n- * Example:\n- * Add (\"BA98\", Arg0, Local0)\n- *\n- * The integer is initialized to the value zero.\n- * The ASCII string is interpreted as a hexadecimal constant.\n- *\n- * 1) A \"0x\" prefix is not allowed. However, ACPICA allows this for\n- * compatibility with previous ACPICA. (NO ERROR)\n- *\n- * 2) Terminates when the size of an integer is reached (32 or 64 bits).\n- * (NO ERROR)\n- *\n- * 3) The first non-hex character terminates the conversion without error.\n- * (NO ERROR)\n- *\n- * 4) Conversion of a null (zero-length) string to an integer is not\n- * allowed. However, ACPICA allows this for compatibility with previous\n- * ACPICA. This conversion returns the value 0. (NO ERROR)\n+ * This module contains the top-level string to 64/32-bit unsigned integer\n+ * conversion functions:\n *\n+ * 1) A standard strtoul() function that supports 64-bit integers, base\n+ * 8/10/16, with integer overflow support. This is used mainly by the\n+ * iASL compiler, which implements tighter constraints on integer\n+ * constants than the runtime (interpreter) integer-to-string conversions.\n+ * 2) Runtime \"Explicit conversion\" as defined in the ACPI specification.\n+ * 3) Runtime \"Implicit conversion\" as defined in the ACPI specification.\n *\n- * Explicit data type conversion: ToInteger() with string operand\n- * ---------------------------------------------------------------\n+ * Current users of this module:\n *\n- * Base is either 10 (default) or 16 (with 0x prefix)\n- *\n- * Examples:\n- * ToInteger (\"1000\")\n- * ToInteger (\"0xABCD\")\n- *\n- * 1) Can be (must be) either a decimal or hexadecimal numeric string.\n- * A hex value must be prefixed by \"0x\" or it is interpreted as a decimal.\n+ * iASL - Preprocessor (constants and math expressions)\n+ * iASL - Main parser, conversion of constants to integers\n+ * iASL - Data Table Compiler parser (constants and math expressions)\n+ * Interpreter - Implicit and explicit conversions, GPE method names\n+ * Interpreter - Repair code for return values from predefined names\n+ * Debugger - Command line input string conversion\n+ * AcpiDump - ACPI table physical addresses\n+ * AcpiExec - Support for namespace overrides\n *\n- * 2) The value must not exceed the maximum of an integer value. ACPI spec\n- * states the behavior is \"unpredictable\", so ACPICA matches the behavior\n- * of the implicit conversion case.(NO ERROR)\n+ * Notes concerning users of these interfaces:\n *\n- * 3) Behavior on the first non-hex character is not specified by the ACPI\n- * spec, so ACPICA matches the behavior of the implicit conversion case\n- * and terminates. (NO ERROR)\n+ * AcpiGbl_IntegerByteWidth is used to set the 32/64 bit limit for explicit\n+ * and implicit conversions. This global must be set to the proper width.\n+ * For the core ACPICA code, the width depends on the DSDT version. For the\n+ * AcpiUtStrtoul64 interface, all conversions are 64 bits. This interface is\n+ * used primarily for iASL, where the default width is 64 bits for all parsers,\n+ * but error checking is performed later to flag cases where a 64-bit constant\n+ * is wrongly defined in a 32-bit DSDT/SSDT.\n *\n- * 4) A null (zero-length) string is illegal.\n- * However, ACPICA allows this for compatibility with previous ACPICA.\n- * This conversion returns the value 0. (NO ERROR)\n+ * In ACPI, the only place where octal numbers are supported is within\n+ * the ASL language itself. This is implemented via the main AcpiUtStrtoul64\n+ * interface. According the ACPI specification, there is no ACPI runtime\n+ * support (explicit/implicit) for octal string conversions.\n *\n ******************************************************************************/\n \n@@ -238,261 +202,301 @@ AcpiUtStrtoulBase16 (\n *\n * FUNCTION: AcpiUtStrtoul64\n *\n- * PARAMETERS: String - Null terminated input string\n- * Flags - Conversion info, see below\n+ * PARAMETERS: String - Null terminated input string,\n+ * must be a valid pointer\n * ReturnValue - Where the converted integer is\n- * returned\n- *\n- * RETURN: Status and Converted value\n+ * returned. Must be a valid pointer\n *\n- * DESCRIPTION: Convert a string into an unsigned value. Performs either a\n- * 32-bit or 64-bit conversion, depending on the input integer\n- * size in Flags (often the current mode of the interpreter).\n+ * RETURN: Status and converted integer. Returns an exception on a\n+ * 64-bit numeric overflow\n *\n- * Values for Flags:\n- * ACPI_STRTOUL_32BIT - Max integer value is 32 bits\n- * ACPI_STRTOUL_64BIT - Max integer value is 64 bits\n- * ACPI_STRTOUL_BASE16 - Input string is hexadecimal. Default\n- * is 10/16 based on string prefix (0x).\n+ * DESCRIPTION: Convert a string into an unsigned integer. Always performs a\n+ * full 64-bit conversion, regardless of the current global\n+ * integer width. Supports Decimal, Hex, and Octal strings.\n *\n- * NOTES:\n- * Negative numbers are not supported, as they are not supported by ACPI.\n+ * Current users of this function:\n *\n- * Supports only base 16 or base 10 strings/values. Does not\n- * support Octal strings, as these are not supported by ACPI.\n- *\n- * Current users of this support:\n- *\n- * Interpreter - Implicit and explicit conversions, GPE method names\n- * Debugger - Command line input string conversion\n- * iASL - Main parser, conversion of constants to integers\n- * iASL - Data Table Compiler parser (constant math expressions)\n- * iASL - Preprocessor (constant math expressions)\n- * AcpiDump - Input table addresses\n- * AcpiExec - Testing of the AcpiUtStrtoul64 function\n- *\n- * Note concerning callers:\n- * AcpiGbl_IntegerByteWidth can be used to set the 32/64 limit. If used,\n- * this global should be set to the proper width. For the core ACPICA code,\n- * this width depends on the DSDT version. For iASL, the default byte\n- * width is always 8 for the parser, but error checking is performed later\n- * to flag cases where a 64-bit constant is defined in a 32-bit DSDT/SSDT.\n+ * iASL - Preprocessor (constants and math expressions)\n+ * iASL - Main ASL parser, conversion of ASL constants to integers\n+ * iASL - Data Table Compiler parser (constants and math expressions)\n+ * Interpreter - Repair code for return values from predefined names\n+ * AcpiDump - ACPI table physical addresses\n+ * AcpiExec - Support for namespace overrides\n *\n ******************************************************************************/\n \n ACPI_STATUS\n AcpiUtStrtoul64 (\n char *String,\n- UINT32 Flags,\n UINT64 *ReturnValue)\n {\n ACPI_STATUS Status = AE_OK;\n- UINT32 Base;\n+ UINT8 OriginalBitWidth;\n+ UINT32 Base = 10; /* Default is decimal */\n \n \n ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String);\n \n \n- /* Parameter validation */\n-\n- if (!String || !ReturnValue)\n- {\n- return_ACPI_STATUS (AE_BAD_PARAMETER);\n- }\n-\n *ReturnValue = 0;\n \n- /* Check for zero-length string, returns 0 */\n+ /* A NULL return string returns a value of zero */\n \n if (*String == 0)\n {\n return_ACPI_STATUS (AE_OK);\n }\n \n- /* Skip over any white space at start of string */\n-\n- while (isspace ((int) *String))\n- {\n- String++;\n- }\n-\n- /* End of string? return 0 */\n-\n- if (*String == 0)\n+ if (!AcpiUtRemoveWhitespace (&String))\n {\n return_ACPI_STATUS (AE_OK);\n }\n \n /*\n- * 1) The \"0x\" prefix indicates base 16. Per the ACPI specification,\n- * the \"0x\" prefix is only allowed for implicit (non-strict) conversions.\n- * However, we always allow it for compatibility with older ACPICA.\n+ * 1) Check for a hex constant. A \"0x\" prefix indicates base 16.\n */\n- if ((*String == ACPI_ASCII_ZERO) &&\n- (tolower ((int) *(String + 1)) == 'x'))\n+ if (AcpiUtDetectHexPrefix (&String))\n {\n- String += 2; /* Go past the 0x */\n- if (*String == 0)\n- {\n- return_ACPI_STATUS (AE_OK); /* Return value 0 */\n- }\n-\n Base = 16;\n }\n \n- /* 2) Force to base 16 (implicit conversion case) */\n-\n- else if (Flags & ACPI_STRTOUL_BASE16)\n+ /*\n+ * 2) Check for an octal constant, defined to be a leading zero\n+ * followed by sequence of octal digits (0-7)\n+ */\n+ else if (AcpiUtDetectOctalPrefix (&String))\n {\n- Base = 16;\n+ Base = 8;\n }\n \n- /* 3) Default fallback is to Base 10 */\n-\n- else\n+ if (!AcpiUtRemoveLeadingZeros (&String))\n {\n- Base = 10;\n+ return_ACPI_STATUS (AE_OK); /* Return value 0 */\n }\n \n- /* Skip all leading zeros */\n+ /*\n+ * Force a full 64-bit conversion. The caller (usually iASL) must\n+ * check for a 32-bit overflow later as necessary (If current mode\n+ * is 32-bit, meaning a 32-bit DSDT).\n+ */\n+ OriginalBitWidth = AcpiGbl_IntegerBitWidth;\n+ AcpiGbl_IntegerBitWidth = 64;\n \n- while (*String == ACPI_ASCII_ZERO)\n+ /*\n+ * Perform the base 8, 10, or 16 conversion. A 64-bit numeric overflow\n+ * will return an exception (to allow iASL to flag the statement).\n+ */\n+ switch (Base)\n {\n- String++;\n- if (*String == 0)\n- {\n- return_ACPI_STATUS (AE_OK); /* Return value 0 */\n- }\n+ case 8:\n+ Status = AcpiUtConvertOctalString (String, ReturnValue);\n+ break;\n+\n+ case 10:\n+ Status = AcpiUtConvertDecimalString (String, ReturnValue);\n+ break;\n+\n+ case 16:\n+ default:\n+ Status = AcpiUtConvertHexString (String, ReturnValue);\n+ break;\n }\n \n- /* Perform the base 16 or 10 conversion */\n-\n- if (Base == 16)\n- {\n- *ReturnValue = AcpiUtStrtoulBase16 (String, Flags);\n- }\n- else\n- {\n- *ReturnValue = AcpiUtStrtoulBase10 (String, Flags);\n- }\n+ /* Only possible exception from above is a 64-bit overflow */\n \n+ AcpiGbl_IntegerBitWidth = OriginalBitWidth;\n return_ACPI_STATUS (Status);\n }\n \n \n /*******************************************************************************\n *\n- * FUNCTION: AcpiUtStrtoulBase10\n+ * FUNCTION: AcpiUtImplicitStrtoul64\n+ *\n+ * PARAMETERS: String - Null terminated input string,\n+ * must be a valid pointer\n+ *\n+ * RETURN: Converted integer\n+ *\n+ * DESCRIPTION: Perform a 64-bit conversion with restrictions placed upon\n+ * an \"implicit conversion\" by the ACPI specification. Used by\n+ * many ASL operators that require an integer operand, and support\n+ * an automatic (implicit) conversion from a string operand\n+ * to the final integer operand. The major restriction is that\n+ * only hex strings are supported.\n+ *\n+ * -----------------------------------------------------------------------------\n+ *\n+ * Base is always 16, either with or without the 0x prefix. Decimal and\n+ * Octal strings are not supported, as per the ACPI specification.\n+ *\n+ * Examples (both are hex values):\n+ * Add (\"BA98\", Arg0, Local0)\n+ * Subtract (\"0x12345678\", Arg1, Local1)\n+ *\n+ * Conversion rules as extracted from the ACPI specification:\n+ *\n+ * The converted integer is initialized to the value zero.\n+ * The ASCII string is always interpreted as a hexadecimal constant.\n+ *\n+ * 1) According to the ACPI specification, a \"0x\" prefix is not allowed.\n+ * However, ACPICA allows this as an ACPI extension on general\n+ * principle. (NO ERROR)\n+ *\n+ * 2) The conversion terminates when the size of an integer is reached\n+ * (32 or 64 bits). There are no numeric overflow conditions. (NO ERROR)\n+ *\n+ * 3) The first non-hex character terminates the conversion and returns\n+ * the current accumulated value of the converted integer (NO ERROR).\n *\n- * PARAMETERS: String - Null terminated input string\n- * Flags - Conversion info\n+ * 4) Conversion of a null (zero-length) string to an integer is\n+ * technically not allowed. However, ACPICA allows this as an ACPI\n+ * extension. The conversion returns the value 0. (NO ERROR)\n *\n- * RETURN: 64-bit converted integer\n+ * NOTE: There are no error conditions returned by this function. At\n+ * the minimum, a value of zero is returned.\n *\n- * DESCRIPTION: Performs a base 10 conversion of the input string to an\n- * integer value, either 32 or 64 bits.\n- * Note: String must be valid and non-null.\n+ * Current users of this function:\n+ *\n+ * Interpreter - All runtime implicit conversions, as per ACPI specification\n+ * iASL - Data Table Compiler parser (constants and math expressions)\n *\n ******************************************************************************/\n \n-static UINT64\n-AcpiUtStrtoulBase10 (\n- char *String,\n- UINT32 Flags)\n+UINT64\n+AcpiUtImplicitStrtoul64 (\n+ char *String)\n {\n- int AsciiDigit;\n- UINT64 NextValue;\n- UINT64 ReturnValue = 0;\n+ UINT64 ConvertedInteger = 0;\n \n \n- /* Main loop: convert each ASCII byte in the input string */\n-\n- while (*String)\n- {\n- AsciiDigit = *String;\n- if (!isdigit (AsciiDigit))\n- {\n- /* Not ASCII 0-9, terminate */\n+ ACPI_FUNCTION_TRACE_STR (UtImplicitStrtoul64, String);\n \n- goto Exit;\n- }\n \n- /* Convert and insert (add) the decimal digit */\n-\n- AcpiUtShortMultiply (ReturnValue, 10, &NextValue);\n- NextValue += (AsciiDigit - ACPI_ASCII_ZERO);\n-\n- /* Check for overflow (32 or 64 bit) - return current converted value */\n+ if (!AcpiUtRemoveWhitespace (&String))\n+ {\n+ return_VALUE (0);\n+ }\n \n- if (((Flags & ACPI_STRTOUL_32BIT) && (NextValue > ACPI_UINT32_MAX)) ||\n- (NextValue < ReturnValue)) /* 64-bit overflow case */\n- {\n- goto Exit;\n- }\n+ /*\n+ * Per the ACPI specification, only hexadecimal is supported for\n+ * implicit conversions, and the \"0x\" prefix is \"not allowed\".\n+ * However, allow a \"0x\" prefix as an ACPI extension.\n+ */\n+ AcpiUtDetectHexPrefix (&String);\n \n- ReturnValue = NextValue;\n- String++;\n+ if (!AcpiUtRemoveLeadingZeros (&String))\n+ {\n+ return_VALUE (0);\n }\n \n-Exit:\n- return (ReturnValue);\n+ /*\n+ * Ignore overflow as per the ACPI specification. This is implemented by\n+ * ignoring the return status from the conversion function called below.\n+ * On overflow, the input string is simply truncated.\n+ */\n+ AcpiUtConvertHexString (String, &ConvertedInteger);\n+ return_VALUE (ConvertedInteger);\n }\n \n \n /*******************************************************************************\n *\n- * FUNCTION: AcpiUtStrtoulBase16\n+ * FUNCTION: AcpiUtExplicitStrtoul64\n+ *\n+ * PARAMETERS: String - Null terminated input string,\n+ * must be a valid pointer\n *\n- * PARAMETERS: String - Null terminated input string\n- * Flags - conversion info\n+ * RETURN: Converted integer\n *\n- * RETURN: 64-bit converted integer\n+ * DESCRIPTION: Perform a 64-bit conversion with the restrictions placed upon\n+ * an \"explicit conversion\" by the ACPI specification. The\n+ * main restriction is that only hex and decimal are supported.\n *\n- * DESCRIPTION: Performs a base 16 conversion of the input string to an\n- * integer value, either 32 or 64 bits.\n- * Note: String must be valid and non-null.\n+ * -----------------------------------------------------------------------------\n+ *\n+ * Base is either 10 (default) or 16 (with 0x prefix). Octal (base 8) strings\n+ * are not supported, as per the ACPI specification.\n+ *\n+ * Examples:\n+ * ToInteger (\"1000\") Decimal\n+ * ToInteger (\"0xABCD\") Hex\n+ *\n+ * Conversion rules as extracted from the ACPI specification:\n+ *\n+ * 1) The input string is either a decimal or hexadecimal numeric string.\n+ * A hex value must be prefixed by \"0x\" or it is interpreted as decimal.\n+ *\n+ * 2) The value must not exceed the maximum of an integer value\n+ * (32 or 64 bits). The ACPI specification states the behavior is\n+ * \"unpredictable\", so ACPICA matches the behavior of the implicit\n+ * conversion case. There are no numeric overflow conditions. (NO ERROR)\n+ *\n+ * 3) Behavior on the first non-hex character is not defined by the ACPI\n+ * specification (for the ToInteger operator), so ACPICA matches the\n+ * behavior of the implicit conversion case. It terminates the\n+ * conversion and returns the current accumulated value of the converted\n+ * integer. (NO ERROR)\n+ *\n+ * 4) Conversion of a null (zero-length) string to an integer is\n+ * technically not allowed. However, ACPICA allows this as an ACPI\n+ * extension. The conversion returns the value 0. (NO ERROR)\n+ *\n+ * NOTE: There are no error conditions returned by this function. At the\n+ * minimum, a value of zero is returned.\n+ *\n+ * Current users of this function:\n+ *\n+ * Interpreter - Runtime ASL ToInteger operator, as per the ACPI specification\n *\n ******************************************************************************/\n \n-static UINT64\n-AcpiUtStrtoulBase16 (\n- char *String,\n- UINT32 Flags)\n+UINT64\n+AcpiUtExplicitStrtoul64 (\n+ char *String)\n {\n- int AsciiDigit;\n- UINT32 ValidDigits = 1;\n- UINT64 ReturnValue = 0;\n-\n+ UINT64 ConvertedInteger = 0;\n+ UINT32 Base = 10; /* Default is decimal */\n \n- /* Main loop: convert each ASCII byte in the input string */\n \n- while (*String)\n- {\n- /* Check for overflow (32 or 64 bit) - return current converted value */\n+ ACPI_FUNCTION_TRACE_STR (UtExplicitStrtoul64, String);\n \n- if ((ValidDigits > 16) ||\n- ((ValidDigits > 8) && (Flags & ACPI_STRTOUL_32BIT)))\n- {\n- goto Exit;\n- }\n \n- AsciiDigit = *String;\n- if (!isxdigit (AsciiDigit))\n- {\n- /* Not Hex ASCII A-F, a-f, or 0-9, terminate */\n-\n- goto Exit;\n- }\n+ if (!AcpiUtRemoveWhitespace (&String))\n+ {\n+ return_VALUE (0);\n+ }\n \n- /* Convert and insert the hex digit */\n+ /*\n+ * Only Hex and Decimal are supported, as per the ACPI specification.\n+ * A \"0x\" prefix indicates hex; otherwise decimal is assumed.\n+ */\n+ if (AcpiUtDetectHexPrefix (&String))\n+ {\n+ Base = 16;\n+ }\n \n- AcpiUtShortShiftLeft (ReturnValue, 4, &ReturnValue);\n- ReturnValue |= AcpiUtAsciiCharToHex (AsciiDigit);\n+ if (!AcpiUtRemoveLeadingZeros (&String))\n+ {\n+ return_VALUE (0);\n+ }\n \n- String++;\n- ValidDigits++;\n+ /*\n+ * Ignore overflow as per the ACPI specification. This is implemented by\n+ * ignoring the return status from the conversion functions called below.\n+ * On overflow, the input string is simply truncated.\n+ */\n+ switch (Base)\n+ {\n+ case 10:\n+ default:\n+ AcpiUtConvertDecimalString (String, &ConvertedInteger);\n+ break;\n+\n+ case 16:\n+ AcpiUtConvertHexString (String, &ConvertedInteger);\n+ break;\n }\n \n-Exit:\n- return (ReturnValue);\n+ return_VALUE (ConvertedInteger);\n }\ndiff --git a/src/acpica/source/include/acexcep.h b/src/acpica/source/include/acexcep.h\nindex 1405e411..d808f275 100644\n--- a/src/acpica/source/include/acexcep.h\n+++ b/src/acpica/source/include/acexcep.h\n@@ -237,8 +237,12 @@ typedef struct acpi_exception_info\n #define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)\n #define AE_ACCESS EXCEP_ENV (0x001D)\n #define AE_IO_ERROR EXCEP_ENV (0x001E)\n+#define AE_NUMERIC_OVERFLOW EXCEP_ENV (0x001F)\n+#define AE_HEX_OVERFLOW EXCEP_ENV (0x0020)\n+#define AE_DECIMAL_OVERFLOW EXCEP_ENV (0x0021)\n+#define AE_OCTAL_OVERFLOW EXCEP_ENV (0x0022)\n \n-#define AE_CODE_ENV_MAX 0x001E\n+#define AE_CODE_ENV_MAX 0x0022\n \n \n /*\n@@ -371,7 +375,11 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] =\n EXCEP_TXT (\"AE_OWNER_ID_LIMIT\", \"There are no more Owner IDs available for ACPI tables or control methods\"),\n EXCEP_TXT (\"AE_NOT_CONFIGURED\", \"The interface is not part of the current subsystem configuration\"),\n EXCEP_TXT (\"AE_ACCESS\", \"Permission denied for the requested operation\"),\n- EXCEP_TXT (\"AE_IO_ERROR\", \"An I/O error occurred\")\n+ EXCEP_TXT (\"AE_IO_ERROR\", \"An I/O error occurred\"),\n+ EXCEP_TXT (\"AE_NUMERIC_OVERFLOW\", \"Overflow during string-to-integer conversion\"),\n+ EXCEP_TXT (\"AE_HEX_OVERFLOW\", \"Overflow during ASCII hex-to-binary conversion\"),\n+ EXCEP_TXT (\"AE_DECIMAL_OVERFLOW\", \"Overflow during ASCII decimal-to-binary conversion\"),\n+ EXCEP_TXT (\"AE_OCTAL_OVERFLOW\", \"Overflow during ASCII octal-to-binary conversion\")\n };\n \n static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] =\ndiff --git a/src/acpica/source/include/achware.h b/src/acpica/source/include/achware.h\nindex f33be8c4..c3bf8f15 100644\n--- a/src/acpica/source/include/achware.h\n+++ b/src/acpica/source/include/achware.h\n@@ -185,12 +185,12 @@ AcpiHwValidateRegister (\n \n ACPI_STATUS\n AcpiHwRead (\n- UINT32 *Value,\n+ UINT64 *Value,\n ACPI_GENERIC_ADDRESS *Reg);\n \n ACPI_STATUS\n AcpiHwWrite (\n- UINT32 Value,\n+ UINT64 Value,\n ACPI_GENERIC_ADDRESS *Reg);\n \n ACPI_BIT_REGISTER_INFO *\ndiff --git a/src/acpica/source/include/acinterp.h b/src/acpica/source/include/acinterp.h\nindex dd98f01c..d68058cc 100644\n--- a/src/acpica/source/include/acinterp.h\n+++ b/src/acpica/source/include/acinterp.h\n@@ -214,7 +214,7 @@ ACPI_STATUS\n AcpiExConvertToInteger (\n ACPI_OPERAND_OBJECT *ObjDesc,\n ACPI_OPERAND_OBJECT **ResultDesc,\n- UINT32 Flags);\n+ UINT32 ImplicitConversion);\n \n ACPI_STATUS\n AcpiExConvertToBuffer (\n@@ -683,9 +683,6 @@ AcpiExStoreObjectToNode (\n ACPI_WALK_STATE *WalkState,\n UINT8 ImplicitConversion);\n \n-#define ACPI_IMPLICIT_CONVERSION TRUE\n-#define ACPI_NO_IMPLICIT_CONVERSION FALSE\n-\n \n /*\n * exstoren - resolve/store object\ndiff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h\nindex 7a24391d..7d6c18d6 100644\n--- a/src/acpica/source/include/acpixf.h\n+++ b/src/acpica/source/include/acpixf.h\n@@ -154,7 +154,7 @@\n \n /* Current ACPICA subsystem version in YYYYMMDD format */\n \n-#define ACPI_CA_VERSION 0x20170728\n+#define ACPI_CA_VERSION 0x20170831\n \n #include \"acconfig.h\"\n #include \"actypes.h\"\ndiff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h\nindex da6b561a..537c33e7 100644\n--- a/src/acpica/source/include/actbl1.h\n+++ b/src/acpica/source/include/actbl1.h\n@@ -179,6 +179,7 @@\n #define ACPI_SIG_HEST \"HEST\" /* Hardware Error Source Table */\n #define ACPI_SIG_MADT \"APIC\" /* Multiple APIC Description Table */\n #define ACPI_SIG_MSCT \"MSCT\" /* Maximum System Characteristics Table */\n+#define ACPI_SIG_PDTT \"PDTT\" /* Processor Debug Trigger Table */\n #define ACPI_SIG_PPTT \"PPTT\" /* Processor Properties Topology Table */\n #define ACPI_SIG_SBST \"SBST\" /* Smart Battery Specification Table */\n #define ACPI_SIG_SLIT \"SLIT\" /* System Locality Distance Information Table */\n@@ -1600,6 +1601,42 @@ typedef struct acpi_nfit_flush_address\n } ACPI_NFIT_FLUSH_ADDRESS;\n \n \n+/*******************************************************************************\n+ *\n+ * PDTT - Processor Debug Trigger Table (ACPI 6.2)\n+ * Version 0\n+ *\n+ ******************************************************************************/\n+\n+typedef struct acpi_table_pdtt\n+{\n+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */\n+ UINT8 TriggerCount;\n+ UINT8 Reserved[3];\n+ UINT32 ArrayOffset;\n+\n+} ACPI_TABLE_PDTT;\n+\n+\n+/*\n+ * PDTT Communication Channel Identifier Structure.\n+ * The number of these structures is defined by TriggerCount above,\n+ * starting at ArrayOffset.\n+ */\n+typedef struct acpi_pdtt_channel\n+{\n+ UINT16 SubChannelId;\n+\n+} ACPI_PDTT_CHANNEL;\n+\n+\n+/* Mask and Flags for above */\n+\n+#define ACPI_PDTT_SUBCHANNEL_ID_MASK 0x00FF\n+#define ACPI_PDTT_RUNTIME_TRIGGER (1<<8)\n+#define ACPI_PPTT_WAIT_COMPLETION (1<<9)\n+\n+\n /*******************************************************************************\n *\n * PPTT - Processor Properties Topology Table (ACPI 6.2)\n@@ -1626,7 +1663,8 @@ enum AcpiPpttType\n \n /* 0: Processor Hierarchy Node Structure */\n \n-typedef struct acpi_pptt_processor {\n+typedef struct acpi_pptt_processor\n+{\n ACPI_SUBTABLE_HEADER Header;\n UINT16 Reserved;\n UINT32 Flags;\n@@ -1644,7 +1682,8 @@ typedef struct acpi_pptt_processor {\n \n /* 1: Cache Type Structure */\n \n-typedef struct acpi_pptt_cache {\n+typedef struct acpi_pptt_cache\n+{\n ACPI_SUBTABLE_HEADER Header;\n UINT16 Reserved;\n UINT32 Flags;\n@@ -1676,7 +1715,8 @@ typedef struct acpi_pptt_cache {\n \n /* 2: ID Structure */\n \n-typedef struct acpi_pptt_id {\n+typedef struct acpi_pptt_id\n+{\n ACPI_SUBTABLE_HEADER Header;\n UINT16 Reserved;\n UINT32 VendorId;\ndiff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h\nindex 18cfdd46..951d6553 100644\n--- a/src/acpica/source/include/actbl2.h\n+++ b/src/acpica/source/include/actbl2.h\n@@ -1030,6 +1030,7 @@ typedef struct acpi_iort_smmu_gsi\n UINT32 NSgIrptFlags;\n UINT32 NSgCfgIrpt;\n UINT32 NSgCfgIrptFlags;\n+\n } ACPI_IORT_SMMU_GSI;\n \n \ndiff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h\nindex bca4a94c..a3f0150b 100644\n--- a/src/acpica/source/include/acutils.h\n+++ b/src/acpica/source/include/acutils.h\n@@ -250,6 +250,10 @@ extern const char *AcpiGbl_PtypDecode[];\n #define ACPI_MSG_SUFFIX \\\n AcpiOsPrintf (\" (%8.8X/%s-%u)\\n\", ACPI_CA_VERSION, ModuleName, LineNumber)\n \n+/* Flags to indicate implicit or explicit string-to-integer conversion */\n+\n+#define ACPI_IMPLICIT_CONVERSION TRUE\n+#define ACPI_NO_IMPLICIT_CONVERSION FALSE\n \n /* Types for Resource descriptor entries */\n \n@@ -330,19 +334,57 @@ AcpiUtStricmp (\n char *String1,\n char *String2);\n \n+\n+/*\n+ * utstrsuppt - string-to-integer conversion support functions\n+ */\n ACPI_STATUS\n-AcpiUtStrtoul64 (\n+AcpiUtConvertOctalString (\n char *String,\n- UINT32 Flags,\n- UINT64 *RetInteger);\n+ UINT64 *ReturnValue);\n+\n+ACPI_STATUS\n+AcpiUtConvertDecimalString (\n+ char *String,\n+ UINT64 *ReturnValuePtr);\n+\n+ACPI_STATUS\n+AcpiUtConvertHexString (\n+ char *String,\n+ UINT64 *ReturnValuePtr);\n+\n+char\n+AcpiUtRemoveWhitespace (\n+ char **String);\n+\n+char\n+AcpiUtRemoveLeadingZeros (\n+ char **String);\n+\n+BOOLEAN\n+AcpiUtDetectHexPrefix (\n+ char **String);\n+\n+BOOLEAN\n+AcpiUtDetectOctalPrefix (\n+ char **String);\n+\n \n /*\n- * Values for Flags above\n- * Note: LIMIT values correspond to AcpiGbl_IntegerByteWidth values (4/8)\n+ * utstrtoul64 - string-to-integer conversion functions\n */\n-#define ACPI_STRTOUL_32BIT 0x04 /* 4 bytes */\n-#define ACPI_STRTOUL_64BIT 0x08 /* 8 bytes */\n-#define ACPI_STRTOUL_BASE16 0x10 /* Default: Base10/16 */\n+ACPI_STATUS\n+AcpiUtStrtoul64 (\n+ char *String,\n+ UINT64 *RetInteger);\n+\n+UINT64\n+AcpiUtExplicitStrtoul64 (\n+ char *String);\n+\n+UINT64\n+AcpiUtImplicitStrtoul64 (\n+ char *String);\n \n \n /*\ndiff --git a/src/acpica/source/tools/acpiexec/aeinitfile.c b/src/acpica/source/tools/acpiexec/aeinitfile.c\nindex 393e5387..72ccc0f8 100644\n--- a/src/acpica/source/tools/acpiexec/aeinitfile.c\n+++ b/src/acpica/source/tools/acpiexec/aeinitfile.c\n@@ -311,8 +311,7 @@ AeDoOneOverride (\n \n /* Extract the 64-bit integer */\n \n- Status = AcpiUtStrtoul64 (ValueString,\n- (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &Value);\n+ Status = AcpiUtStrtoul64 (ValueString, &Value);\n if (ACPI_FAILURE (Status))\n {\n AcpiOsPrintf (\"%s %s\\n\", ValueString,\n", "prefixes": [] }