From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 28 Jul 2012 20:39:34 +0200 Subject: [U-Boot] [RFC] [PATCH 2/2] crazy: Sort u_boot_cmd at runtime In-Reply-To: <20120728174629.725CD200346@gemini.denx.de> References: <1343483279-11572-1-git-send-email-marex@denx.de> <1343483279-11572-2-git-send-email-marex@denx.de> <20120728174629.725CD200346@gemini.denx.de> Message-ID: <201207282039.34518.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, > Dear Marek Vasut, > > In message <1343483279-11572-2-git-send-email-marex@denx.de> you wrote: > > This shall eliminate the need for bubblesorting of commands at runtime. > > Every command definition structure is now put into it's own subsection > > of section .u_boot_cmd, that is .u_boot_cmd. . These are then put > > into .u_boot_cmd by linker and lastly, linker uses SORT() over these > > subsections to make proper order on them. This shall eliminate some > > runtime overhead. > > > > Signed-off-by: Marek Vasut > > Cc: Wolfgang Denk > > Cc: Mike Frysinger > > --- > > > > arch/arm/cpu/u-boot.lds | 2 +- > > common/cmd_help.c | 2 +- > > include/command.h | 9 ++++++--- > > 3 files changed, 8 insertions(+), 5 deletions(-) > > Seems incomplete in several aspects: Below the section: * NOTE * THIS PATCH IS CRAZY There are a few notes. I'd actually like to know if this approach is correct at all, it might break on some crazy configurations or such. > 1) what about all the non-ARM architecures and the board specific > linker scripts? - This patch affects only arm926t, obviously to make it proper, every linkerscript would have to be adjusted Which sucks, since there're a lot of them. But it can probably be automated. > 2) what about removing the sort code? You mean in the _do_help() in common/command.c? We can do not only that, but we can do bisect search in find_cmd_tbl() now too. I'm still trying to figure out the most optimal implementation. The current one I have trimmed down the time by roughly 60%, but I don't like it. > Best regards, > > Wolfgang Denk Best regards, Marek Vasut