cds.h   cds.h 
skipping to change at line 32 skipping to change at line 32
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <urcu/hlist.h> #include <urcu/hlist.h>
#include <urcu/list.h> #include <urcu/list.h>
#include <urcu/rcuhlist.h> #include <urcu/rcuhlist.h>
#include <urcu/rculist.h> #include <urcu/rculist.h>
#include <urcu/rculfqueue.h> #include <urcu/rculfqueue.h>
#include <urcu/rculfstack.h> #include <urcu/rculfstack.h>
#include <urcu/rculfhash.h>
#include <urcu/wfqueue.h> #include <urcu/wfqueue.h>
#include <urcu/wfstack.h> #include <urcu/wfstack.h>
#endif /* _URCU_CDS_H */ #endif /* _URCU_CDS_H */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 compiler.h   compiler.h 
#ifndef _URCU_COMPILER_H #ifndef _URCU_COMPILER_H
#define _URCU_COMPILER_H #define _URCU_COMPILER_H
/* /*
* compiler.h * compiler.h
* *
* Compiler definitions. * Compiler definitions.
* *
* Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* *
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * Permission is hereby granted, free of charge, to any person obtaining a
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK. copy
* of this software and associated documentation files (the "Software"), to
deal
* in the Software without restriction, including without limitation the ri
ghts
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sel
l
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* Permission is hereby granted to use or copy this program * The above copyright notice and this permission notice shall be included
* for any purpose, provided the above notices are retained on all copies. in
* Permission to modify the code and to distribute modified code is granted * all copies or substantial portions of the Software.
,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/ */
#include <stddef.h> /* for offsetof */ #include <stddef.h> /* for offsetof */
#define caa_likely(x) __builtin_expect(!!(x), 1) #define caa_likely(x) __builtin_expect(!!(x), 1)
#define caa_unlikely(x) __builtin_expect(!!(x), 0) #define caa_unlikely(x) __builtin_expect(!!(x), 0)
#define cmm_barrier() asm volatile("" : : : "memory") #define cmm_barrier() asm volatile("" : : : "memory")
/* /*
skipping to change at line 88 skipping to change at line 89
* usage. * usage.
*/ */
#define __rcu #define __rcu
#ifdef __cplusplus #ifdef __cplusplus
#define URCU_FORCE_CAST(type, arg) (reinterpret_cast<type>(arg)) #define URCU_FORCE_CAST(type, arg) (reinterpret_cast<type>(arg))
#else #else
#define URCU_FORCE_CAST(type, arg) ((type) (arg)) #define URCU_FORCE_CAST(type, arg) ((type) (arg))
#endif #endif
#define caa_is_signed_type(type) (((type) (-1)) < 0)
#define caa_cast_long_keep_sign(v) \
(caa_is_signed_type(__typeof__(v)) ? (long) (v) : (unsigned long) (v
))
#endif /* _URCU_COMPILER_H */ #endif /* _URCU_COMPILER_H */
 End of changes. 3 change blocks. 
8 lines changed or deleted 19 lines changed or added


 config.h   config.h 
skipping to change at line 20 skipping to change at line 20
/* Enable SMP support. With SMP support enabled, uniprocessors are also /* Enable SMP support. With SMP support enabled, uniprocessors are also
supported. With SMP support disabled, UP systems work fine, but the supported. With SMP support disabled, UP systems work fine, but the
behavior of SMP systems is undefined. */ behavior of SMP systems is undefined. */
#define CONFIG_RCU_SMP 1 #define CONFIG_RCU_SMP 1
/* Compatibility mode for i386 which lacks cmpxchg instruction. */ /* Compatibility mode for i386 which lacks cmpxchg instruction. */
/* #undef CONFIG_RCU_COMPAT_ARCH */ /* #undef CONFIG_RCU_COMPAT_ARCH */
/* Use the dmb instruction is available for use on ARM. */ /* Use the dmb instruction is available for use on ARM. */
/* #undef CONFIG_RCU_ARM_HAVE_DMB */ /* #undef CONFIG_RCU_ARM_HAVE_DMB */
/* TLS provided by the compiler. */
#define CONFIG_RCU_TLS __thread
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 futex.h   futex.h 
#ifndef _URCU_FUTEX_H #ifndef _URCU_FUTEX_H
#define _URCU_FUTEX_H #define _URCU_FUTEX_H
/* /*
* urcu-futex.h * urcu-futex.h
* *
* Userspace RCU - sys_futex/compat_futex header. * Userspace RCU - sys_futex/compat_futex header.
* *
* Copyright 2011-2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 generic.h   generic.h 
skipping to change at line 40 skipping to change at line 40
#ifndef CAA_CACHE_LINE_SIZE #ifndef CAA_CACHE_LINE_SIZE
#define CAA_CACHE_LINE_SIZE 64 #define CAA_CACHE_LINE_SIZE 64
#endif #endif
#if !defined(cmm_mc) && !defined(cmm_rmc) && !defined(cmm_wmc) #if !defined(cmm_mc) && !defined(cmm_rmc) && !defined(cmm_wmc)
#define CONFIG_HAVE_MEM_COHERENCY #define CONFIG_HAVE_MEM_COHERENCY
/* /*
* Architectures with cache coherency must _not_ define cmm_mc/cmm_rmc/cmm_ wmc. * Architectures with cache coherency must _not_ define cmm_mc/cmm_rmc/cmm_ wmc.
* *
* For them, cmm_mc/cmm_rmc/cmm_wmc are implemented with a * simple compile * For them, cmm_mc/cmm_rmc/cmm_wmc are implemented with a simple
r barrier; * compiler barrier; in addition, we provide defaults for cmm_mb (using
* in addition, we provide defaults for cmm_mb (using GCC builtins) as well * GCC builtins) as well as cmm_rmb and cmm_wmb (defaulting to cmm_mb).
as
* cmm_rmb and cmm_wmb (defaulting to cmm_mb).
*/ */
#ifndef cmm_mb #ifndef cmm_mb
#define cmm_mb() __sync_synchronize() #define cmm_mb() __sync_synchronize()
#endif #endif
#ifndef cmm_rmb #ifndef cmm_rmb
#define cmm_rmb() cmm_mb() #define cmm_rmb() cmm_mb()
#endif #endif
skipping to change at line 64 skipping to change at line 64
#define cmm_wmb() cmm_mb() #define cmm_wmb() cmm_mb()
#endif #endif
#define cmm_mc() cmm_barrier() #define cmm_mc() cmm_barrier()
#define cmm_rmc() cmm_barrier() #define cmm_rmc() cmm_barrier()
#define cmm_wmc() cmm_barrier() #define cmm_wmc() cmm_barrier()
#else #else
/* /*
* Architectures without cache coherency need something like the following: * Architectures without cache coherency need something like the following:
* *
* #define cmm_mc() arch_cache_flush() * #define cmm_mc() arch_cache_flush()
* #define cmm_rmc() arch_cache_flush_read() * #define cmm_rmc() arch_cache_flush_read()
* #define cmm_wmc() arch_cache_flush_write() * #define cmm_wmc() arch_cache_flush_write()
* *
* Of these, only cmm_mc is mandatory. cmm_rmc and cmm_wmc default to cmm_ * Of these, only cmm_mc is mandatory. cmm_rmc and cmm_wmc default to
mc. * cmm_mc. cmm_mb/cmm_rmb/cmm_wmb use these definitions by default:
* cmm_mb/cmm_rmb/cmm_wmb use these definitions by default:
* *
* #define cmm_mb() cmm_mc() * #define cmm_mb() cmm_mc()
* #define cmm_rmb() cmm_rmc() * #define cmm_rmb() cmm_rmc()
* #define cmm_wmb() cmm_wmc() * #define cmm_wmb() cmm_wmc()
*/ */
#ifndef cmm_mb #ifndef cmm_mb
#define cmm_mb() cmm_mc() #define cmm_mb() cmm_mc()
#endif #endif
#ifndef cmm_rmb #ifndef cmm_rmb
#define cmm_rmb() cmm_rmc() #define cmm_rmb() cmm_rmc()
 End of changes. 4 change blocks. 
10 lines changed or deleted 7 lines changed or added


 system.h   system.h 
#ifndef _URCU_SYSTEM_H #ifndef _URCU_SYSTEM_H
#define _URCU_SYSTEM_H #define _URCU_SYSTEM_H
/* /*
* system.h * system.h
* *
* System definitions. * System definitions.
* *
* Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* *
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * Permission is hereby granted, free of charge, to any person obtaining a
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK. copy
* of this software and associated documentation files (the "Software"), to
deal
* in the Software without restriction, including without limitation the ri
ghts
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sel
l
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* Permission is hereby granted to use or copy this program * The above copyright notice and this permission notice shall be included
* for any purpose, provided the above notices are retained on all copies. in
* Permission to modify the code and to distribute modified code is granted * all copies or substantial portions of the Software.
,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/ */
#include <urcu/compiler.h> #include <urcu/compiler.h>
#include <urcu/arch.h> #include <urcu/arch.h>
/* /*
* Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come befo * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come
re the load. * before the load.
*/ */
#define _CMM_LOAD_SHARED(p) CMM_ACCESS_ONCE(p) #define _CMM_LOAD_SHARED(p) CMM_ACCESS_ONCE(p)
/* /*
* Load a data from shared memory, doing a cache flush if required. * Load a data from shared memory, doing a cache flush if required.
*/ */
#define CMM_LOAD_SHARED(p) \ #define CMM_LOAD_SHARED(p) \
({ \ ({ \
cmm_smp_rmc(); \ cmm_smp_rmc(); \
_CMM_LOAD_SHARED(p); \ _CMM_LOAD_SHARED(p); \
}) })
/* /*
* Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should follow t * Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should
he store. * follow the store.
*/ */
#define _CMM_STORE_SHARED(x, v) ({ CMM_ACCESS_ONCE(x) = (v); }) #define _CMM_STORE_SHARED(x, v) ({ CMM_ACCESS_ONCE(x) = (v); })
/* /*
* Store v into x, where x is located in shared memory. Performs the requir * Store v into x, where x is located in shared memory. Performs the
ed * required cache flush after writing. Returns v.
* cache flush after writing. Returns v.
*/ */
#define CMM_STORE_SHARED(x, v) \ #define CMM_STORE_SHARED(x, v) \
({ \ ({ \
typeof(x) _v = _CMM_STORE_SHARED(x, v); \ typeof(x) _v = _CMM_STORE_SHARED(x, v); \
cmm_smp_wmc(); \ cmm_smp_wmc(); \
_v; \ _v; \
}) })
#endif /* _URCU_SYSTEM_H */ #endif /* _URCU_SYSTEM_H */
 End of changes. 5 change blocks. 
15 lines changed or deleted 19 lines changed or added


 uatomic.h   uatomic.h 
skipping to change at line 98 skipping to change at line 98
__asm__ __volatile__( __asm__ __volatile__(
"lock; cmpxchgq %2, %1" "lock; cmpxchgq %2, %1"
: "+a"(result), "+m"(*__hp(addr)) : "+a"(result), "+m"(*__hp(addr))
: "r"((unsigned long)_new) : "r"((unsigned long)_new)
: "memory"); : "memory");
return result; return result;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return 0; return 0;
} }
#define _uatomic_cmpxchg(addr, old, _new) \ #define _uatomic_cmpxchg(addr, old, _new) \
((__typeof__(*(addr))) __uatomic_cmpxchg((addr), (unsigned long)(old ((__typeof__(*(addr))) __uatomic_cmpxchg((addr),
),\ \
(unsigned long)(_new), caa_cast_long_keep_sign(old)
\ , \
caa_cast_long_keep_sign(_new
),\
sizeof(*(addr)))) sizeof(*(addr))))
/* xchg */ /* xchg */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
unsigned long __uatomic_exchange(void *addr, unsigned long val, int len) unsigned long __uatomic_exchange(void *addr, unsigned long val, int len)
{ {
/* Note: the "xchg" instruction does not need a "lock" prefix. */ /* Note: the "xchg" instruction does not need a "lock" prefix. */
switch (len) { switch (len) {
case 1: case 1:
skipping to change at line 159 skipping to change at line 162
unsigned long result; unsigned long result;
__asm__ __volatile__( __asm__ __volatile__(
"xchgq %0, %1" "xchgq %0, %1"
: "=r"(result), "+m"(*__hp(addr)) : "=r"(result), "+m"(*__hp(addr))
: "0" ((unsigned long)val) : "0" ((unsigned long)val)
: "memory"); : "memory");
return result; return result;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return 0; return 0;
} }
#define _uatomic_xchg(addr, v) \ #define _uatomic_xchg(addr, v) \
((__typeof__(*(addr))) __uatomic_exchange((addr), (unsigned long)(v) ((__typeof__(*(addr))) __uatomic_exchange((addr),
, \ \
caa_cast_long_keep_sign(v),
\
sizeof(*(addr)))) sizeof(*(addr))))
/* uatomic_add_return */ /* uatomic_add_return */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
unsigned long __uatomic_add_return(void *addr, unsigned long val, unsigned long __uatomic_add_return(void *addr, unsigned long val,
int len) int len)
{ {
switch (len) { switch (len) {
case 1: case 1:
skipping to change at line 223 skipping to change at line 229
__asm__ __volatile__( __asm__ __volatile__(
"lock; xaddq %1, %0" "lock; xaddq %1, %0"
: "+m"(*__hp(addr)), "+r" (result) : "+m"(*__hp(addr)), "+r" (result)
: :
: "memory"); : "memory");
return result + (unsigned long)val; return result + (unsigned long)val;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return 0; return 0;
} }
#define _uatomic_add_return(addr, v) \ #define _uatomic_add_return(addr, v)
((__typeof__(*(addr))) __uatomic_add_return((addr), \ \
(unsigned long)(v), \ ((__typeof__(*(addr))) __uatomic_add_return((addr),
sizeof(*(addr)))) \
caa_cast_long_keep_sign(v),
\
sizeof(*(addr))))
/* uatomic_and */ /* uatomic_and */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
void __uatomic_and(void *addr, unsigned long val, int len) void __uatomic_and(void *addr, unsigned long val, int len)
{ {
switch (len) { switch (len) {
case 1: case 1:
{ {
__asm__ __volatile__( __asm__ __volatile__(
skipping to change at line 279 skipping to change at line 287
{ {
__asm__ __volatile__( __asm__ __volatile__(
"lock; andq %1, %0" "lock; andq %1, %0"
: "=m"(*__hp(addr)) : "=m"(*__hp(addr))
: "er" ((unsigned long)val) : "er" ((unsigned long)val)
: "memory"); : "memory");
return; return;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return; return;
} }
#define _uatomic_and(addr, v) \ #define _uatomic_and(addr, v) \
(__uatomic_and((addr), (unsigned long)(v), sizeof(*(addr)))) (__uatomic_and((addr), caa_cast_long_keep_sign(v), sizeof(*(addr))))
/* uatomic_or */ /* uatomic_or */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
void __uatomic_or(void *addr, unsigned long val, int len) void __uatomic_or(void *addr, unsigned long val, int len)
{ {
switch (len) { switch (len) {
case 1: case 1:
{ {
__asm__ __volatile__( __asm__ __volatile__(
skipping to change at line 333 skipping to change at line 343
{ {
__asm__ __volatile__( __asm__ __volatile__(
"lock; orq %1, %0" "lock; orq %1, %0"
: "=m"(*__hp(addr)) : "=m"(*__hp(addr))
: "er" ((unsigned long)val) : "er" ((unsigned long)val)
: "memory"); : "memory");
return; return;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return; return;
} }
#define _uatomic_or(addr, v) \ #define _uatomic_or(addr, v) \
(__uatomic_or((addr), (unsigned long)(v), sizeof(*(addr)))) (__uatomic_or((addr), caa_cast_long_keep_sign(v), sizeof(*(addr))))
/* uatomic_add */ /* uatomic_add */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
void __uatomic_add(void *addr, unsigned long val, int len) void __uatomic_add(void *addr, unsigned long val, int len)
{ {
switch (len) { switch (len) {
case 1: case 1:
{ {
__asm__ __volatile__( __asm__ __volatile__(
skipping to change at line 387 skipping to change at line 399
{ {
__asm__ __volatile__( __asm__ __volatile__(
"lock; addq %1, %0" "lock; addq %1, %0"
: "=m"(*__hp(addr)) : "=m"(*__hp(addr))
: "er" ((unsigned long)val) : "er" ((unsigned long)val)
: "memory"); : "memory");
return; return;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return; return;
} }
#define _uatomic_add(addr, v) \ #define _uatomic_add(addr, v) \
(__uatomic_add((addr), (unsigned long)(v), sizeof(*(addr)))) (__uatomic_add((addr), caa_cast_long_keep_sign(v), sizeof(*(addr))))
/* uatomic_inc */ /* uatomic_inc */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
void __uatomic_inc(void *addr, int len) void __uatomic_inc(void *addr, int len)
{ {
switch (len) { switch (len) {
case 1: case 1:
{ {
__asm__ __volatile__( __asm__ __volatile__(
skipping to change at line 494 skipping to change at line 508
{ {
__asm__ __volatile__( __asm__ __volatile__(
"lock; decq %0" "lock; decq %0"
: "=m"(*__hp(addr)) : "=m"(*__hp(addr))
: :
: "memory"); : "memory");
return; return;
} }
#endif #endif
} }
/* generate an illegal instruction. Cannot catch this with linker tr /*
icks * generate an illegal instruction. Cannot catch this with
* when optimizations are disabled. */ * linker tricks when optimizations are disabled.
*/
__asm__ __volatile__("ud2"); __asm__ __volatile__("ud2");
return; return;
} }
#define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr)))) #define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr))))
#if ((CAA_BITS_PER_LONG != 64) && defined(CONFIG_RCU_COMPAT_ARCH)) #if ((CAA_BITS_PER_LONG != 64) && defined(CONFIG_RCU_COMPAT_ARCH))
extern int __rcu_cas_avail; extern int __rcu_cas_avail;
extern int __rcu_cas_init(void); extern int __rcu_cas_init(void);
skipping to change at line 519 skipping to change at line 535
: ((caa_unlikely(__rcu_cas_avail < 0) \ : ((caa_unlikely(__rcu_cas_avail < 0) \
? ((__rcu_cas_init() > 0) \ ? ((__rcu_cas_init() > 0) \
? (_uatomic_##insn) \ ? (_uatomic_##insn) \
: (compat_uatomic_##insn)) \ : (compat_uatomic_##insn)) \
: (compat_uatomic_##insn)))) : (compat_uatomic_##insn))))
extern unsigned long _compat_uatomic_set(void *addr, extern unsigned long _compat_uatomic_set(void *addr,
unsigned long _new, int len); unsigned long _new, int len);
#define compat_uatomic_set(addr, _new) \ #define compat_uatomic_set(addr, _new) \
((__typeof__(*(addr))) _compat_uatomic_set((addr), \ ((__typeof__(*(addr))) _compat_uatomic_set((addr), \
(unsigned long)(_new), \ caa_cast_long_keep_sign(_new ), \
sizeof(*(addr)))) sizeof(*(addr))))
extern unsigned long _compat_uatomic_xchg(void *addr, extern unsigned long _compat_uatomic_xchg(void *addr,
unsigned long _new, int len); unsigned long _new, int len);
#define compat_uatomic_xchg(addr, _new) \ #define compat_uatomic_xchg(addr, _new) \
((__typeof__(*(addr))) _compat_uatomic_xchg((addr), \ ((__typeof__(*(addr))) _compat_uatomic_xchg((addr), \
(unsigned long)(_new), \ caa_cast_long_keep_sign(_new ), \
sizeof(*(addr)))) sizeof(*(addr))))
extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old, extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old,
unsigned long _new, int len); unsigned long _new, int len);
#define compat_uatomic_cmpxchg(addr, old, _new) \ #define compat_uatomic_cmpxchg(addr, old, _new) \
((__typeof__(*(addr))) _compat_uatomic_cmpxchg((addr), \ ((__typeof__(*(addr))) _compat_uatomic_cmpxchg((addr), \
(unsigned long)(old), caa_cast_long_keep_sign(old)
\ , \
(unsigned long)(_new), caa_cast_long_keep_sign(_new
\ ), \
sizeof(*(addr)))) sizeof(*(addr))))
extern void _compat_uatomic_and(void *addr, unsigned long _new, int len); extern void _compat_uatomic_and(void *addr, unsigned long _new, int len);
#define compat_uatomic_and(addr, v) \ #define compat_uatomic_and(addr, v) \
(_compat_uatomic_and((addr), \ (_compat_uatomic_and((addr), \
(unsigned long)(v), \ caa_cast_long_keep_sign(v), \
sizeof(*(addr)))) sizeof(*(addr))))
extern void _compat_uatomic_or(void *addr, unsigned long _new, int len); extern void _compat_uatomic_or(void *addr, unsigned long _new, int len);
#define compat_uatomic_or(addr, v) \ #define compat_uatomic_or(addr, v) \
(_compat_uatomic_or((addr), \ (_compat_uatomic_or((addr), \
(unsigned long)(v), \ caa_cast_long_keep_sign(v), \
sizeof(*(addr)))) sizeof(*(addr))))
extern unsigned long _compat_uatomic_add_return(void *addr, extern unsigned long _compat_uatomic_add_return(void *addr,
unsigned long _new, int len) ; unsigned long _new, int len) ;
#define compat_uatomic_add_return(addr, v) \ #define compat_uatomic_add_return(addr, v)
((__typeof__(*(addr))) _compat_uatomic_add_return((addr), \ \
(unsigned long)(v), \ ((__typeof__(*(addr))) _compat_uatomic_add_return((addr),
sizeof(*(addr)))) \
caa_cast_long_keep_sign(v),
\
sizeof(*(addr))))
#define compat_uatomic_add(addr, v) \ #define compat_uatomic_add(addr, v) \
((void)compat_uatomic_add_return((addr), (v))) ((void)compat_uatomic_add_return((addr), (v)))
#define compat_uatomic_inc(addr) \ #define compat_uatomic_inc(addr) \
(compat_uatomic_add((addr), 1)) (compat_uatomic_add((addr), 1))
#define compat_uatomic_dec(addr) \ #define compat_uatomic_dec(addr) \
(compat_uatomic_add((addr), -1)) (compat_uatomic_add((addr), -1))
#else #else
#define UATOMIC_COMPAT(insn) (_uatomic_##insn) #define UATOMIC_COMPAT(insn) (_uatomic_##insn)
#endif #endif
/* Read is atomic even in compat mode */ /* Read is atomic even in compat mode */
#define uatomic_set(addr, v) \ #define uatomic_set(addr, v) \
UATOMIC_COMPAT(set(addr, v)) UATOMIC_COMPAT(set(addr, v))
#define uatomic_cmpxchg(addr, old, _new) \ #define uatomic_cmpxchg(addr, old, _new) \
UATOMIC_COMPAT(cmpxchg(addr, old, _new)) UATOMIC_COMPAT(cmpxchg(addr, old, _new))
#define uatomic_xchg(addr, v) \ #define uatomic_xchg(addr, v) \
UATOMIC_COMPAT(xchg(addr, v)) UATOMIC_COMPAT(xchg(addr, v))
#define uatomic_and(addr, v) \ #define uatomic_and(addr, v) \
UATOMIC_COMPAT(and(addr, v)) UATOMIC_COMPAT(and(addr, v))
#define cmm_smp_mb__before_uatomic_and() cmm_barrier()
#define cmm_smp_mb__after_uatomic_and() cmm_barrier()
#define uatomic_or(addr, v) \ #define uatomic_or(addr, v) \
UATOMIC_COMPAT(or(addr, v)) UATOMIC_COMPAT(or(addr, v))
#define cmm_smp_mb__before_uatomic_or() cmm_barrier()
#define cmm_smp_mb__after_uatomic_or() cmm_barrier()
#define uatomic_add_return(addr, v) \ #define uatomic_add_return(addr, v) \
UATOMIC_COMPAT(add_return(addr, v)) UATOMIC_COMPAT(add_return(addr, v))
#define uatomic_add(addr, v) UATOMIC_COMPAT(add(addr, v)) #define uatomic_add(addr, v) UATOMIC_COMPAT(add(addr, v))
#define cmm_smp_mb__before_uatomic_add() cmm_barrier()
#define cmm_smp_mb__after_uatomic_add() cmm_barrier()
#define uatomic_inc(addr) UATOMIC_COMPAT(inc(addr)) #define uatomic_inc(addr) UATOMIC_COMPAT(inc(addr))
#define cmm_smp_mb__before_uatomic_inc() cmm_barrier()
#define cmm_smp_mb__after_uatomic_inc() cmm_barrier()
#define uatomic_dec(addr) UATOMIC_COMPAT(dec(addr)) #define uatomic_dec(addr) UATOMIC_COMPAT(dec(addr))
#define cmm_smp_mb__before_uatomic_dec() cmm_barrier()
#define cmm_smp_mb__after_uatomic_dec() cmm_barrier()
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu/uatomic/generic.h> #include <urcu/uatomic/generic.h>
#endif /* _URCU_ARCH_UATOMIC_X86_H */ #endif /* _URCU_ARCH_UATOMIC_X86_H */
 End of changes. 25 change blocks. 
46 lines changed or deleted 78 lines changed or added


 urcu-bp.h   urcu-bp.h 
skipping to change at line 183 skipping to change at line 183
static inline void rcu_thread_online(void) static inline void rcu_thread_online(void)
{ {
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu-call-rcu.h> #include <urcu-call-rcu.h>
#include <urcu-defer.h> #include <urcu-defer.h>
#include <urcu-flavor.h>
#endif /* _URCU_BP_H */ #endif /* _URCU_BP_H */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 urcu-call-rcu.h   urcu-call-rcu.h 
skipping to change at line 65 skipping to change at line 65
*/ */
struct rcu_head { struct rcu_head {
struct cds_wfq_node next; struct cds_wfq_node next;
void (*func)(struct rcu_head *head); void (*func)(struct rcu_head *head);
}; };
/* /*
* Exported functions * Exported functions
* *
* Important: see userspace RCU API.txt for call_rcu family of functions * Important: see rcu-api.txt in userspace-rcu documentation for
* usage detail, including the surrounding RCU usage required when using * call_rcu family of functions usage detail, including the surrounding
* these primitives. * RCU usage required when using these primitives.
*/ */
void call_rcu(struct rcu_head *head, void call_rcu(struct rcu_head *head,
void (*func)(struct rcu_head *head)); void (*func)(struct rcu_head *head));
struct call_rcu_data *create_call_rcu_data(unsigned long flags, struct call_rcu_data *create_call_rcu_data(unsigned long flags,
int cpu_affinity); int cpu_affinity);
void call_rcu_data_free(struct call_rcu_data *crdp); void call_rcu_data_free(struct call_rcu_data *crdp);
struct call_rcu_data *get_default_call_rcu_data(void); struct call_rcu_data *get_default_call_rcu_data(void);
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 urcu-pointer.h   urcu-pointer.h 
skipping to change at line 50 skipping to change at line 50
/* /*
* rcu_dereference(ptr) * rcu_dereference(ptr)
* *
* Fetch a RCU-protected pointer. Typically used to copy the variable ptr t o a * Fetch a RCU-protected pointer. Typically used to copy the variable ptr t o a
* local variable. * local variable.
*/ */
#define rcu_dereference _rcu_dereference #define rcu_dereference _rcu_dereference
/* /*
* rcu_cmpxchg_pointer(type **ptr, type *new, type *old) * type *rcu_cmpxchg_pointer(type **ptr, type *new, type *old)
* type *rcu_xchg_pointer(type **ptr, type *new) * type *rcu_xchg_pointer(type **ptr, type *new)
* type *rcu_set_pointer(type **ptr, type *new) * void rcu_set_pointer(type **ptr, type *new)
* *
* RCU pointer updates. * RCU pointer updates.
* @ptr: address of the pointer to modify * @ptr: address of the pointer to modify
* @new: new pointer value * @new: new pointer value
* @old: old pointer value (expected) * @old: old pointer value (expected)
* *
* return: old pointer value * return: old pointer value
*/ */
#define rcu_cmpxchg_pointer _rcu_cmpxchg_pointer #define rcu_cmpxchg_pointer _rcu_cmpxchg_pointer
#define rcu_xchg_pointer _rcu_xchg_pointer #define rcu_xchg_pointer _rcu_xchg_pointer
skipping to change at line 97 skipping to change at line 97
extern void *rcu_xchg_pointer_sym(void **p, void *v); extern void *rcu_xchg_pointer_sym(void **p, void *v);
#define rcu_xchg_pointer(p, v) \ #define rcu_xchg_pointer(p, v) \
({ \ ({ \
typeof(*(p)) _________pv = (v); \ typeof(*(p)) _________pv = (v); \
typeof(*(p)) _________p1 = URCU_FORCE_CAST(typeof(*(p)), \ typeof(*(p)) _________p1 = URCU_FORCE_CAST(typeof(*(p)), \
rcu_xchg_pointer_sym(URCU_FORCE_CAST(void **, p), \ rcu_xchg_pointer_sym(URCU_FORCE_CAST(void **, p), \
_________pv)); \ _________pv)); \
(_________p1); \ (_________p1); \
}) })
/*
* Note: rcu_set_pointer_sym returns @v because we don't want to break
* the ABI. At the API level, rcu_set_pointer() now returns void. Use of
* the return value is therefore deprecated, and will cause a build
* error.
*/
extern void *rcu_set_pointer_sym(void **p, void *v); extern void *rcu_set_pointer_sym(void **p, void *v);
#define rcu_set_pointer(p, v) \ #define rcu_set_pointer(p, v) \
({ \ do { \
typeof(*(p)) _________pv = (v); \ typeof(*(p)) _________pv = (v); \
typeof(*(p)) _________p1 = URCU_FORCE_CAST(typeof(*(p)), (void) rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p),
\ \
rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p), _________pv);
\ \
_________pv)); } while (0)
\
(_________p1);
\
})
#endif /* !_LGPL_SOURCE */ #endif /* !_LGPL_SOURCE */
/* /*
* rcu_assign_pointer(type *ptr, type *new) * void rcu_assign_pointer(type *ptr, type *new)
* *
* Same as rcu_set_pointer, but takes the pointer to assign to rather than its * Same as rcu_set_pointer, but takes the pointer to assign to rather than its
* address as first parameter. Provided for compatibility with the Linux ke rnel * address as first parameter. Provided for compatibility with the Linux ke rnel
* RCU semantic. * RCU semantic.
*/ */
#define rcu_assign_pointer(p, v) rcu_set_pointer((&p), (v)) #define rcu_assign_pointer(p, v) rcu_set_pointer((&p), (v))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 6 change blocks. 
13 lines changed or deleted 15 lines changed or added


 urcu-qsbr.h   urcu-qsbr.h 
skipping to change at line 130 skipping to change at line 130
*/ */
extern void rcu_register_thread(void); extern void rcu_register_thread(void);
extern void rcu_unregister_thread(void); extern void rcu_unregister_thread(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu-call-rcu.h> #include <urcu-call-rcu.h>
#include <urcu-defer.h> #include <urcu-defer.h>
#include <urcu-flavor.h>
#endif /* _URCU_QSBR_H */ #endif /* _URCU_QSBR_H */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 urcu.h   urcu.h 
skipping to change at line 131 skipping to change at line 131
static inline void rcu_thread_online(void) static inline void rcu_thread_online(void)
{ {
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu-call-rcu.h> #include <urcu-call-rcu.h>
#include <urcu-defer.h> #include <urcu-defer.h>
#include <urcu-flavor.h>
#endif /* _URCU_H */ #endif /* _URCU_H */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/