summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* kfifo: kfifo_put takes a const bufferSascha Hauer2011-04-121-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move simple_itoa to libbb so that others can use itSascha Hauer2011-04-121-0/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Do not forget to remove device from active listSascha Hauer2011-04-041-0/+1
| | | | | | | Otherwise the remove function will be called twice leading to bad effects. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kallsyms/printk: enable symbol printing support (%pS)Sascha Hauer2011-03-101-0/+1
| | | | | | | | | With this kallsyms finally start working at least on ARM. This enables us resolving addresses into symbols which is particularly useful in combination with stack unwinding support. As kallsyms now compile and work we can remove the depends on BROKEN. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib/decompress_unlzo: use fill and full to read and write dataJean-Christophe PLAGNIOL-VILLARD2011-01-281-88/+92
| | | | | | | | | | | | | | | | | | | | | | this will all to simplify the sync with the kernel and later easly add the self decompression support to barebox as example with a lzo compression will reduce barebox from 180224 to 99863 bytes so 55.41% -rwxr-xr-x 1 root root 99863 Jan 28 02:17 build/versatilepb/barebox.bin.lzo we also reduce the binary size by 224 bytes Old version # ls -al build/versatilepb/barebox.bin -rwxr-xr-x 1 root root 180468 Jan 28 02:14 build/versatilepb/barebox.bin New version # ls -al build/versatilepb/barebox* -rwxr-xr-x 1 root root 180244 Jan 28 02:13 build/versatilepb/barebox.bin Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix error handling with malloc, memalign etc. Introduce xmemalign().Krzysztof Halasa2011-01-071-0/+8
| | | | | | | | | | | | | | The idea is to panic() when there is no memory available for normal operation. Exception: code which can consume arbitrary amount of RAM (example: files allocated in ramfs) must report error instead of panic(). This patch also fixes code which didn't check for NULL from malloc() etc. Usage: malloc(), memalign() return NULL when out of RAM. xmalloc(), xmemalign() always return non-NULL or panic(). Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Silence few warnings.Krzysztof Halasa2010-12-211-2/+2
| | | | | Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* LED: Add LED trigger supportSascha Hauer2010-12-201-0/+4
| | | | | | | This patch allows to associate LEDs with certain triggers, such as heartbeat or network activity. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: unify documentation for 'devinfo'Robert Schwebel2010-11-011-23/+21
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* digest: align menuRobert Schwebel2010-11-011-1/+1
| | | | | | | Align with the other menu entries. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devinfo: use subtree only with devinfoRobert Schwebel2010-11-011-21/+21
| | | | | | | | | | | The do_devinfo_subtree() function is only used if devinfo is compiled in, so put it under the same ifdef. This avoids the following warning when built with allnoconfig: lib/driver.c:247: warning: 'do_devinfo_subtree' defined but not used Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: fix wrongly named parameterRobert Schwebel2010-10-221-1/+1
| | | | | | | | | | | Silence this warning: lib/parameter.c:85: Warning: argument `value' of command @param is not found in the argument list of dev_set_param(struct device_d *dev, const char *name, const char *val) lib/parameter.c:85: Warning: The following parameters of dev_set_param(struct device_d *dev, const char *name, const char *val) are not documented: parameter val Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* process_escape_sequence: Add missing includeSascha Hauer2010-10-211-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* libbb: sparse fixesSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove dead ldiv codeSascha Hauer2010-10-212-56/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib/driver.c: sparse fixesSascha Hauer2010-10-211-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* copy_file: sparse fixesSascha Hauer2010-10-211-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crc32: sparse fixesSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readline: sparse fixesSascha Hauer2010-10-211-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fnmatch:sparse fixesSascha Hauer2010-10-211-4/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* glob: sparse fixesSascha Hauer2010-10-211-24/+12
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sha1/sha256: use be32_to_cpu and cpu_to_be32Jean-Christophe PLAGNIOL-VILLARD2010-09-222-33/+6
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sha1: use unit32_t and uint8_tJean-Christophe PLAGNIOL-VILLARD2010-09-221-26/+26
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: use id as -1 for auto assigned idJean-Christophe PLAGNIOL-VILLARD2010-09-201-1/+1
| | | | | | | | before if you specify id = 0 the next available id will be taken otherwise fail if already registered now as in linux we use -1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add sha256 supportJean-Christophe PLAGNIOL-VILLARD2010-09-203-0/+323
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add sha1 supportJean-Christophe PLAGNIOL-VILLARD2010-09-203-0/+400
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add md5 supportJean-Christophe PLAGNIOL-VILLARD2010-09-203-0/+321
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add digest frameworkJean-Christophe PLAGNIOL-VILLARD2010-09-201-0/+7
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* device: fix dev_nameJean-Christophe PLAGNIOL-VILLARD2010-09-201-8/+6
| | | | | | | | | | | | dev_name is supposed to return the name of the device plus the id currently we use %s%d format where in the kernel the use %s.%d we may think to switch to this format for the device name and keeping the %s%d for the devfs this will be usefull to not modify the clock device name as example Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* driver: allow register device with specific idJean-Christophe PLAGNIOL-VILLARD2010-09-171-4/+22
| | | | | | | | | if you specify id = 0 the next available id will be taken otherwise fail if already registered before if you specify one it will have use the next free id anyway Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* vsprintf: fix wrong EXPORT_SYMBOLSascha Hauer2010-09-161-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: add common clkdevJean-Christophe PLAGNIOL-VILLARD2010-08-061-0/+25
| | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Andrea GALLO <andrea.gallo@stericsson.com> Cc: Gael SALLES <gael.salles@stericsson.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: add strlcpy supportJean-Christophe PLAGNIOL-VILLARD2010-08-061-0/+26
| | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Andrea GALLO <andrea.gallo@stericsson.com> Cc: Gael SALLES <gael.salles@stericsson.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add rbtree support (needed for ubi)Sascha Hauer2010-07-052-0/+390
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crc32: activate crc32_no_comp (needed for jffs2 and UBI)Sascha Hauer2010-07-051-5/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add progression bar functionSascha Hauer2010-06-282-0/+63
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include support for a simple pseudo number generatorSascha Hauer2010-06-222-0/+27
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework device parametersSascha Hauer2010-06-172-79/+128
| | | | | | | | Change device parameters so that the memory management is in generic code. This also removes the need of storing statically initialized parameters as they are stored in a struct list_head for each device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make panic and hang __noreturn functionsSascha Hauer2010-03-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add process_escape_sequence functionSascha Hauer2010-03-303-0/+82
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add snprintf functionSascha Hauer2010-03-301-0/+12
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add unlzo supportSascha Hauer2010-03-309-0/+731
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>