summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* net: use static string in string_to_ipSascha Hauer2012-04-151-5/+1
| | | | | | Simplify usage of ip_to_string by using a static string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: remove unused bcopy functionSascha Hauer2012-04-051-24/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* getopt: save and restore contextSascha Hauer2012-02-271-2/+20
| | | | | | | | | | | | execute_command is the single point where commands are executed and thus a new getopt context is needed. currently we call getopt_reset here to reset the context. This breaks though when a command tries to run a command itself by calling execute_command or run_command. In this case we have to store the context and restore it afterwards. The same is necessary in builtin_getopt. Currently noone does this so this one shouldn't fix a bug, but merely allows us to do such things later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* getopt: turn commented out printf into debug()Sascha Hauer2012-02-271-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* copy_file: limit progress bar to sensible limitsSascha Hauer2012-02-191-3/+2
| | | | | | | | | When copying in verbose mode from a tftp server we might not know the size of the file being transfered. In this case print one progress item per 16k instead of one for each single byte. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/debug' into nextSascha Hauer2012-01-272-14/+11
|\
| * Add dump_stack functionSascha Hauer2012-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | At least ARM allows us to dump the stack, but we currently have no prototype for this. Add a dump_stack prototype and provide a static inline function for architectures without stack dump support. Also, call dump_stack() in panic() to provide more information in the case of a panic. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kfifo: change kfifo_init to work with a preallocated fifoSascha Hauer2012-01-261-14/+9
| | | | | | | | | | | | | | | | kfifo currently only works with dynamically allocated fifos. Change the currently unused kfifo_init to take a preallocated fifo. This allows for statically initialized fifos. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | show_progress: fix progress bar for files > 32 MiBMarc Kleine-Budde2012-01-251-2/+6
| | | | | | | | | | | | | | The next limit with the current code will probably 2GiB. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | param: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-112-1/+4
| | | | | | | | | | | | this will allow to save 992 Bytes for TI xlaoder or AT91 bootstrap Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | filetype: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-111-0/+1
| | | | | | | | | | | | remove 160 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | uncompress: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-113-2/+7
|/ | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'next'Sascha Hauer2012-01-058-2/+1535
|\
| * lib: add bitrev utilityRobert Jarzmik2012-01-023-0/+72
| | | | | | | | | | | | | | Add bit reversing utility, taken from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: add BCH encoding/decodingRobert Jarzmik2012-01-023-0/+1371
| | | | | | | | | | | | | | | | As flash memories need BCH correcting codes, add the BCH library, taken from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * stringlist-functions: add sorted insertAlexander Aring2011-12-211-0/+34
| | | | | | | | | | | | | | | | | | Add sorted insert in stringlist functions. Also added function to checked if string is already in string list. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove undefined WATCHDOG_RESETSascha Hauer2011-12-191-1/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'work/uimage' into nextSascha Hauer2011-12-172-0/+58
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/ppc/lib/ppclinux.c commands/bootm.c include/boot.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * libbb: add read_full/write_full functionsSascha Hauer2011-12-151-0/+50
| | | | | | | | | | | | | | | | | | These functions read/write all data or return with an error. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * uncompress: implement uncompress_fd_to_bufSascha Hauer2011-12-151-0/+8
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | remove unused watchdog headerSascha Hauer2011-12-151-1/+0
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / decompress_inflate.c: fix "no previous prototype for 'gunzip'" warningAntony Pavlov2012-01-021-0/+2
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* uncompress: fix uncompress_buf usageSascha Hauer2011-12-081-1/+2
| | | | | | | | uncompress_buf is used each time uncompress is called, so make sure it is initialized correctly so that we do not call free() on an already free pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-12-0727-5042/+3089
|\
| * remove now unused unlzo functionSascha Hauer2011-11-291-25/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Add generic uncompress functionSascha Hauer2011-11-292-0/+160
| | | | | | | | | | | | | | | | uncompress() has the same prototype as the various kernel decompress functions. It automatically detects the compression type and selects the correct uncompress function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lzo: export decompress_unlzo functionSascha Hauer2011-11-291-2/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: prompt for uncompression functionsSascha Hauer2011-11-292-2/+5
| | | | | | | | | | | | | | | | Allow the user to manually select the uncompression support he wants to have so that we have a single point where a user can see which uncompression support will be compiled in. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove old zlibSascha Hauer2011-11-292-2243/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * add kernel gunzip implementationSascha Hauer2011-11-2913-1/+2146
| | | | | | | | | | | | | | The kernel uncompression functions have a unified API so use this implementation to get it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove old bzlibSascha Hauer2011-11-295-2766/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * use kernel bunzip implementationSascha Hauer2011-11-292-1/+757
| | | | | | | | | | | | | | | | The kernel uncompression functions have a unified API. Switch to the kernel implementation to unify the different uncompression APIs. As a bonus the kernel implementation is much smaller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * compile in simple_strtoullSascha Hauer2011-11-291-2/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'master' into nextSascha Hauer2011-11-292-54/+164
| |\ | | | | | | | | | | | | | | | | | | Conflicts: drivers/ata/disk_drive.c Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands/cp: add verbose mode which displays progress barHubert Feurstein2011-11-221-1/+20
| | | | | | | | | | | | | | | Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | lib: remove nonexistest files from MakefileSascha Hauer2011-12-011-3/+0
| |/ |/| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | readkey: Use ARRAY_SIZEJan Weitzel2011-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Update to commit: 6df16cb readkey: force return from while true Use ARRAY_SIZE instead of hardcoded value Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | readkey: force return from while trueJan Weitzel2011-11-221-0/+2
| | | | | | | | | | | | | | | | | | If read_key is feeded by STRG + KEY_LEFT you run into the while(1) loop and corrupt memory through esc array. Force return if index gets too high. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'pu/unlzo'Sascha Hauer2011-11-221-54/+162
|\ \ | |/ |/|
| * fix unlzo supportSascha Hauer2011-11-171-54/+162
| | | | | | | | | | | | | | | | | | | | unlzo support is broken for files > 256k (more than one block) since commit a3463cc12877f6527624972c190a80ebb787a604 (lib/decompress_unlzo: use fill and full to read and write data) This patch updates unlzo support to the latest version of the kernel plus a small buffer free fix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | initial oftree command supportSascha Hauer2011-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | This adds basic device tree command support. So far we can parse a flat device tree (-p), which also stores the tree in memory, dump it (-d) and free (-f) the internally stored tree. The chosen node can be updated with barebox bootargs, no other device tree manipulation is implemented yet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | initial libfdt supportSascha Hauer2011-10-1911-0/+1838
| | | | | | | | | | | | | | | | | | | | vanilla libfdt 1.3.0 from the dtc git: git://git.jdl.com/software/dtc.git Only small adjustments to compile with barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | move digest to crypto/Jean-Christophe PLAGNIOL-VILLARD2011-10-127-1319/+0
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove EARLY_INIT and EARLY_CONSOLE supportSascha Hauer2011-09-271-1/+0
| | | | | | Bitrotted over time and nearly unused, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/bus: move to drivers/baseJean-Christophe PLAGNIOL-VILLARD2011-07-213-478/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* device: Add a dev_request_mem_region functionSascha Hauer2011-07-181-0/+17
| | | | | | | | | | | We might want to add real resource tracking later. Also The first resource may not be a IORESOURCE_MEM at all. For these reasons introduce a wrapper function for driver so that they do not have to fiddle with resources directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* register_device: Add IORESOURCE_MEM flagSascha Hauer2011-07-181-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* device: introduce resource structure to simplify resource declarationJean-Christophe PLAGNIOL-VILLARD2011-07-181-0/+19
| | | | | | | | | | | and add multi resource per device support for now we keep the old map_base and size temporary but will switch all of the used step by step to them resource way and mirror the first resource to the map_base and size if available Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* lib/readline.c: fix unused-but-set-variable gcc warningAntony Pavlov2011-07-041-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* copy_file: handle write return value correctlySascha Hauer2011-04-121-4/+11
| | | | | | | write() does not necessarily consume all input, handle this case correctly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>