summaryrefslogtreecommitdiff
path: root/sysdeps/libufdt_sysdeps_vendor.c
AgeCommit message (Collapse)Author
2017-04-21libufdt: avoid to strdup() if possibleChris Fries
Memory allocation is slow in some platform. Uses stack to avoid malloc/free if possible. Also removed dto_strdup(). Doesn't need to implement it anymore. Bug: 32969430 Test: ./tests/run_tests.sh Change-Id: I68eae8fcf05e722089879ba3e95c55b136bb31ed
2017-03-29Fix the problem of not enough merged dtb sizeSzuWei Lin
The dtc has suffix compression for string, ex. "a_string", "string" and "ing", these strings could share a same string in dtb string table. libufdt assumes the merged dtb size shouldn't larger than the summary size of base and overlay dtb, and doesn't apply the same compression. The patch add a test case for this case and fix the problem. Bug: 35255584 Test: tests/run_tests.sh Change-Id: I6bac1e2823ca90dbdb852452544c41ab040a5ccc
2016-12-21libufdt: device tree overlay via unflattening FDTLi Chen
The original version of libdtoverlay is slow in searching for particular nodes and adding subnodes/properties due to the operations on flattened device tree (FDT). `libufdt` builds a real tree structure (named ufdt -- unflattned device tree) from FDT. In the real tree, we can perform certain operations (e.g., merge 2 subtrees, search for a node by path) in almost optimal time complexity with acceptable additional memory usage. With libufdt, we improve the merging of two dtb files from O(N^2) to O(N), where N is the number of nodes in the tree. Bug: 30800619 Test: run test scripts (see libufdt/tests/README) Test: manually ported libufdt into a bootloader, checked it can merge a base dtb and a dtbo to generate a final dtb to boot the device Change-Id: I1ff886bb8a62bad1451edcd7c4fe5cb48b7a034a
2016-12-14Revert "libufdt: device tree overlay via unflattening FDT"Jeff Hao
This reverts commit 3084ce7cbdff84093286459758f99c15082e6556. Change-Id: I36f8252ea77c75301711009180c1908bb18e231c
2016-12-05libufdt: device tree overlay via unflattening FDTLiChen
The original version of libdtoverlay is slow in searching for particular nodes and adding subnodes/properties due to the operations on flattened device tree (FDT). `libufdt` builds a real tree structure (named ufdt -- unflattned device tree) from FDT. In the real tree, we can perform certain operations (e.g., merge 2 subtrees, search for a node by path) in almost optimal time complexity with acceptable additional memory usage. With libufdt, we improve the merging of two dtb files from O(N^2) to O(N), where N is the number of nodes in the tree. Bug: 30800619 Test: run test scripts (see libufdt/tests/README) Test: manually ported libufdt into a bootloader, checked it can merge a base dtb and a dtbo to generate a final dtb to boot the device Change-Id: I6a282cc99129d5280ecbf40852723f83735fa523