summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* logo: Makefile: remove debug outputSascha Hauer2015-10-151-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* logo: Kconfig: make BAREBOX_LOGO_* depend on BAREBOX_LOGOAntony Pavlov2015-09-141-0/+4
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/param'Sascha Hauer2015-09-011-4/+8
|\
| * param_enum: protect against invalid valuesSascha Hauer2015-08-261-2/+6
| | | | | | | | | | | | | | | | Since dev_add_param_enum is passed a pointer containing the actual value it can contain an invalid value. Protect against it so that we do not access invalid array elements. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * param_enum: Make name strings constSascha Hauer2015-08-261-2/+2
| | | | | | | | | | | | | | | | Not only the array containing the pointers should be const but also the strings themselves, so instead of using const char ** use const char * const *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-09-011-3/+3
|\ \
| * | lib: libfile: Do not ignore errors in close()Andrey Smirnov2015-08-191-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | Some character devices may perform meaningful operations in their implementation of close() -- a good example would be socfpga.c which checks if the FPGA was programmed succesfully in it's close() method -- so ignoring return value of this call may cause false positives in checking exit status for success. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gui: implement blitting screen areasSascha Hauer2015-08-201-0/+19
| | | | | | | | | | | | | | So far we only supported blitting the whole screen from the shadow fb to the framebuffer. Add a function to blit areas. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gui: Use fb provided shadowfb for offscreen renderingSascha Hauer2015-08-201-17/+7
| | | | | | | | | | | | | | The fb core now has builtin support for offscreen rendering, use this and drop offscreen handling in the gui code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fb: return original fb_info in FBIOGET_SCREENINFOSascha Hauer2015-08-201-4/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/logo'Sascha Hauer2015-08-066-0/+151
|\
| * Add new barebox logo to the treeSascha Hauer2015-07-206-0/+151
| | | | | | | | | | | | | | | | This adds the new barebox logo to the tree. This is added as svg image which is converted to different png images during build time. The logo can be found under /logo/barebox-logo-<width>.png in the running barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fbcon'Sascha Hauer2015-08-0611-56/+11150
|\ \
| * | graphics_utils: Let fb_open allocate the screenSascha Hauer2015-07-203-35/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate the screen dynamically in fb_open. This opens the way to create a fb_create_screen function which takes a struct fb_info * instead of a filename. This is suitable for the framebuffer console which already has a struct fb_info *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fonts: Add 7x14 fontSascha Hauer2015-07-204-0/+4125
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib/fonts: add "MINI4x6" fontAntony Pavlov2015-07-164-0/+2164
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | import lib/fonts framework from linux kernelAntony Pavlov2015-07-166-0/+4730
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: add function to create pixel from rgb tripletSascha Hauer2015-07-161-6/+26
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: Export get_pixelSascha Hauer2015-07-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_pixel converts a 32bit trgb color into framebuffer format. This is useful for other code aswell, so export it. Other functions in the graphics utils code use the name get/set_pixel aswell, but instead of converting data they get a pixel from the framebuffer or set a pixel on the framebuffer. To separate from these rename the function to gu_hex_to_pixel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: Add function to invert an areaSascha Hauer2015-07-161-0/+19
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | gui: Fix typo in function nameSascha Hauer2015-07-152-2/+2
| | | | | | | | | | | | | | | | | | It's a render buffer, not a redering buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphic_utils: Add a common namespace to functionsSascha Hauer2015-07-153-14/+14
| |/ | | | | | | | | | | | | This adds a common namespace to the graphic functions. We use gu_ for graphic_utils. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xfuncs: add wrapper for wchar strdup functionsMichael Olbrich2015-07-231-0/+31
| | | | | | | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xfuncs: add xasprintf() and xvasprintf()Michael Olbrich2015-07-231-0/+24
|/ | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-07-032-1/+23
|\
| * xfuncs: import xstrndup() from busyboxMarc Kleine-Budde2015-06-181-0/+22
| | | | | | | | | | | | | | | | This function is needed for the fixed length string feature in the state framework. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * parameter: allow setting of string parameters of zero lengthMarc Kleine-Budde2015-06-181-1/+1
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-07-037-13/+15
|\ \
| * | treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-024-4/+0
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | read_file_2(): drop unnecessary 'else'Alexander Smirnov2015-07-021-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Alexander Smirnov <alllecs@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | parameter: always build MAC dev param functionsLucas Stach2015-07-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MAC dev parameter functions would only be built when CONFIG_NET is set. This was okay as long as only network devices were using MAC dev params. This has changed with the merge of the state framework, so always compile them in if CONFIG_PARAMETER is set. Fixes: common/built-in.o: In function `state_mac_create': common/state.c:387: undefined reference to `dev_add_param_mac' Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | image_renderer: Use read_file_2Sascha Hauer2015-06-261-4/+4
| | | | | | | | | | | | | | | | | | | | | This returns a proper error code and allows us to print a proper error message which might not always be -ENOMEM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | device parameters: sort alphabeticallySascha Hauer2015-06-181-1/+9
| |/ | | | | | | | | | | | | | | With many parameters on the global device it becomes increasingly annoying to find a parameter in the list. Sort it alphabetically to make this easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / bmp support: Use unaligned accessorsSascha Hauer2015-06-231-5/+6
|/ | | | | | | Some fields in the bmp header are unaligned. Use unaligned accessor functions to acces them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-06-091-4/+0
|\
| * xfuncs: remove debugging outputSascha Hauer2015-05-151-4/+0
| | | | | | | | | | | | | | Adding debug statements to this code path does not make much sense since when enabled it will massively spam the console. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap: Warn if image size in BB header is zeroAndrey Smirnov2015-05-071-1/+5
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap_read_devfs(): Remove all partitions upon function completionAndrey Smirnov2015-05-071-2/+10
| | | | | | | | | | | | | | | | | | | | Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | | | | | | | | | Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap_read_devfs(): Fix potential memory leakAndrey Smirnov2015-05-071-6/+11
| | | | | | | | | | | | | | | | | | | | In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap_read_devfs(): Close file after we are done with itAndrey Smirnov2015-05-071-0/+2
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap_read_devfs(): Check for errors from devfs_add_partition()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | | | | | | | | | Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootstrap: Fix potential memory leak in 'read_image_head'Andrey Smirnov2015-05-071-2/+6
|/ | | | | | | | | Original version of 'read_image_head' would not free the memory allocated for barebox header in cases of any failure. Fix this by adding a dedicated resourse de-allocation code path. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lzo: check for length overrun in variable length encoding.Stefan Müller-Klieser2015-03-251-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corresponds to kernel commit 72cf90124e87d975d0b This fix ensures that we never meet an integer overflow while adding 255 while parsing a variable length encoding. It works differently from commit 206a81c ("lzo: properly check for overruns") because instead of ensuring that we don't overrun the input, which is tricky to guarantee due to many assumptions in the code, it simply checks that the cumulated number of 255 read cannot overflow by bounding this number. The MAX_255_COUNT is the maximum number of times we can add 255 to a base count without overflowing an integer. The multiply will overflow when multiplying 255 by more than MAXINT/255. The sum will overflow earlier depending on the base count. Since the base count is taken from a u8 and a few bits, it is safe to assume that it will always be lower than or equal to 2*255, thus we can always prevent any overflow by accepting two less 255 steps. This patch also reduces the CPU overhead and actually increases performance by 1.1% compared to the initial code, while the previous fix costs 3.1% (measured on x86_64). The fix needs to be backported to all currently supported stable kernels. Reported-by: Willem Pinckaers <willem@lekkertech.net> Cc: "Don A. Bailey" <donb@securitymouse.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "lzo: properly check for overruns"Stefan Müller-Klieser2015-03-251-42/+22
| | | | | | | | | | | | | | | | | This reverts barebox commit ecb1dc0b1e859bca9 This corresponds to kernel commit af958a38a60c7ca3d8 As analysed by Willem Pinckaers, this fix is still incomplete on certain rare corner cases, and it is easier to restart from the original code. Reported-by: Willem Pinckaers <willem@lekkertech.net> Cc: "Don A. Bailey" <donb@securitymouse.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: Add hex2bin and bin2hex implementationsSascha Hauer2015-03-133-2/+75
| | | | | | | Taken from the Kernel, put into the same place as in the kernel, although the hexdump.c does not actually contain hexdum functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>