2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _LTTNG_UST_HELPER_H
8 #define _LTTNG_UST_HELPER_H
12 #include <lttng/ust-arch.h>
14 static inline __attribute__((always_inline
))
15 void *zmalloc(size_t len
)
17 return calloc(len
, 1);
20 #define max_t(type, x, y) \
24 __max1 > __max2 ? __max1: __max2; \
27 #define min_t(type, x, y) \
31 __min1 <= __min2 ? __min1: __min2; \
34 #define LTTNG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
37 * Use of __builtin_return_address(0) sometimes seems to cause stack
38 * corruption on 32-bit PowerPC. Disable this feature on that
39 * architecture for now by always using the NULL value for the ip
42 #if defined(LTTNG_UST_ARCH_PPC) && !defined(LTTNG_UST_ARCH_PPC64)
43 #define LTTNG_UST_CALLER_IP() NULL
45 #define LTTNG_UST_CALLER_IP() __builtin_return_address(0)
48 #endif /* _LTTNG_UST_HELPER_H */
This page took 0.045114 seconds and 5 git commands to generate.