X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fhelper.h;h=9873feadd85b020556c1cd1e4f45925094b1fdd1;hb=ab12eb57cf3fdd2c25df16a3d1e770a2642b93e8;hp=b9448e3324febca1f1923b6ef01c53532529d36c;hpb=415dfaf718b209207bf492a5f9afa571f76d789c;p=lttng-ust.git diff --git a/include/helper.h b/include/helper.h index b9448e33..9873fead 100644 --- a/include/helper.h +++ b/include/helper.h @@ -41,4 +41,18 @@ void *zmalloc(size_t len) __min1 <= __min2 ? __min1: __min2; \ }) +#define LTTNG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + +/* + * Use of __builtin_return_address(0) sometimes seems to cause stack + * corruption on 32-bit PowerPC. Disable this feature on that + * architecture for now by always using the NULL value for the ip + * context. + */ +#if defined(__PPC__) && !defined(__PPC64__) +#define LTTNG_UST_CALLER_IP() NULL +#else /* #if defined(__PPC__) && !defined(__PPC64__) */ +#define LTTNG_UST_CALLER_IP() __builtin_return_address(0) +#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */ + #endif /* _LTTNG_UST_HELPER_H */