]> git.pld-linux.org Git - packages/acpica.git/blob - 0007-Handle-dumping-Unicode-properly-when-big-endian.patch
- updated to 20220331 + current Fedora patch set; acpinames is gone
[packages/acpica.git] / 0007-Handle-dumping-Unicode-properly-when-big-endian.patch
1 From 9a4a32c597fcdfa8a3bc33230c40a18e39c3449d Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Thu, 1 Jul 2021 17:46:19 -0600
4 Subject: [PATCH 07/45] Handle dumping Unicode properly when big-endian
5
6 Signed-off-by: Al Stone <ahs3@redhat.com>
7 ---
8  source/common/dmtbdump.c | 11 ++++++++---
9  1 file changed, 8 insertions(+), 3 deletions(-)
10
11 Index: acpica-unix2-20220331/source/common/dmtbdump.c
12 ===================================================================
13 --- acpica-unix2-20220331.orig/source/common/dmtbdump.c
14 +++ acpica-unix2-20220331/source/common/dmtbdump.c
15 @@ -200,6 +200,8 @@ AcpiDmDumpUnicode (
16      UINT8                   *Buffer;
17      UINT32                  Length;
18      UINT32                  i;
19 +    UINT16                 Tmp16;
20 +    UINT32                  start;
21  
22  
23      Buffer = ((UINT8 *) Table) + BufferOffset;
24 @@ -209,7 +211,8 @@ AcpiDmDumpUnicode (
25  
26      for (i = 0; i < Length; i += 2)
27      {
28 -        if (!isprint (Buffer[i]))
29 +        Tmp16 = AcpiUtReadUint16 (&Buffer[i]);
30 +        if (!isprint (Tmp16))
31          {
32              goto DumpRawBuffer;
33          }
34 @@ -217,7 +220,8 @@ AcpiDmDumpUnicode (
35  
36      /* Ensure all high bytes are zero */
37  
38 -    for (i = 1; i < Length; i += 2)
39 +    start = UtIsBigEndianMachine() ? 0 : 1;
40 +    for (i = start; i < Length; i += 2)
41      {
42          if (Buffer[i])
43          {
44 @@ -230,7 +234,8 @@ AcpiDmDumpUnicode (
45      AcpiOsPrintf ("\"");
46      for (i = 0; i < Length; i += 2)
47      {
48 -        AcpiOsPrintf ("%c", Buffer[i]);
49 +        Tmp16 = AcpiUtReadUint16 (&Buffer[i]);
50 +        AcpiOsPrintf ("%c", Tmp16);
51      }
52  
53      AcpiOsPrintf ("\"\n");
This page took 0.052447 seconds and 4 git commands to generate.