summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/64bit'Sascha Hauer2012-07-022-9/+16
|\
| * make parse_area_spec arguments loff_tSascha Hauer2012-06-301-5/+5
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * introduce strtoull_suffix functionSascha Hauer2012-06-302-4/+11
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Unused files removedAlexander Shiyan2012-06-302-3/+0
|/ | | | | | | | Files "modules.builtin" probably have been copied from kernel tree. This files not used by barebox and can be removed safely. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* glob: Add sorted output supportSascha Hauer2012-05-141-6/+5
| | | | | | | This allows us for example to execute init scripts in the correct order. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add qsort supportSascha Hauer2012-05-143-0/+83
| | | | | | | This is based on U-Boot code which in turn is based on uclibc code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make errno a positive valueSascha Hauer2012-05-142-12/+17
| | | | | | | | | Normally errno contains a positive error value. A certain unnamed developer mixed this up while implementing U-Boot-v2. Also, normally errno is never set to zero by any library function. This patch fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* parameter: return empty string for unset parametersSascha Hauer2012-05-131-1/+1
| | | | | | | | Currently we return NULL for unset parameters. As we can't set them back to NULL once set this is not very consistent. Return an empty string instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into nextSascha Hauer2012-05-011-5/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | improve complete support The following patch serie improve the complete support by adding a complete framework to allow commands complete support. The add also car complete support for eval and setting and executable file support This also include an update of the stringlist API to support asprintf API
| * stringlist: implement string_list_add_asprintfSascha Hauer2012-04-301-0/+24
| | | | | | | | | | | | | | Useful for allocating a string list entry on the fly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * stringlist: use seperately allocated stringSascha Hauer2012-04-301-6/+4
| | | | | | | | | | | | | | | | | | | | Allocate the string in string list seperately instead of embedding a zero length string into struct stringlist. Besides looking cleaner this allows us to implement a string_list_asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | glob: activate GLOB_NOCHECK flagSascha Hauer2012-04-301-6/+4
|/ | | | | | Needed for hush. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dev_add_param: check if param exists alreadySascha Hauer2012-04-241-0/+4
| | | | | | | Before adding a new parameter to a device we should check if it already exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make return value of param getter function constSascha Hauer2012-04-241-5/+5
| | | | | | | The string returned by the getter function should not be changed. Make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>