libosmocore 1.10.0.58-6cd7a
Osmocom core library
|
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | const_ilog2(n) |
const_ilog2 - log base 2 of 32-bit or a 64-bit constant unsigned value : parameter More... | |
#define | ilog2(n) |
ilog2 - log base 2 of 32-bit or a 64-bit unsigned value : parameter More... | |
Functions | |
static | __attribute__ ((always_inline)) int fls(unsigned int x) |
fls - find last (most-significant) bit set @x: the word to search More... | |
static | __attribute__ ((const)) int __ilog2_u32(uint32_t n) |
#define const_ilog2 | ( | n | ) |
const_ilog2 - log base 2 of 32-bit or a 64-bit constant unsigned value
: parameter
Use this where sparse expects a true constant expression, e.g. for array indices.
#define ilog2 | ( | n | ) |
ilog2 - log base 2 of 32-bit or a 64-bit unsigned value
: parameter
constant-capable log of base 2 calculation
selects the appropriately-sized optimised version depending on sizeof(n)
|
inlinestatic |
fls - find last (most-significant) bit set @x: the word to search
fls64 - find last set bit in a 64-bit word @x: the word to search
This is defined the same way as ffs. Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
This is defined in a similar way as the libc and compiler builtin ffsll, but returns the position of the most significant set bit.
fls64(value) returns 0 if value is 0 or the position of the last set bit if value is nonzero. The last (most significant) bit is at position 64.
References x.
|
inlinestatic |
References n.