Sound Open Firmware
Loading...
Searching...
No Matches
common.h File Reference
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __must_check   __attribute__((warn_unused_result))
#define IS_ALIGNED(size, alignment)
#define is_power_of_2(x)
#define compile_check(x)
#define ALIGN_UP_INTERNAL(val, align)
#define ALIGN_UP(size, alignment)
#define ALIGN_UP_COMPILE   ALIGN_UP
#define ALIGN_DOWN(size, alignment)
#define ALIGN(val, align)
#define SOF_DIV_ROUND_UP(val, div)
#define ARRAY_SIZE(x)
#define container_of(ptr, type, member)
#define attr_container_of(ptr, type, member, attr)
#define ffs(i)
#define ffsl(i)
#define ffsll(i)
#define clz(i)
#define clzl(i)
#define clzll(i)
#define popcount(x)
#define PP_NARG(...)
#define STATIC_ASSERT(COND, MESSAGE)
#define IS_ENABLED(config)
#define IS_ENABLED_DUMMY_1   0,
#define IS_ENABLED_STEP_1(config)
#define IS_ENABLED_STEP_2(values)
#define IS_ENABLED_STEP_3(ignore, value, ...)
#define SOF_CONFIG_HIFI(level, component)
#define SOF_USE_HIFI(level, component)
#define SOF_USE_MIN_HIFI(minlevel, component)
#define SOF_MAX_XCHAL_HIFI   NONE
#define SOF_FRAME_BYTE_ALIGN   4
#define SOF_FRAME_COUNT_ALIGN   1
#define __GLIBC_USE(x)
#define ASSUME_ALIGNED(x, a)

Macro Definition Documentation

◆ __GLIBC_USE

#define __GLIBC_USE ( x)
Value:
0

◆ __must_check

#define __must_check   __attribute__((warn_unused_result))

◆ ALIGN

#define ALIGN ( val,
align )
Value:
ALIGN_UP_INTERNAL(val, align)
#define ALIGN_UP_INTERNAL(val, align)
Definition common.h:31

◆ ALIGN_DOWN

#define ALIGN_DOWN ( size,
alignment )
Value:
((size) & ~((alignment) - 1))

◆ ALIGN_UP

#define ALIGN_UP ( size,
alignment )
Value:
ALIGN_UP_INTERNAL(size, alignment)

◆ ALIGN_UP_COMPILE

#define ALIGN_UP_COMPILE   ALIGN_UP

◆ ALIGN_UP_INTERNAL

#define ALIGN_UP_INTERNAL ( val,
align )
Value:
(((val) + (align) - 1) & ~((align) - 1))

◆ ARRAY_SIZE

#define ARRAY_SIZE ( x)
Value:
(sizeof(x) / sizeof((x)[0]))

◆ ASSUME_ALIGNED

#define ASSUME_ALIGNED ( x,
a )
Value:
((__typeof__(x))__builtin_assume_aligned((x), a))

◆ attr_container_of

#define attr_container_of ( ptr,
type,
member,
attr )
Value:
({const __typeof__(((type *)0)->member) attr *__memberptr = (ptr); \
(type *)((char attr *)__memberptr - offsetof(type, member)); })
uint32_t type
Definition tlv.h:0

◆ clz

#define clz ( i)
Value:
__builtin_clz(i)

◆ clzl

#define clzl ( i)
Value:
__builtin_clzl(i)

◆ clzll

#define clzll ( i)
Value:
__builtin_clzll(i)

◆ compile_check

#define compile_check ( x)
Value:
(sizeof(struct { int _f[2 * (x) - 1]; }) != 0)

◆ container_of

#define container_of ( ptr,
type,
member )
Value:
({const __typeof__(((type *)0)->member)*__memberptr = (ptr); \
(type *)((char *)__memberptr - offsetof(type, member)); })

◆ ffs

#define ffs ( i)
Value:
__builtin_ffs(i)

◆ ffsl

#define ffsl ( i)
Value:
__builtin_ffsl(i)

◆ ffsll

#define ffsll ( i)
Value:
__builtin_ffsll(i)

◆ IS_ALIGNED

#define IS_ALIGNED ( size,
alignment )
Value:
((size) % (alignment) == 0)

◆ IS_ENABLED

#define IS_ENABLED ( config)
Value:
#define IS_ENABLED_STEP_1(config)
Definition common.h:175

◆ IS_ENABLED_DUMMY_1

#define IS_ENABLED_DUMMY_1   0,

◆ IS_ENABLED_STEP_1

#define IS_ENABLED_STEP_1 ( config)
Value:
IS_ENABLED_STEP_2(IS_ENABLED_DUMMY_ ## config)
#define IS_ENABLED_STEP_2(values)
Definition common.h:176

◆ IS_ENABLED_STEP_2

#define IS_ENABLED_STEP_2 ( values)
Value:
IS_ENABLED_STEP_3(values 1, 0)
#define IS_ENABLED_STEP_3(ignore, value,...)
Definition common.h:177

◆ IS_ENABLED_STEP_3

#define IS_ENABLED_STEP_3 ( ignore,
value,
... )
Value:
(!!(value))
char value[]
Definition tlv.h:2

◆ is_power_of_2

#define is_power_of_2 ( x)
Value:
((x) && !((x) & ((x) - 1)))

◆ popcount

#define popcount ( x)
Value:
__builtin_popcount(x)

◆ PP_NARG

#define PP_NARG ( ...)
Value:
(sizeof((unsigned int[]){0, ##__VA_ARGS__}) \
/ sizeof(unsigned int) - 1)

◆ SOF_CONFIG_HIFI

#define SOF_CONFIG_HIFI ( level,
component )
Value:
(CONFIG_ ## component ## _HIFI_ ## level)

◆ SOF_DIV_ROUND_UP

#define SOF_DIV_ROUND_UP ( val,
div )
Value:
(((val) + (div) - 1) / (div))

◆ SOF_FRAME_BYTE_ALIGN

#define SOF_FRAME_BYTE_ALIGN   4

◆ SOF_FRAME_COUNT_ALIGN

#define SOF_FRAME_COUNT_ALIGN   1

◆ SOF_MAX_XCHAL_HIFI

#define SOF_MAX_XCHAL_HIFI   NONE

◆ SOF_USE_HIFI

#define SOF_USE_HIFI ( level,
component )
Value:
(SOF_CONFIG_HIFI(level, component) || \
(SOF_CONFIG_HIFI(MAX, component) && level == SOF_MAX_XCHAL_HIFI))
#define SOF_MAX_XCHAL_HIFI
Definition common.h:202
#define SOF_CONFIG_HIFI(level, component)
Definition common.h:180
#define MAX(a, b)
Definition numbers.h:20

◆ SOF_USE_MIN_HIFI

#define SOF_USE_MIN_HIFI ( minlevel,
component )
Value:
(SOF_CONFIG_HIFI(minlevel, component) || \
(SOF_CONFIG_HIFI(MAX, component) && minlevel <= SOF_MAX_XCHAL_HIFI))

◆ STATIC_ASSERT

#define STATIC_ASSERT ( COND,
MESSAGE )
Value:
__attribute__((unused)) \
typedef char _CONCAT(assertion_failed_, MESSAGE)[(COND) ? 1 : -1]
#define _CONCAT(x, y)
Definition string_macro.h:15