summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/mxs'Sascha Hauer2015-01-093-90/+88
|\
| * Add PBL console supportSascha Hauer2015-01-052-0/+14
| | | | | | | | | | | | | | | | | | | | | | This adds simple console support to the PBL which makes it possible to print more complex messages in the PBL than just strings or hex numbers. For now puts_ll is used to print the messages, so it depends on CONFIG_DEBUG_LL which makes it more a debugging option. However, this could be extended later to get regular output from the PBL if desired. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * printf: use local isdigit/isalnum implementationSascha Hauer2015-01-051-3/+5
| | | | | | | | | | | | | | To be independent of the _ctype array. This makes it possible to add printf support to the PBL without adding _ctype aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * printf: move simple_strto*() functions to separate fileSascha Hauer2015-01-053-66/+69
| | | | | | | | | | | | These are not needed in the PBL, so move them to a separate file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * printf: move panic() to common/misc.cSascha Hauer2015-01-051-21/+0
| | | | | | | | | | | | | | | | panic() is not really a printf like function, so move it to common/misc.c. This is done because we want to have printf support in the PBL, but PBL has it's own panic() implementation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-01-092-2/+2
|\ \
| * | sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-082-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2015-01-091-0/+16
|\ \
| * | lib: add wchar strdupLucas Stach2014-12-091-0/+16
| |/ | | | | | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / graphic_utils: set_pixel only write 16bit in 16bit modeJean-Christophe PLAGNIOL-VILLARD2015-01-051-1/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig-1'Sascha Hauer2014-12-081-1/+1
|\
| * param: make string arguments to dev_add_param_fixed constSascha Hauer2014-11-281-1/+1
| | | | | | | | | | | | | | dev_add_param_fixed does not modify the strings, so make them const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/persistent-vars'Sascha Hauer2014-12-081-0/+40
|\ \ | | | | | | | | | | | | Conflicts: arch/arm/boards/efika-mx-smartbook/defaultenv-efikasb/config
| * | libfile: Add copy_recursiveSascha Hauer2014-11-061-0/+40
| | | | | | | | | | | | | | | | | | To recursively copy a directory tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2014-12-081-3/+3
|\ \ \ | |_|/ |/| |
| * | stringlist: the string argument should be constJan Luebbe2014-12-041-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | stringlist: string_list_contains can use a const stringJan Luebbe2014-11-201-1/+1
| |/ | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | lib: decompress_xz: fix function header to match prototypeLucas Stach2014-11-241-4/+4
| | | | | | | | | | | | | | | | Fixes: lib/uncompress.c:124:10: warning: assignment from incompatible pointer type Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xymodem: select CRC16 from libJan Weitzel2014-11-121-0/+1
|/ | | | | Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/xz'Sascha Hauer2014-11-0512-0/+3439
|\
| * Add xz decompression supportSascha Hauer2014-11-0412-0/+3439
| | | | | | | | | | | | | | | | This adds xz decompression support from the kernel. Both compressing the barebox binary with xz and decompressing xz files on the commandline is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2014-11-051-3/+5
|\ \
| * | param: let dev_add_param return the newly created paramSascha Hauer2014-10-081-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | dev_add_param creates a new parameter so it makes more sense to return it than to return an error code. Since the return value is hardly ever checked this is only a small patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/fs'Sascha Hauer2014-11-051-0/+71
|\ \ \ | |_|/ |/| |
| * | libfile: add compare_file functionSascha Hauer2014-10-091-0/+71
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / lib: parameter: fixed doku renamed ip -> ipaddrRolf Evers-Fischer2014-10-231-2/+2
|/ | | | | | | Long time ago all ".ip" parameters have been replaced with ".ipaddr". Signed-off-by: Rolf Evers-Fischer <embedded24@evers-fischer.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* read_file_2: Fix return valueTeresa Gámez2014-09-251-1/+3
| | | | | | | | Set return value correct in error case. This prevents barebox from crashing in some conditions. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readline: Fix history prev when history is emptySascha Hauer2014-09-011-1/+5
| | | | | | | | | | | | | | | | We cannot use list_entry() on an empty list. Without history we have to return an empty line. This fixes a crash when the cursor up button is pressed and no command has been entered previously. Broken since: commit ada160a34a1ec8421d5bb7b9dd746294668a5130 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Tue Jul 29 11:54:26 2014 +0200 readline: reimplement history functions Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Teresa Gamez <t.gamez@phytec.de>
* Merge branch 'for-next/usb-gadget'Sascha Hauer2014-08-071-0/+76
|\ | | | | | | | | | | | | | | Conflicts: commands/Makefile common/Kconfig common/Makefile drivers/usb/gadget/dfu.c
| * param: Add dev_add_param_stringSascha Hauer2014-07-221-0/+76
| | | | | | | | | | | | | | | | This function allows drivers to create a string parameter and provides access to it via a pointer. Using regular dev_add_param only allows access via dev_get_param(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rtc'Sascha Hauer2014-08-072-0/+15
|\ \ | | | | | | | | | | | | | | | Conflicts: arch/mips/dts/jz4755.dtsi commands/Makefile
| * | lib: import 'bcd' from linux-3.15Antony Pavlov2014-07-312-0/+15
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2014-08-073-68/+894
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: lib/Makefile
| * | | readline: reimplement history functionsSascha Hauer2014-07-291-68/+54
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reimplements the history functions in readline. - Use regular lists instead of homegrown list implementation - Allocate history strings dynamically instead of copying strings to fixed buffers without checking the size - saves us an initcall - slightly smaller - no longer add duplicates to the history - when moving past the last history entry print an empty line Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib: Add bitmap functions from kernelSascha Hauer2014-07-172-0/+840
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/metadata'Sascha Hauer2014-08-076-180/+334
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * | read_file: introduce read_file_2Sascha Hauer2014-08-071-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_file has some limitations: - It is not possible to check the error code since read_file returns NULL for failure - It is not possible to limit the buffer size to sensible limits. This patch introduces read_file_2 which doesn't have these limitations. read_file becomes a wrapper around read_file_2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | move file helper functions to separate fileSascha Hauer2014-08-076-180/+291
| |/ | | | | | | | | | | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add beginning wchar supportSascha Hauer2014-07-143-0/+82
| | | | | | | | | | | | | | | | EFI uses 16 bit character strings. Add beginning support for this. Since barebox uses 8 bit strings internally we need conversion functions to convert between 16 bit and 8 bit strings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | vsprintf: Support pU for printing UUIDsSascha Hauer2014-07-112-0/+65
| | | | | | | | | | | | | | | | With EFI 16byte UUIDs/GUIDs are common. Add support for printing them. This needs to be selected via Kconfig since most architectures have no use for this functionality. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add hex_byte_pack and hex_byte_pack_upper from kernelSascha Hauer2014-07-111-0/+2
| | | | | | | | | | | | Utility functions needed by the UUID/GUID printf support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | readkey: keys are unsigned charSascha Hauer2014-07-111-1/+1
|/ | | | | | We have keys with values > 127, so it must be an unsigned char. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string_list: Add string_list_for_each_entry macroSascha Hauer2014-07-031-3/+3
| | | | | | To ease iterating over a string_list. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lz4: fix another possible overrunHolger Schurig2014-07-021-1/+3
| | | | | | | | | | | | | | | | | | | | Note: this is the same as 4148c1f67abf823099b2d7db6851e4aea407f5ee in linux-git. There is one other possible overrun in the lz4 code as implemented by Linux at this point in time (which differs from the upstream lz4 codebase, but will get synced at in a future kernel release.) As pointed out by Don, we also need to check the overflow in the data itself. While we are at it, replace the odd error return value with just a "simple" -1 value as the return value is never used for anything other than a basic "did this work or not" check. Reported-by: "Don A. Bailey" <donb@securitymouse.com> Reported-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Holger Schurig <holgerschurig@gmail.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lz4: ensure length does not wrapHolger Schurig2014-07-021-0/+2
| | | | | | | | | | | | | Note: this is the same as 206204a1162b995e2185275167b22468c00d6b36 in linux-git. Given some pathologically compressed data, lz4 could possibly decide to wrap a few internal variables, causing unknown things to happen. Catch this before the wrapping happens and abort the decompression. Reported-by: "Don A. Bailey" <donb@securitymouse.com> Signed-off-by: Holger Schurig <holgerschurig@gmail.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lzo: properly check for overrunsHolger Schurig2014-07-021-22/+42
| | | | | | | | | | | | | | Note: this is the same as 206a81c18401c0cde6e579164f752c4b147324ce in linux-git. The lzo decompressor can, if given some really crazy data, possibly overrun some variable types. Modify the checking logic to properly detect overruns before they happen. Reported-by: "Don A. Bailey" <donb@securitymouse.com> Tested-by: "Don A. Bailey" <donb@securitymouse.com> Signed-off-by: Holger Schurig <holgerschurig@gmail.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: Add support for long long read only dev paramHerve Codina2014-06-131-0/+26
| | | | | Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: IMAGE_RENDERER does not depend on VIDEOSascha Hauer2014-06-051-1/+0
| | | | | | | | | Image renderer may not be particularly useful without framebuffer support, but technically it does not depend on VIDEO. Fixes: warning: (CMD_SPLASH) selects IMAGE_RENDERER which has unmet direct dependencies (VIDEO) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-06-041-5/+6
|\ | | | | | | | | Conflicts: commands/devinfo.c
| * vsprintf: fix formattingAntony Pavlov2014-05-221-5/+6
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>