summaryrefslogtreecommitdiffstats
path: root/libfdt/fdt.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix an overflow case in fdt_offset_ptr() detected by GCC 4.3.Jon Loeliger2008-10-011-1/+1
| | | | | | | | | | | | | | | Using Gcc 4.3 detected this problem: ../dtc/libfdt/fdt.c: In function 'fdt_next_tag': ../dtc/libfdt/fdt.c:82: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false To fix the problem, treat the offset as an unsigned int. The problem report and proposed fix were provided by Steve Papacharalambous <stevep@freescale.com>. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* libfdt: Increase namespace-pollution paranoiaDavid Gibson2008-08-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libfdt is supposed to easy to embed in projects all and sundry. Often, it won't be practical to separate the embedded libfdt's namespace from that of the surrounding project. Which means there can be namespace conflicts between even libfdt's internal/static functions and functions or macros coming from the surrounding project's headers via libfdt_env.h. This patch, therefore, renames a bunch of libfdt internal functions and macros and makes a few other chances to reduce the chances of namespace collisions with embedding projects. Specifically: - Internal functions (even static ones) are now named _fdt_*() - The type and (static) global for the error table in fdt_strerror() gain an fdt_ prefix - The unused macro PALIGN is removed - The memeq and streq macros are removed and open-coded in the users (they were only used once each) - Other macros gain an FDT_ prefix - To save some of the bulk from the previous change, an FDT_TAGALIGN() macro is introduced, where FDT_TAGALIGN(x) == FDT_ALIGN(x, FDT_TAGSIZE) Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* dtc: Enable and fix -Wpointer-arith warningsDavid Gibson2008-08-241-1/+1
| | | | | | | | | | | | | | This patch turns on the -Wpointer-arith option in the dtc Makefile, and fixes the resulting warnings due to using (void *) in pointer arithmetic. While convenient, pointer arithmetic on void * is not portable, so it's better that we avoid it, particularly in libfdt. Also add necessary definition of uintptr_t needed by David Gibson's changeset "dtc: Enable and fix -Wpointer-arith warnings" (the definition comes from stdint.h, which u-boot doesn't have). -- gvb Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* libfdt: Several cleanups to parameter checkingDavid Gibson2008-06-091-5/+12
| | | | | | | | | | | | | | | | | | | | | | This patch makes a couple of small cleanups to parameter checking of libfdt functions. - In several functions which take a node offset, we use an idiom involving fdt_next_tag() first to check that we have indeed been given a node offset. This patch adds a helper function _fdt_check_node_offset() to encapsulate this usage of fdt_next_tag(). - In fdt_rw.c in several places we have the expanded version of the RW_CHECK_HEADER() macro for no particular reason. This patch replaces those instances with an invocation of the macro; that's what it's for. - In fdt_sw.c we rename the check_header_sw() function to sw_check_header() to match the analgous function in fdt_rw.c, and we provide an SW_CHECK_HEADER() wrapper macro as RW_CHECK_HEADER() functions in fdt_rw.c Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Merge branch 'new-image' of git://www.denx.de/git/u-boot-testingBartlomiej Sieka2008-03-261-0/+4
|\ | | | | | | | | | | | | | | | | Conflicts: common/cmd_bootm.c cpu/mpc8xx/cpu.c Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
| * libfdt: Add and use a node iteration helper function.David Gibson2008-02-291-0/+41
| | | | | | | | | | | | | | | | | | This patch adds an fdt_next_node() function which can be used to iterate through nodes of the tree while keeping track of depth. This function is used to simplify the iteration code in a lot of other functions, and is also exported for use by library users. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| * [new uImage] Add libfdt support to mkimageBartlomiej Sieka2008-02-291-0/+4
| | | | | | | | Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
* | libfdt: Trivial cleanup for CHECK_HEADER)David Gibson2008-03-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | Currently the CHECK_HEADER() macro is defined local to fdt_ro.c. However, there are a handful of functions (fdt_move, rw_check_header, fdt_open_into) from other files which could also use it (currently they open-code something more-or-less identical). Therefore, this patch moves CHECK_HEADER() to libfdt_internal.h and uses it in those places. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* | libfdt: Add and use a node iteration helper function.David Gibson2008-03-181-0/+41
|/ | | | | | | | | This patch adds an fdt_next_node() function which can be used to iterate through nodes of the tree while keeping track of depth. This function is used to simplify the iteration code in a lot of other functions, and is also exported for use by library users. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Update libfdt from device tree compiler (dtc)Kumar Gala2007-11-211-13/+84
| | | | | | | Update libfdt to commit 8eaf5e358366017aa2e846c5038d1aa19958314e from the device tree compiler (dtc) project. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* [BUILD] conditionally compile libfdt/*.c in libfdt/MakefileKumar Gala2007-11-211-5/+0
| | | | | | | Modify libfdt/Makefile to conditionally compile the *.c files based on the board config. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* libfdt: Conditionally compile based on CONFIG_OF_LIBFDTGerald Van Baren2007-08-101-0/+5
| | | | | | | This is the way u-boot reduces configured-out code. At Wolfgang Grandegger and Wolfgang Denk's request, make libfdt conform. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* libfdt: Make fdt_check_header() publicGerald Van Baren2007-04-061-2/+2
| | | | | | | Changed _fdt_check_header() to fdt_check_header() and made it part of the interface - it is a useful routine. Also did some asthetics cleanup to the include files (headers).
* libfdt: Enhanced and published fdt_next_tag()Gerald Van Baren2007-03-311-39/+0
| | | | | | | Enhanced the formerly private function _fdt_next_tag() to allow stepping through the tree, used to produce a human-readable dump, and made it part of the published interface. Also added some comments.
* libfdt: Import libfdt source (1 of 2)Gerald Van Baren2007-03-311-0/+124
This adds the applicable libfdt source files (unmodified) and a README to explain where the source came from.
OpenPOWER on IntegriCloud