aboutsummaryrefslogtreecommitdiff
path: root/tests/setprop.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-24libfdt: Add fdt_setprop_empty()David Gibson1-1/+1
Device trees can contain empty (zero length) properties, which are often used as boolean flags. These can already be created using fdt_setprop() passing a length of zero and a pointer which is ignored. It is safe to pass NULL, but that may not be obvious from the interface. To make it clearer, add an fdt_setprop_empty() helper macro. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-06dtc/tests: don't include fdt.h prior to libfdt.hKim Phillips1-1/+0
tests will need fdt type definitions provided in a subsequent patch to libfdt_env.h. Since libfdt.h includes libfdt_env.h in the right order anyway, just remove the fdt.h include. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-06-03libfdt: Add helpers for 64-bit integer propertiesDavid Gibson1-0/+18
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>
2007-11-20libfdt: Abolish _typed() variants, add _cell() variantsDavid Gibson1-1/+1
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>
2007-09-18dtc: Whitespace cleanupDavid Gibson1-1/+1
This large patch removes all trailing whitespace from dtc (including libfdt, the testsuite and documentation). It also removes a handful of redundant blank lines (at the end of functions, or when there are two blank lines together for no particular reason). As well as anything else, this means that quilt won't whinge when I go to convert the whole of libfdt into a patch to apply to the kernel. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-06-14Merge libfdt into dtc.David Gibson1-0/+78
Having pulled the libfdt repository into dtc, merge the makefiles and testsuites so that they build together usefully.