summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* | password: fix command support as moduleJean-Christophe PLAGNIOL-VILLARD2011-07-051-0/+7
| | | | | | | | | | | | | | add missing EXPORT_SYMBOL for nan static function Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | menu: fix command support as moduleJean-Christophe PLAGNIOL-VILLARD2011-07-051-1/+16
|/ | | | | | | add missing EXPORT_SYMBOL for nan static function Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix console fifo (and loadb/loady commands)Alexey Galakhov2011-05-161-11/+16
| | | | | | | | This patch fixes loadb and loady commands. tstc() should return true if console_input_buffer is not empty. Signed-off-by: Alexey Galakhov <agalakhov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* setenv: be robust against setenv(<var>, NULL)Peter Korsgaard2011-05-161-1/+1
| | | | | | | | Handle value == NULL similiar to how value == '' is currently handled. hush's builtin_getopt() seems to trigger this for OPTARG. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move simple_itoa to libbb so that others can use itSascha Hauer2011-04-121-14/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: make default env path configurableSascha Hauer2011-04-122-3/+6
| | | | | | | | Normally the default path to save the environment is /dev/env0. However, we can't map a file in a fat filesystem to /dev/env0. So if we want to store the environment in a file in fat we have to make it configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add dummy_malloc functionsSascha Hauer2011-04-113-1/+44
| | | | | | | | | | For some environments the dummy malloc functions offer a very small alternative implementation. malloc will get its memory from sbrk() and never frees memory again. This of course is not suitable for interactive environments and thus depends on CONFIG_SHELL_NONE Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* malloc: put common memory functions to seperate fileSascha Hauer2011-04-113-50/+72
| | | | | | | These functions are needed independently of the specific malloc implementation, so move them out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add noshell supportSascha Hauer2011-04-111-1/+12
| | | | | | | | Some scenarios like initial bootloaders do not need interactive shell support, so make this optional. Without a shell a board must provide its own run_shell function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make command support optionalSascha Hauer2011-04-113-2/+7
| | | | | | | In a noninveractive environment we do not need commands. So make them optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* env: Make environment variable support optionalSascha Hauer2011-04-112-1/+6
| | | | | | | Environment variables are only useful in interactive environments. Make it optional on our way to support a noninteractive barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add block supportSascha Hauer2011-04-113-0/+270
| | | | | | | | This adds a simple block layer to barebox. Reading and writing to block devices can be painfully slow without caching, so add a simple caching layer here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move version_string to seperate fileSascha Hauer2011-04-115-12/+18
| | | | | | | | | In a noninteractive environment barebox will be compiled without command support. So move version_string to a seperate file which is compiled unconditionally. Also, display the banner when the simple console support is used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* startup: we can only mount root and devfs when compiled inSascha Hauer2011-04-111-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-04-042-4/+147
|\
| * Merge branch 'master' into nextSascha Hauer2011-03-101-2/+0
| |\
| * | kallsyms/printk: enable symbol printing support (%pS)Sascha Hauer2011-03-102-4/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | With this kallsyms finally start working at least on ARM. This enables us resolving addresses into symbols which is particularly useful in combination with stack unwinding support. As kallsyms now compile and work we can remove the depends on BROKEN. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | defaultenv: fix empty CONFIG_DEFAULT_ENVIRONMENT_PATHJon Ringle2011-03-231-1/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | if CONFIG_DEFAULT_ENVIRONMENT_PATH="" then $(DEFAULT_ENVIRONMENT_PATH) expands to 'defaultenv "" ' The "" would cause every single file found in $(srctree) to be included in $(ENV_FILES). This would then cause scripts/mod/sumversions.c to get recompiled using $(CC) and fail compilation if $(CC) points to a newlib cross compiler Signed-off-by: Jon Ringle <jon@ringle.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | module: CONFIG_COMMAND does not exist anymore, remove ifdefsSascha Hauer2011-03-101-2/+0
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-02-032-3/+4
|\
| * startup: make debug printing of linker variables work againSascha Hauer2011-01-171-2/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'master' into nextSascha Hauer2011-01-171-1/+1
| |\
| * | Init env context a bit earlier in initalization sequence.Marc Reilly2011-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Ensures subsequent init functions to export environment variables during init without having to rely on linking order being correct. Signed-off-by: Marc Reilly <marc@cpdesign.com.au> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Fix default baudrate settingJuergen Beisert2011-01-181-1/+2
| |/ |/| | | | | | | | | | | | | | | The menu entry to set the default baudrate (CONFIG_BAUDRATE) makes no sense, as long as its content is not used. This patch makes barebox using the setting again. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | device tree: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Silence few warnings.Krzysztof Halasa2010-12-211-1/+1
| | | | | Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'led' into nextSascha Hauer2010-12-214-0/+54
|\
| * Add generic poll infrastructureMarc Kleine-Budde2010-12-204-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Barebox does not have interrupt functionality. Nevertheless it's sometimes useful to periodically call functions, like for example a heartbeat LED or watchdog reset. Instead of cluttering the code with calls to these functions this patch adds a generic polling infrastructure. Code which might run for longer now can call poller_call() periodically which in turn will call all registered pollers. This patch adds a call to poller_call in two generic pathes. First of them is getc() which covers waiting for uart input. Second is ctrlc() which should be called anyway from code which might run for longer. So instead adding poller_call directly to your code, consider checking ctrlc instead which also gives additional convenience to the user. The poller code is safe against reentrancy which means that it's safe to call poller_call inside a poller. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | 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.