elif ftype == fdt.TYPE_BYTE:
return '%#x' % tools.ToByte(value[0])
elif ftype == fdt.TYPE_STRING:
- return '"%s"' % value
+ # Handle evil ACPI backslashes by adding another backslash before them.
+ # So "\\_SB.GPO0" in the device tree effectively stays like that in C
+ return '"%s"' % value.replace('\\', '\\\\')
elif ftype == fdt.TYPE_BOOL:
return 'true'
elif ftype == fdt.TYPE_INT64:
longbytearray = [09 0a 0b 0c];
stringval = "message2";
stringarray = "another", "multi-word", "message";
+ acpi-name = "\\_SB.GPO0";
};
spl-test3 {
@classmethod
def setUpClass(cls):
tools.PrepareOutputDir(None)
+ cls.maxDiff = None
@classmethod
def tearDownClass(cls):
\tfdt64_t\t\treg[2];
};
struct dtd_sandbox_spl_test {
+\tconst char * acpi_name;
\tbool\t\tboolval;
\tunsigned char\tbytearray[3];
\tunsigned char\tbyteval;
};
static struct dtd_sandbox_spl_test dtv_spl_test2 = {
+\t.acpi_name\t\t= "\\\\_SB.GPO0",
\t.bytearray\t\t= {0x1, 0x23, 0x34},
\t.byteval\t\t= 0x8,
\t.intarray\t\t= {0x5, 0x0, 0x0, 0x0},