|
|
9897bb |
On s390, GCC does not like the string initialization in this case. When
|
|
|
9897bb |
ValueToWrite is initialized this way, GCC tries to copy the entire string
|
|
|
9897bb |
into an ACPI_OBJECT instead of just the pointer (see the use in the call
|
|
|
9897bb |
to memcpy()). So, move the init so GCC recognizes that ValueToWrite is
|
|
|
9897bb |
only a pointer, and not a whole string that needs to be moved.
|
|
|
9897bb |
|
|
|
9897bb |
Index: acpica-unix2-20200925/source/components/debugger/dbtest.c
|
|
|
9897bb |
===================================================================
|
|
|
9897bb |
--- acpica-unix2-20200925.orig/source/components/debugger/dbtest.c
|
|
|
9897bb |
+++ acpica-unix2-20200925/source/components/debugger/dbtest.c
|
|
|
9897bb |
@@ -719,9 +719,10 @@ AcpiDbTestStringType (
|
|
|
9897bb |
ACPI_OBJECT *Temp1 = NULL;
|
|
|
9897bb |
ACPI_OBJECT *Temp2 = NULL;
|
|
|
9897bb |
ACPI_OBJECT *Temp3 = NULL;
|
|
|
9897bb |
- char *ValueToWrite = "Test String from AML Debugger";
|
|
|
9897bb |
+ char *ValueToWrite = NULL;
|
|
|
9897bb |
ACPI_OBJECT WriteValue;
|
|
|
9897bb |
ACPI_STATUS Status;
|
|
|
9897bb |
+ const char *TestStr = "Test String from AML Debugger";
|
|
|
9897bb |
|
|
|
9897bb |
|
|
|
9897bb |
/* Read the original value */
|
|
|
9897bb |
@@ -737,6 +738,9 @@ AcpiDbTestStringType (
|
|
|
9897bb |
|
|
|
9897bb |
/* Write a new value */
|
|
|
9897bb |
|
|
|
9897bb |
+ ValueToWrite = AcpiOsAllocateZeroed(strlen(TestStr)+1);
|
|
|
9897bb |
+ strncpy(ValueToWrite, TestStr, strlen(TestStr)+1);
|
|
|
9897bb |
+
|
|
|
9897bb |
WriteValue.Type = ACPI_TYPE_STRING;
|
|
|
9897bb |
WriteValue.String.Length = strlen (ValueToWrite);
|
|
|
9897bb |
WriteValue.String.Pointer = ValueToWrite;
|
|
|
9897bb |
@@ -790,6 +794,7 @@ Exit:
|
|
|
9897bb |
if (Temp1) {AcpiOsFree (Temp1);}
|
|
|
9897bb |
if (Temp2) {AcpiOsFree (Temp2);}
|
|
|
9897bb |
if (Temp3) {AcpiOsFree (Temp3);}
|
|
|
9897bb |
+ if (ValueToWrite) {AcpiOsFree (ValueToWrite);}
|
|
|
9897bb |
return (Status);
|
|
|
9897bb |
}
|
|
|
9897bb |
|