From b00040b273a1d72676c80f34a7a4ca6e857ed32b Mon Sep 17 00:00:00 2001 From: Nicholas Piggin Date: Thu, 9 May 2019 19:41:22 +1000 Subject: libfdt: Add FDT_CREATE_FLAG_NO_NAME_DEDUP flag that trades size for speed Searching for duplicate names scales O(n^2) with the number of names added to a fdt, which can cause a noticable slowdown with larger device trees and very slow CPU cores. Add FDT_CREATE_FLAG_NO_NAME_DEDUP that allow the caller to trade fdt size for speed in the creation process. Signed-off-by: Nicholas Piggin Message-Id: <20190509094122.834-4-npiggin@gmail.com> Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpukit/include/libfdt.h') diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h index c2dee3eaa6..0684ec22ed 100644 --- a/cpukit/include/libfdt.h +++ b/cpukit/include/libfdt.h @@ -1433,7 +1433,13 @@ int fdt_nop_node(void *fdt, int nodeoffset); /* Sequential write functions */ /**********************************************************************/ -#define FDT_CREATE_FLAGS_ALL 0 +/* fdt_create_with_flags flags */ +#define FDT_CREATE_FLAG_NO_NAME_DEDUP 0x1 + /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property + * names in the fdt. This can result in faster creation times, but + * a larger fdt. */ + +#define FDT_CREATE_FLAGS_ALL (FDT_CREATE_FLAG_NO_NAME_DEDUP) /** * fdt_create_with_flags - begin creation of a new fdt -- cgit v1.2.3