summaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
Commit message (Collapse)AuthorAgeFilesLines
* common: Move ROUND() into kernel.hSimon Glass2020-01-171-0/+2
| | | | | | Move this macro in with all the other rounding macros. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move check_member() to kernel.hSimon Glass2020-01-171-0/+11
| | | | | | | The kernel.h file has a number of useful macros including a few related to structures. Move check_member() there too. Signed-off-by: Simon Glass <sjg@chromium.org>
* include: kernel.h: include printk.hAKASHI Takahiro2019-12-061-1/+1
| | | | | | | | Adding "printk.h" will help improve portability from linux kernel code (in my case, lib/asn1_decoder.c and others) where printf and pr_* variant functions are used. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* fdt: Add INT32_MAX to kernel.h for libfdtSimon Glass2019-11-041-0/+2
| | | | | | | | | | | Unfortunately libfdt needs this value now, which is present in the stdint.h header. That file is just a placeholder in U-Boot and these sorts of constants appear in the linux/kernel.h header instead. To keep libfdt happy, add INT32_MAX too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* linux/kernel.h: import DIV_ROUND_CLOSEST_ULL from LinuxMasahiro Yamada2018-12-291-0/+12
| | | | | | Copied from Linux v4.20-rc7. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Add UINT32_MAX and UINT64_MAXSimon Glass2018-12-051-0/+4
| | | | | | | | These constants are defined by stdint.h but not by kernel.h, which is its stand-in in U-Boot. Add the definitions so that libraries which expect stdint.h constants can work. Signed-off-by: Simon Glass <sjg@chromium.org>
* linux/kernel.h: Add ALIGN_DOWN macroMasahiro Yamada2018-01-101-0/+1
| | | | | | | Follow Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from LinuxMasahiro Yamada2017-10-051-0/+5
| | | | | | These macros are useful to avoid link error on 32-bit systems. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Fix SIZE_MAX compiler warning when using stdint.hSimon Glass2014-11-251-0/+2
| | | | | | | This new symbol may be defined by the compiler. If it is, avoid a compiler warning when USE_STDINT is defined. Signed-off-by: Simon Glass <sjg@chromium.org>
* linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada2014-11-231-13/+4
| | | | | | | | | | | | | | | | | | | | U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: Tom Rini <trini@ti.com>
* linux/kernel.h: add typechecking to roundup macroMasahiro Yamada2014-11-201-2/+7
| | | | | | | | | This commit replaces roundup macro with the one from Linux Kernel. DEFINE_ALIGN_BUFFER must be fixed because typechecking can not be used in this context. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* linux/kernel.h: import more macrosMasahiro Yamada2014-11-201-0/+92
| | | | | | | These macros seem to be useful for U-Boot too (or at least harmless). Imported from Linux 3.18-rc2. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* include: move various macros to include/linux/kernel.hMasahiro Yamada2014-11-201-0/+157
U-Boot has imported various utility macros from Linux scattering them to various places without consistency. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. Moreover, we are suffering from too cluttered include/common.h. This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position. Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>