summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/rockchip'Sascha Hauer2015-03-092-0/+19
|\ | | | | | | | | Conflicts: arch/arm/Kconfig
| * lib: Add gcd() functionAndrey Panov2015-03-052-0/+19
| | | | | | | | | | | | | | It calculates greatest common divisor. Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmndlinepart: skip devname if partstr already contains itSascha Hauer2015-02-121-1/+2
| | | | | | | | | | | | | | When the partition name already starts with "devname." skip this when adding the partition. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmdlinepart: add function to parse a cmdline partition stringSascha Hauer2015-02-121-0/+28
| | | | | | | | | | | | | | This adds a function to parse a full cmdline partition string. The addpart command is switched to use this function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmdlinepart: make argument types saferSascha Hauer2015-02-121-3/+3
| | | | | | | | | | | | | | The return size should be loff_t to support partitions bigger than 4G. Also use const for the devname and endp. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmdlinepart: Change SIZE_REMAINING to loff_tSascha Hauer2015-02-121-1/+1
| | | | | | | | | | | | For compatibility with devices > 4G. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | move cmdline partition parsing code to separate fileSascha Hauer2015-02-122-0/+96
|/ | | | | | | So it's no longer local to the addpart/delpart code and can be used from other code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-02-041-2/+5
|\
| * param: add error check to __dev_add_param()Masahiro Yamada2015-02-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | If strdup() fails with out-of-memory, __dev_add_param() should fail with -ENOMEM. (Note strdup() is always given with a non-NULL pointer. If the argument name is given with NULL, the system would already have crashed in the get_param_by_name() function.) Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * param: add error check to dev_param_set_generic()Masahiro Yamada2015-02-021-1/+1
| | | | | | | | | | | | | | | | The function dev_param_set_generic() may fail because of out of memory. If so, return -ENOMEM. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | lib: decompress: remove redundant INT_MAX defineMasahiro Yamada2015-01-211-4/+0
|/ | | | | | | | lib/decompress_bunzip2.c includes <common.h> and INT_MAX is already defined there. The definition in this file is redundant. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>