d877364e4a0f405ef24df7f4d50065c586207f5b |
|
29-Jul-2016 |
Maxime Ripard <maxime.ripard@free-electrons.com> |
libfdt: Add fdt_setprop_inplace_namelen_partial Add a function to modify inplace only a portion of a property.. This is especially useful when the property is an array of values, and you want to update one of them without changing the DT size. Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> [dwg: Remove unnecessary unsigned qualifier, correct a comment] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
2e53f9d2f0a8faab6cec0d78958d52c155f6c6eb |
|
02-Jan-2016 |
Anton Blanchard <anton@samba.org> |
Catch unsigned 32bit overflow when parsing flattened device tree offsets We have a couple of checks of the form: if (offset+size > totalsize) die(); We need to check that offset+size doesn't overflow, otherwise the check will pass, and we may access past totalsize. Found with AFL. Signed-off-by: Anton Blanchard <anton@samba.org> [Added a testcase] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
cbf1410eab4b7ce7be1b15f985ef71bfc1f5886d |
|
01-Jun-2012 |
David Gibson <david@gibson.dropbear.id.au> |
libfdt: Add helpers for 64-bit integer properties In device trees in the world, properties consisting of a single 64-bit integer are not as common as those consisting of a single 32-bit, cell sized integer, but they're common enough that they're worth including convenience functions for. This patch adds helper wrappers of fdt_setprop_inplace(), fdt_setprop() and fdt_appendprop() for handling 64-bit integer quantities in properties. For better consistency with the names of these new *_u64() functions we also add *_u32() functions as alternative names for the existing *_cell() functions handling 32-bit integers. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
a4ea2fa9518ff0f4d7f4a08647599a727faac2e0 |
|
09-Sep-2011 |
Anton Staaf <robotboy@chromium.org> |
dtc: Support character literals in cell lists With this patch the following property assignment: property = <0x12345678 'a' '\r' 100>; is equivalent to: property = <0x12345678 0x00000061 0x0000000D 0x00000064> Signed-off-by: Anton Staaf <robotboy@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
cdcb415851dc6c3e9550f27139c933fcaeb2d6a7 |
|
26-Jun-2008 |
David Gibson <david@gibson.dropbear.id.au> |
dtc: Address an assortment of portability problems I've recently worked with a FreeBSD developer, getting dtc and libfdt working on FreeBSD. This showed up a number of portability problems in the dtc package which this patch addresses. Changes are as follows: - the parent_offset and supernode_atdepth_offset testcases used the glibc extension functions strchrnul() and strndupa(). Those are removed, using slightly longer coding with standard C functions instead. - some other testcases had a #define _GNU_SOURCE for no particular reason. This is removed. - run_tests.sh has bash specific constructs removed, and the interpreter changed to /bin/sh. This apparently now runs fine on FreeBSD's /bin/sh, and I've also tested it with both ash and dash. - convert-dtsv0-lexer.l has some extra #includes added. These must have been included indirectly with Linux and glibc, but aren't on FreeBSD. - the endian handling functions in libfdt_env.h, based on endian.h and byteswap.h are replaced with some portable open-coded versions. Unfortunately, these result in fairly crappy code when compiled, but as far as I can determine there doesn't seem to be any POSIX, SUS or de facto standard way of determining endianness at compile time, nor standard names for byteswapping functions. - some more endian handling, from testdata.h using the problematic endian.h is simply removed, since it wasn't actually being used anyway. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
fa5b520ccb5e8da8d67ebc1926416753684f4e70 |
|
27-Feb-2008 |
David Gibson <david@gibson.dropbear.id.au> |
dtc: Implement checks for the format of node and property names This patch adds checks to the checking framework to verify that node and property names contain only legal characters, and in the case of node names there is at most one '@'. At present when coming from dts input, this is mostly already ensured by the grammer, however putting the check later means its easier to generate helpful error messages rather than just "syntax error". For dtb input, these checks replace the older similar check built into flattree.c. Testcases for the checks are also implemented. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
9521dc5ecc66c158cd6853cabba2c29f545780f6 |
|
20-Nov-2007 |
David Gibson <david@gibson.dropbear.id.au> |
libfdt: Abolish _typed() variants, add _cell() variants In a number of places through libfdt and its tests, we have *_typed() macro variants on functions which use gcc's typeof and statement expression extensions to allow passing literals where the underlying function takes a buffer and size. These seemed like a good idea at the time, but in fact they have some problems. They use typeof and statement expressions, extensions I'd prefer to avoid for portability. Plus, they have potential gotchas - although they'll deal with the size of the thing passed, they won't deal with other representation issues (like endianness) and results could be very strange if the type of the expression passed isn't what you think it is. In fact, the only users of these _typed() macros were when the value passed is a single cell (32-bit integer). Therefore, this patch removes all these _typed() macros and replaces them with explicit _cell() variants which handle a single 32-bit integer, and which also perform endian convesions as appropriate. With this in place, it now becomes easy to use standardized big-endian representation for integer valued properties in the testcases, regardless of the platform we're running on. We therefore do that, which has the additional advantage that all the example trees created during a test run are now byte-for-byte identical regardless of platform. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
7346858f8139cb143269bbc728b77072074ae997 |
|
12-Nov-2007 |
David Gibson <david@gibson.dropbear.id.au> |
libfdt: Add phandle related functions This patch adds fdt_get_phandle() and fdt_node_offset_by_phandle() functions to libfdt. fdt_get_phandle() will retreive the phandle value of a given node, and fdt_node_offset_by_phandle() will locate a node given a phandle. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
9409bd96a56b914baf5bfa802bc6a56fff5698e6 |
|
07-Nov-2007 |
David Gibson <david@gibson.dropbear.id.au> |
dtc: Better exercise dtc base and bytestring features This patch alters the main testcase, and the dts file corresponding to it so that we at least trivially exercise dtc's bytestring and base conversion features. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
5a98ddd10af0113d80e08946f9ba5dbc99174402 |
|
16-Oct-2007 |
David Gibson <david@gibson.dropbear.id.au> |
dtc: Improve -Odts output This patch makes improvements to the way properties are printed when in dtc is producing dts output. - Characters which need escaping are now properly handled when printing properties as strings - The heuristics for what format to use for a property are improved so that 'compatible' properties will be displayed as expected. - escapes.dts is altered to better demonstrate the changes, and the string_escapes testcase is adjusted accordingly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
a756c12bea9e39acbed483d9008852f3a371e4a4 |
|
16-Oct-2007 |
David Gibson <david@gibson.dropbear.id.au> |
dtc: Improve support for string escapes dtc supports the use of C-style escapes (\n, \t and so forth) in string property definitions via the data_copy_escape_string() function. However, while it supports the most common escape characters, it doesn't support the full set that C does, which is a potential gotcha. Worse, a bug in the lexer means that while data_copy_escape_string() can handle the \" escape, a string with such an escape won't lex correctly. This patch fixes both problems, extending data_copy_escape_string() to support the missing escapes, and fixing the regex for strings in the lexer to handle internal escaped quotes. This also adds a testcase for string escape functionality. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
fd1bf3a5ae46962528ef89a824261a88830758a2 |
|
10-Oct-2007 |
David Gibson <david@gibson.dropbear.id.au> |
libfdt: Add functions to get/add/delete memory reservemap entries This patch adds functions to libfdt for accessing the memory reservation map section of a device tree blob. fdt_num_mem_rsv() retreives the number of reservation entries in a dtb, and fdt_get_mem_rsv() retreives a specific reservation entry. fdt_add_mem_rsv() adds a new entry, and fdt_del_mem_rsv() removes a specific numbered entry. Testcases for these new functions are also included. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
874ff219afd310902707bf7d2362af7285ba559e |
|
17-Sep-2007 |
David Gibson <david@gibson.dropbear.id.au> |
libfdt: Consistently use big-endian property data in testcases Flat device trees always have integers in their structure stored as big-endian. From this point of view, property values are bags-of-bytes and any endianness is up to users of the device tree to determine. The libfdt testcases which use properties with integer values, currently use native endian format for the architecture on which the testcases are run. This works ok for now, since both the creation and checking of the example device trees happen in the same endianness. This will become a problem, however, for tests of dtc which we want to add in the nearish future. dtc always uses big-endian format for 'cell' format data in properties; as it needs to in order to produce powerpc-usable device trees when hosted on a little-endian architecture. This patch, therefore, changes the libfdt testsuite to use big-endian format always for integer format data, in order to interoperate sanely with future dtc testcases. This also means that the example trees created by the testsuite should now be byte-for-byte identical regardless of dtc and libfdt's host platform, which is arguably an advantage. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/testdata.h
|
12578976fe9cef82f0c08db3f9a4f550f5085ba4 |
|
14-Jun-2007 |
David Gibson <dgibson@mulberryst.seuss> |
Merge libfdt into dtc. Having pulled the libfdt repository into dtc, merge the makefiles and testsuites so that they build together usefully.
/external/dtc/tests/testdata.h
|