Skip to content

Unified command execution in one place

Stefan Roese u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest0 of 9 patches 0 repliesNew

Patches in v2 No applies recorded yet

None of the 9 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [U-Boot] [PATCH v2 0/9] Unified command execution in one place
Quoted 17 lines · On Saturday 10 December 2011 19:43:52 Simon Glass wrote:

At present two parsers have similar code to execute commands. Also cmd_usage() is called all over the place. This series adds a single function which processes commands called cmd_process().

This new function understands return codes, and in particular CMD_RET_USAGE to indicate a usage error. So rather than calling cmd_usage() themselves, the command handlers can just return this error.

There appears to be a run_command2() which is used to run commands with the selected parser. This series changes this in two separate steps to just run_command(), and renames the old run_command() to builtin_run_command(). No one should call this outside main.c since if the hush parser is being used it is wrong to call it. The built-in parser code could move into a separate file perhaps in a future patch.

Quoted 8 lines

The overall series reduces code size on ARM by about 1KB on my ~160KB U-Boot text region when the hush parser is used, and around 60 bytes when it isn't.

As an aside the only user of parse_line() is fsl_ddr_interactive() which seems to have its own command line interface which operates before DRAM is set up. Do I have this right? Is there no way this could be done later from a normal U-Boot command?

Whole series:

Applied to u-boot-staging/sr at denx.de. Thanks.

Best regards,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de