summaryrefslogtreecommitdiff
path: root/include/linux/bitops.h
AgeCommit message (Collapse)Author
2021-03-01log: convert pr_*() to loggingHeinrich Schuchardt
In drivers we use a family of printing functions including pr_err() and pr_cont(). CONFIG_LOGLEVEL is used to control which of these lead to output via printf(). Our logging functions allow finer grained control of output. So replace printf() by the matching logging functions. The usage of CONFIG_LOGLEVEL remains unchanged. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-05Add an assembly guard around linux/bitops.hSimon Glass
This file can be included by any header but it includes C code. Guard it to avoid errors when compiling ASL, etc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-20lib: Import few bitmap functions from LinuxVignesh Raghavendra
Import few basic bitmap functions (bitmap_{weight,fill,set,clear,or}()) and their dependencies from Linux. These are required for upcoming DMA resource allocation support for TI's K3 SoCs. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-02-07bitops: Fix GENMASK definition for SandboxVignesh R
In arch/sandbox/include/asm/types.h we have Therefore for 32 bit Sandbox build BITS_PER_LONG turns out to be 32 as CONFIG_PHYS64 is not set This messes up the current logic of GENMASK macro due to mismatch b/w size of unsigned long (64 bit) and that of BITS_PER_LONG. Fix this by using CONFIG_SANDBOX_BITS_PER_LONG which is set to 64/32 based on the host machine on which its being compiled. Without this patch: GENMASK(14,0) => 0x7fffffffffff After this patch: GENMASK(14,0) => 0x7fff Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-29bitops: collect BIT macros to include/linux/bitops.hMasahiro Yamada
Same macros are defined in various places. Collect them into include/linux/bitops.h like Linux. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-03-29bitops.h: Include bitsperlong.h as needed for GENMASK_ULLStefan Roese
The macro GENMASK_ULL needs the BITS_PER_LONG_LONG macro which is defined in the bitsperlong.h header. Lets include this header as the upcoming A7k/8k support in the Marvell mvpp2 ethernet driver uses this macro. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2015-11-05bitops: Add fls_long and __ffs64Fabio Estevam
Add fls_long and __ffs64 support to align with the kernel bitops implementation. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2015-10-21linux/bitops.h: GENMASK copy from linuxJagan Teki
GENMASK is used to create a contiguous bitmask([hi:lo]). This patch is a copy from Linux, with below commit details "bitops: Fix shift overflow in GENMASK macros" (sha1: 00b4d9a14125f1e51874def2b9de6092e007412d) Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
2015-10-21linux/bitops: Move BIT definitions at topJagan Teki
Since it's a copy from Linux, this patch moved all BIT definitions to top so-that it looks same as Linux file. Cc: Tom Rini <trini@konsulko.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Jagan Teki <jteki@openedev.com>
2015-09-11bitops: introduce BIT() definitionHeiko Schocher
introduce BIT() definition, used in at91_udc gadget driver. Signed-off-by: Heiko Schocher <hs@denx.de> [remove all other occurrences of BIT(x) definition] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Anatolij Gustschin <agust@denx.de>
2009-09-17Correct ffs/fls regression for PowerPC etcSimon Kagstrom
Commits 02f99901ed1c9d828e3ea117f94ce2264bf8389e 52d61227b66d4099b39c8309ab37cb67ee09a405 introduced a regression where platform-specific ffs/fls implementations were defined away. This patch corrects that by using PLATFORM_xxx instead of the name itself. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Stefan Roese <sr@denx.de>
2009-09-15Define ffs/fls for all architecturesSimon Kagstrom
UBIFS requires fls(), which is not defined for arm (and some other architectures) and this patch adds it. The implementation is taken from Linux and is generic. ffs() is also defined for those that miss it. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-09-15Move __set/clear_bit from ubifs.h to bitops.hSimon Kagstrom
__set_bit and __clear_bit are defined in ubifs.h as well as in asm/include/bitops.h for some architectures. This patch moves the generic implementation to include/linux/bitops.h and uses that unless it's defined by the architecture. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2003-06-27* Code cleanup:LABEL_2003_06_27_2340wdenk
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
2000-08-21Initial revisionwdenk