All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/14] Split out code from the enormous main.c
@ 2014-04-11  2:01 Simon Glass
  2014-04-11  2:01 ` [U-Boot] [PATCH 01/14] Remove unnecessary use of hush header file Simon Glass
                   ` (14 more replies)
  0 siblings, 15 replies; 30+ messages in thread
From: Simon Glass @ 2014-04-11  2:01 UTC (permalink / raw)
  To: u-boot

A previous series created a way of using if () instead of #ifdef for
controlling feature inclusion in U-Boot. The primary target of that series
was common/main.c which is full of #ifdefs. That work was put on hold while
the kbuild work was in progress.

Since kbuild is now complete, it is time to take another look. However, in
the meantime main.c has not improved. It seems like a good idea to try to
split the code out a bit, to make it more obvious what is happening in the
U-Boot start-up.

This series splits main into two main program and a CLI (Command-line
interpreter) parts. There are two CLIs - hush and simple, and each is put
in its own file, with a new cli.c to unify them.

New files are also created for autoboot and bootretry functionality.

Overall this series makes it easier to read what is happening in main.c,
and also clarifies the parser code.


Simon Glass (14):
  Remove unnecessary use of hush header file
  Rename hush to cli_hush
  move CLI prototypes to cli.h and add comments
  Split out simple parser and readline into separate files
  Add cli_ prefix to readline functions
  Move autoboot code to autoboot.c
  Move command line API into cli.c
  Move bootretry code into bootretry.c and clean up
  Rename bootretry functions and remove #ifdefs
  m68k: powerpc: Clean up do_mdm_init
  Simplify the main loop
  main: Hide the hush/simple details inside cli.c
  main: Make the execution path a little clearer in main.c
  main: Avoid unncessary strdup()/free()

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c |    1 -
 arch/arm/cpu/arm926ejs/orion5x/cpu.c  |    1 -
 arch/m68k/lib/board.c                 |    7 -
 arch/powerpc/lib/board.c              |    8 -
 board/ait/cam_enc_4xx/cam_enc_4xx.c   |    4 +-
 board/amcc/yucca/cmd_yucca.c          |   21 +-
 board/eltec/elppc/misc.c              |   15 +-
 board/eltec/mhpc/mhpc.c               |   13 +-
 board/hymod/hymod.c                   |    8 +-
 board/hymod/input.c                   |   14 +-
 board/keymile/common/common.c         |    2 +-
 board/keymile/common/ivm.c            |    2 +-
 board/mcc200/auto_update.c            |    7 +-
 common/Makefile                       |   20 +-
 common/autoboot.c                     |  303 +++++++
 common/board_r.c                      |   14 -
 common/bootretry.c                    |   59 ++
 common/cli.c                          |  194 +++++
 common/{hush.c => cli_hush.c}         |   17 +-
 common/cli_readline.c                 |  621 ++++++++++++++
 common/cli_simple.c                   |  337 ++++++++
 common/cmd_bedbug.c                   |   29 +-
 common/cmd_bootm.c                    |    4 -
 common/cmd_bootmenu.c                 |    1 -
 common/cmd_dcr.c                      |    3 +-
 common/cmd_i2c.c                      |   17 +-
 common/cmd_mem.c                      |   17 +-
 common/cmd_nvedit.c                   |    5 +-
 common/cmd_pci.c                      |   13 +-
 common/main.c                         | 1527 +--------------------------------
 common/menu.c                         |    6 +-
 drivers/ddr/fsl/interactive.c         |    8 +-
 include/autoboot.h                    |   47 +
 include/bootretry.h                   |   59 ++
 include/cli.h                         |  149 ++++
 include/{hush.h => cli_hush.h}        |    4 +-
 include/common.h                      |    7 +-
 37 files changed, 1917 insertions(+), 1647 deletions(-)
 create mode 100644 common/autoboot.c
 create mode 100644 common/bootretry.c
 create mode 100644 common/cli.c
 rename common/{hush.c => cli_hush.c} (99%)
 create mode 100644 common/cli_readline.c
 create mode 100644 common/cli_simple.c
 create mode 100644 include/autoboot.h
 create mode 100644 include/bootretry.h
 create mode 100644 include/cli.h
 rename include/{hush.h => cli_hush.h} (93%)

-- 
1.9.1.423.g4596e3a

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2014-05-30 15:29 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11  2:01 [U-Boot] [PATCH 0/14] Split out code from the enormous main.c Simon Glass
2014-04-11  2:01 ` [U-Boot] [PATCH 01/14] Remove unnecessary use of hush header file Simon Glass
2014-05-30 15:27   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 02/14] Rename hush to cli_hush Simon Glass
2014-05-30 15:27   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 03/14] move CLI prototypes to cli.h and add comments Simon Glass
2014-05-30 15:27   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 04/14] Split out simple parser and readline into separate files Simon Glass
2014-05-30 15:27   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 05/14] Add cli_ prefix to readline functions Simon Glass
2014-05-30 15:27   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 06/14] Move autoboot code to autoboot.c Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 07/14] Move command line API into cli.c Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 08/14] Move bootretry code into bootretry.c and clean up Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 09/14] Rename bootretry functions and remove #ifdefs Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 10/14] m68k: powerpc: Clean up do_mdm_init Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 11/14] Simplify the main loop Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 12/14] main: Hide the hush/simple details inside cli.c Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 13/14] main: Make the execution path a little clearer in main.c Simon Glass
2014-05-30 15:28   ` Tom Rini
2014-04-11  2:01 ` [U-Boot] [PATCH 14/14] main: Avoid unncessary strdup()/free() Simon Glass
2014-05-30 15:29   ` Tom Rini
2014-04-21 17:26 ` [U-Boot] [PATCH 0/14] Split out code from the enormous main.c Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.