X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Frculfhash.c;h=efdb5e70ef684d37dbad74af3df3d22820c10f1f;hb=5f6daaef86c3b4cff5af523cbbd8f2630634259d;hp=8aa8bc3e71a518c30d76a543a29c112d5c828f00;hpb=10544ee8af31afb239e3dfa71cb2fe09d3de3771;p=lttng-ust.git diff --git a/liblttng-ust/rculfhash.c b/liblttng-ust/rculfhash.c index 8aa8bc3e..efdb5e70 100644 --- a/liblttng-ust/rculfhash.c +++ b/liblttng-ust/rculfhash.c @@ -1,24 +1,10 @@ /* - * rculfhash.c + * SPDX-License-Identifier: LGPL-2.1-or-later * - * Userspace RCU library - Lock-Free Resizable RCU Hash Table - * - * Copyright 2010-2011 - Mathieu Desnoyers - * Copyright 2011 - Lai Jiangshan - * - * 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. + * Copyright 2010-2011 Mathieu Desnoyers + * Copyright 2011 Lai Jiangshan * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Userspace RCU library - Lock-Free Resizable RCU Hash Table */ /* @@ -270,6 +256,7 @@ #include #include +#include #include #include #include @@ -419,7 +406,7 @@ unsigned long bit_reverse_ulong(unsigned long v) * Returns 0 if no bit is set, else returns the position of the most * significant bit (from 1 to 32 on 32-bit, from 1 to 64 on 64-bit). */ -#if defined(__i386) || defined(__x86_64) +#if defined(LTTNG_UST_ARCH_X86) static inline unsigned int fls_u32(uint32_t x) { @@ -435,7 +422,7 @@ unsigned int fls_u32(uint32_t x) #define HAS_FLS_U32 #endif -#if defined(__x86_64) +#if defined(LTTNG_UST_ARCH_AMD64) static inline unsigned int fls_u64(uint64_t x) { @@ -452,7 +439,10 @@ unsigned int fls_u64(uint64_t x) #endif #ifndef HAS_FLS_U64 -static __attribute__((unused)) +static +unsigned int fls_u64(uint64_t x) + __attribute__((unused)); +static unsigned int fls_u64(uint64_t x) { unsigned int r = 64; @@ -489,7 +479,10 @@ unsigned int fls_u64(uint64_t x) #endif #ifndef HAS_FLS_U32 -static __attribute__((unused)) +static +unsigned int fls_u32(uint32_t x) + __attribute__((unused)); +static unsigned int fls_u32(uint32_t x) { unsigned int r = 32;