X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Fust%2Fcore.h;h=4e75c515e708893db275adb7bbf699046d9dd429;hb=d4419b81b243bc3a6bdd4a09b3ca2216d044a1c7;hp=b9f5b9793887a27cb433444f26f8399f1ef60ca9;hpb=9f3fdbc68877e1f12b6cedb15ef76d9af9b48bac;p=lttng-ust.git diff --git a/include/ust/core.h b/include/ust/core.h index b9f5b979..4e75c515 100644 --- a/include/ust/core.h +++ b/include/ust/core.h @@ -3,11 +3,12 @@ /* * Copyright (C) 2010 Pierre-Marc Fournier + * Copyright (C) 2011 Mathieu Desnoyers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * License as published by the Free Software Foundation; version 2.1 of + * the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,9 +23,7 @@ #include #include #include - -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) +#include /* ARRAYS */ @@ -44,7 +43,7 @@ /* ERROR OPS */ #define MAX_ERRNO 4095 -#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) +#define IS_ERR_VALUE(x) caa_unlikely((x) >= (unsigned long)-MAX_ERRNO) static inline void *ERR_PTR(long error) { @@ -145,7 +144,7 @@ static __inline__ int ust_get_cpu(void) int cpu; cpu = sched_getcpu(); - if (likely(cpu >= 0)) + if (caa_likely(cpu >= 0)) return cpu; /* * If getcpu(2) is not implemented in the Kernel use CPU 0 as fallback.