Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8C220408B4 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BBE4F4038E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1683660882; i=w_armin@gmx.de; bh=XMqKLm8ouMo+iDNpwGLfItJyA+Rtgxgy3S7jea2xjVs=; h=X-UI-Sender-Class:To:Cc:From:Subject:Date; b=pojLcUwlXYP5ntE6Nn+xmCjJlQO5flQQ/04AveSkY/n+YWC7lomhRyU+c/Rs+8pfA TIBGroKCzq3ldF+NbMjr+SLaffPtLtNFDmCXoItOiwhYkSoyIZeL5qKNSzs5gCwVFR FRQLt3f8UbYWxFmtI04nb56D4yQKdn7hPtYtulJjVMwe/ZRE5rB7AIUbGUoHcfreao lCpX5cqEJPeqA6SyHyp4gMcf1yflKvfcfgMRpJAvXjPGRddjNlbII8smWfpliTIsJF isxDG2kzOPeQ1nzEQbsTAfEnewsCQGqrWuFZyawmo+vY5HydGAbrX7pOUIcb3Sk7DF nlw1yMnH/KmKw== From: Armin Wolf Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: [Acpica-devel] Handling of Integers in ToHexString() problematic List-Id: "This is the central place for ACPICA developer discussions and issues." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 09 May 2023 19:34:56 -0000 To: robert.moore@intel.com, rafael.j.wysocki@intel.com Cc: linux-acpi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org Hi, i found out that the behavior of the ToHexString() ASL operator differs between Windows and Linux: - Windows: byte 0x0f =>"0xf" word 0x0f0f => "0xf0f" dword 0x0f0f0f0f => "0xf0f0f0f" qword 0x0f0f0f0f0f0f0f0f => "0xf0f0f0f0f0f0f0f" - Linux (ACPICA): byte 0x0f =>"0000000f" word 0x0f0f => "00000f0f" dword 0x0f0f0f0f => "0f0f0f0f" qword 0x0f0f0f0f0f0f0f0f => "0f0f0f0f" (32-bit table, but qword is 64-bit?) This causes problems on my Inspiron 3505, as the battery serial number is generated by using ToHexString(<16 bit field>, Local1) and Mid(Local1, 0x02, 0x04, Local0), causing a wrong serial number to be displayed (0020 instead of 20CD). Would it be possible to change the behavior of ToHexString() for integers to match the Windows behavior? Something similar was already done in ACPICA version 20181213 regarding the behavior of ToHexString() on buffers. I understand that this has the potential of introducing regressions, but i believe that most systems target the behavior of Windows anyway. Armin Wolf