summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* console_simple: add fprintf / console_list for commands/loadb.cPeter Korsgaard2010-12-121-1/+25
| | | | | | | | | | commands/loadb.c doesn't build with CONFIG_CONSOLE_SIMPLE, because it uses fprintf / for_each_console (which uses console_list). Fix it by adding trivial implementations of both in console_simple. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* parser: use debug macrosRobert Schwebel2010-11-011-28/+23
| | | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: silence doxygen warningsRobert Schwebel2010-10-221-0/+4
| | | | | | | | | | | | Silence these warnings: common/kallsyms.c:8: Warning: documented function `const u8 kallsyms_names' was not declared or defined. common/kallsyms.c:10: Warning: documented function `const u8 kallsyms_token_table' was not declared or defined. common/kallsyms.c:11: Warning: documented function `const u16 kallsyms_token_index' was not declared or defined. common/kallsyms.c:13: Warning: documented function `const unsigned long kallsyms_markers' was not declared or defined. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/memsize.c: add missing includeSascha Hauer2010-10-211-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/environment.c: sparse fixesSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* version_string: sparse fixesSascha Hauer2010-10-211-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/env.c: sparse fixesSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: sparse fixesSascha Hauer2010-10-211-5/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: sparse fixesSascha Hauer2010-10-211-2/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dlmalloc: sparse fixesSascha Hauer2010-10-211-20/+21
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: remove confusing image_check_* functionsSascha Hauer2010-10-131-3/+4
| | | | | | | | | | | The function names do not make it clear what return value is expected and do not save a single line of code. Put the code inline and unbreak the wrong checks introduced with a3c1e5d888d0ee317ffc7635694684bb71213c9c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Eric BĂ©nard <eric@eukrea.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* defaultenv/update: add check crc32 optionsJean-Christophe PLAGNIOL-VILLARD2010-10-121-0/+2
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv/update: merge update_rootfs and update_kernelJean-Christophe PLAGNIOL-VILLARD2010-10-121-0/+1
| | | | | | | use getopt to simplify it and prepare for xmodem support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable itJean-Christophe PLAGNIOL-VILLARD2010-10-122-2/+21
| | | | | | | this will we usefull to enable functionnality if used Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: implement getopt builtinSascha Hauer2010-10-082-2/+115
| | | | | | | | | | | | | | | | | | | | Positional parameters are not nice, so implement a getopt function. This has to be done as a builtin because otherwise we have no access to the parents argc/argv. getopt works as expected, here is a little example: while getopt "hs:" OPT do if [ $OPT = h ]; then echo "usage" exit 1 else echo "scr: opt: $OPT optarg: $OPTARG" fi done Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: fix nasty memory leak in hushSascha Hauer2010-10-081-0/+1
| | | | | | | | | Fix memory leak in globbing part of hush. a simple '[' on the command line was enough to trigger it. We must call globfree() before setting the glob structure to zero. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: pass context around in shellSascha Hauer2010-10-081-9/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise image printing contentsJean-Christophe PLAGNIOL-VILLARD2010-10-082-1/+178
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-10-081-4/+4
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* image: rename IH_CPU to IH_ARCH to be more concistantJean-Christophe PLAGNIOL-VILLARD2010-10-081-18/+18
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* image: factorise string helperJean-Christophe PLAGNIOL-VILLARD2010-10-082-0/+135
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Revert "image: factorise string helper"Sascha Hauer2010-10-072-135/+0
| | | | This reverts commit 7bd7d59e60f3f23862ebc09c9f3527ee24b2960f.
* Revert "image: rename IH_CPU to IH_ARCH to be more concistant"Sascha Hauer2010-10-071-18/+18
| | | | | | | | | | This reverts commit aba80a2d2d0f1b25185246925577ce2108247dde. Conflicts: include/image.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "Replace direct header access with the API routines"Sascha Hauer2010-10-071-4/+4
| | | | | | | | | | This reverts commit 0ceafe14be072696eff3e549d8c7b7de8a3e416d. Conflicts: include/image.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "image: factorise image printing contents"Sascha Hauer2010-10-072-176/+1
| | | | This reverts commit d424ce77f5e9295584252452dbd78eea562c9af0.
* console: set device_d id at -1Jean-Christophe PLAGNIOL-VILLARD2010-09-241-0/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise image printing contentsJean-Christophe PLAGNIOL-VILLARD2010-09-242-1/+176
| | | | | | | before we duplicate it between command/bootm.c and scripts/mkimage.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-09-241-4/+4
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: rename IH_CPU to IH_ARCH to be more concistantJean-Christophe PLAGNIOL-VILLARD2010-09-231-18/+18
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise string helperJean-Christophe PLAGNIOL-VILLARD2010-09-232-0/+135
| | | | | | | before we duplicate it between common/bootm.c and scripts/mkimage.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename __initdata to __early_initdataSascha Hauer2010-09-201-2/+2
| | | | | | | | | The __initdata define was present before Jean-Christophe added it as fake value for Linux compatibility. Rename the previous define to a different name to avoid clashes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Menu: add box style entryJean-Christophe PLAGNIOL-VILLARD2010-09-201-6/+32
| | | | | | | | | | | | | | | | | | | | | | | this will allow you to create a box style entry via C API by specifying the type as struct menu_entry me = { .display "test", .type = MENU_ENTRY_BOX, .box_state = 1, .action = action_to_run, } and via shell menu -e -a -m <menu> -c <command> [-R] [-b 0|1] -d <description> menu -e -a -m <menu> -u submenu -d [-b 0|1] <description> -b with 0 for not selected and 1 for selected and -c for the command to run when changing state Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: add auto select supportJean-Christophe PLAGNIOL-VILLARD2010-09-201-1/+53
| | | | | | | | | | | this will allow to automaticaly run an entry if the user do no choice this is usefull for boot menu as example with menu -s -m boot -A 3 -d "Auto Boot in" Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: use id as -1 for auto assigned idJean-Christophe PLAGNIOL-VILLARD2010-09-201-0/+1
| | | | | | | | before if you specify id = 0 the next available id will be taken otherwise fail if already registered now as in linux we use -1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add password frameworkJean-Christophe PLAGNIOL-VILLARD2010-09-203-0/+315
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add digest frameworkJean-Christophe PLAGNIOL-VILLARD2010-09-202-0/+78
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* move barebox_default_env.h to include/generated/Jean-Christophe PLAGNIOL-VILLARD2010-09-172-4/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* move utsrelease.h to include/generated/ instead of include/linuxJean-Christophe PLAGNIOL-VILLARD2010-09-171-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* menu: simplify usage for clientsSascha Hauer2010-08-301-8/+100
| | | | | | | | | | | | | | | Clients now only have to call menu_add_submenu or menu_add_command_entry instead of allocating many strings. This also fixes some problems in the menu code. The priv field in struct menu_entry was a pointer to struct menu or a pointer to an allocated string. It was never freed, only had to be freed when it was an allocated string. The reference to a submenu is now kept as a string and not to the menu itself. The code checked the existence of the submenu when creating it, but crashed when the submenu was removed and referenced afterwards. Now the code hapily allows references to nonexistant menus but complains during runtime when the menu is not there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use an initialized struct list as menu listSascha Hauer2010-08-301-12/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use list_for_each_entry where appropriateSascha Hauer2010-08-301-16/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: remove superfluous struct menu_entry member from struct menuSascha Hauer2010-08-301-10/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: simplify menu_free with list_for_each_entry_safeSascha Hauer2010-08-301-9/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: initialize entries list in menu_allocSascha Hauer2010-08-301-4/+0
| | | | | | Otherwise menu_free fails when menu_add failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Menu/cmd: add sub menu entry command supportJean-Christophe PLAGNIOL-VILLARD2010-08-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will simplify the creation of navigation link as this menu -a -m boot -d "Boot Menu" menu -a -m network -d "Network settings" menu -e -a -m network -u boot -d "Back" menu -e -a -m boot -u network -d "Network settings ->" menu -e -a -m boot -c reset -R -d "Reset" menu -e -a -m boot -c clear -d "Exit" menu -s -m boot in C struct menu m_boot = { .name = "boot", .display = "Boot Menu", }; struct menu m_network = { .name = "network", .display = "Network settings", }; struct menu_entry e_to_network = { .display = "Network settings ->", .action = menu_action_show, .priv = &m_network, }; struct menu_entry e_to_boot = { .display = "Back", .action = menu_action_show, .priv = &m_boot, }; struct menu_entry e_reset = { .display = "Reset", .action = menu_action_run, .priv = "reset", }; struct menu_entry e_exit = { .display = "Exit", .action = menu_action_run, .non_re_ent = 1, .priv = "clear", }; void menu_test(void) { menu_add(&m_boot); menu_add(&m_network); menu_add_entry(&m_boot, &e_to_network); menu_add_entry(&m_boot, &e_reset); menu_add_entry(&m_boot, &e_exit); menu_add_entry(&m_network, &e_to_boot); menu_show(&m_boot); } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add Menu FrameworkJean-Christophe PLAGNIOL-VILLARD2010-08-303-0/+323
| | | | | | | | | | | | | | | | | | | | | | | Introduce a menu framework that allow us to create list menu to simplify barebox and make it more user-frendly This kind of menu is very usefull when you do not have a keyboard or a serial console attached to your board to allow you to interract with barebox For the develloper part, The framework introduce two API 1) C that allow you to create menu, submenu, entry and complex menu action 2) Command that allow you as the C API to create menu, submenu, entry and complex menu action but this time the actions will be store in a function and then be evaluated and excecuted at runtime. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: sync with linux kernel v2.6.36-rc1-168-ge36c886Jean-Christophe PLAGNIOL-VILLARD2010-08-221-0/+13
| | | | | | this will add also the support of the new ncurse interface nconfig Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* barebox_default_env: fix out of tree buildJean-Christophe PLAGNIOL-VILLARD2010-07-221-3/+5
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Allow to merge default environment from more than one directorySascha Hauer2010-06-222-4/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* errno: add strings for network related error messagesSascha Hauer2010-06-171-3/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>