summaryrefslogtreecommitdiff
path: root/scripts/include
Commit message (Collapse)AuthorAgeFilesLines
* include: move ARRAY_AND_SIZE to <linux/kernel.h>Ahmad Fatoum2021-11-011-0/+1
| | | | | | | | | | Linux defines this macro at multiple places. We define it once, but in <common.h>, which is a bit heavy weight. Move it next to the ARRAY_SIZE() definition. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: <linux/bitops.h>: fix references to undefined __BITS_PER_LONGAhmad Fatoum2021-11-014-11/+20
| | | | | | | | | No where do we define __BITS_PER_LONG, but we know about BITS_PER_LONG. Fix it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: <linux/bitops.h>: discard left-over hweight codeAhmad Fatoum2021-11-014-8/+1
| | | | | | | | | | There are no definitions for __sw_hweight*, so no point in keeping the prototypes around. The scripts version of the header also ultimately tries to access non-existing normal headers, so fix that up as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2021-02-162-18/+7
| | | | | | | | | Convert the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: define ALIGN(x) in scripts' <linux/kernel.h>Ahmad Fatoum2020-02-191-0/+2
| | | | | | | | | To make code sharing between utilities in scripts/ and barebox easier, define ALIGN in the scripts/include/linux/kernel.h as well for compatibility with the barebox include/linux/kernel.h. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: removes uses of <asm*/errno.h> in favor of <errno.h>Ahmad Fatoum2019-05-281-1/+1
| | | | | | | | | | We can't assume <asm/errno.h> to be available on non-Linux hosts. Furthermore, errno constants values aren't fixed and passing them to libc perror(3)/strerror (3) would yield wrong results. Fix this by using the standard <errno.h> header instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: don't depend on system <asm/types.h>Ahmad Fatoum2019-05-281-2/+12
| | | | | | | | If we compile on non-Linux hosts, we can't assume this header to be available. Thus typedef loff_t and [su](8|16|32|64) ourselves. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: includes: restrict strlcpy prototype to glibcAhmad Fatoum2019-05-281-1/+5
| | | | | | | | | | | | | Defining strlcpy here clashes on macOS, which has some compiler magic around their strlcpy declaration. Fix this by inverting the check to declare the prototype only if we are on __GLIBC__. As uClibc may define __GLIBC__ as well, check for absence of its __UCLIBC__. This is in-line with what Linux has been doing since 0215d59b15 ("tools lib: Reinstate strlcpy() header guard with __UCLIBC__"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* recursive_action: add ACTION_SORT flagBaeuerle, Florian2019-01-081-0/+1
| | | | | | | | | | | Add a flag to sort directory entries before recursing into them. Since this part of lib/ is used inside barebox as well as in scripts/bareboxenv.c, we cannot easily use stringlists from lib/, which would have made the code a bit nicer. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Make list implementation usableSascha Hauer2019-01-032-2/+2
| | | | | | | | The list implementation in scripts/ includes poison.h which doesn't exist. Remove the inclusion and add the defines from poison.h that we need. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Add big endian conversion macros to endian.hSascha Hauer2016-04-281-0/+44
| | | | | | Some programs need the big endian macros, add them to andian.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts/include: Add ARRAY_SIZESascha Hauer2016-02-021-0/+2
| | | | | | | ARRAY_SIZE is another define commonly used in tools. Add it to the kernel includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Add common header files for toolsSascha Hauer2016-02-0230-0/+1975
This imports the tools/include dir from the Kernel as of 4.5-rc1 to barebox. The Kernel has many useful defines and helpers which are often duplicated in the different tools. Let's create a copy of them in a common place for all tools. Some files have been skipped for now as I currently see no use for them: include/linux/filter.h include/linux/hash.h include/linux/rbtree.h include/linux/rbtree_augmented.h They can be added later if needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>