arch.h   arch.h 
skipping to change at line 72 skipping to change at line 72
cycles_t ret = 0; cycles_t ret = 0;
rdtscll(ret); rdtscll(ret);
return ret; return ret;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu/arch_generic.h> #include <urcu/arch/generic.h>
#endif /* _URCU_ARCH_X86_H */ #endif /* _URCU_ARCH_X86_H */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 config.h   config.h 
/* urcu/config.h. Generated from config.h.in by configure. */ /* urcu/config.h. Generated from config.h.in by configure. */
/* urcu/config.h.in. Manually generatad for control over the contained defs . */ /* urcu/config.h.in. Manually generated for control over the contained defs . */
/* Defined when on a system that has memory fence instructions. */ /* Defined when on a system that has memory fence instructions. */
/* #undef CONFIG_RCU_HAVE_FENCE */ /* #undef CONFIG_RCU_HAVE_FENCE */
/* Defined when on a system with futex support. */ /* Defined when on a system with futex support. */
#define CONFIG_RCU_HAVE_FUTEX 1 #define CONFIG_RCU_HAVE_FUTEX 1
/* 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. */
/* #undef CONFIG_RCU_ARM_HAVE_DMB */
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 list.h   list.h 
skipping to change at line 79 skipping to change at line 79
prev->next = next; prev->next = next;
} }
/* Remove element from list. */ /* Remove element from list. */
static inline void static inline void
cds_list_del (struct cds_list_head *elem) cds_list_del (struct cds_list_head *elem)
{ {
__cds_list_del (elem->prev, elem->next); __cds_list_del (elem->prev, elem->next);
} }
/* Remove element from list, initializing the element's list pointers. */
static inline void
cds_list_del_init (struct cds_list_head *elem)
{
cds_list_del(elem);
CDS_INIT_LIST_HEAD(elem);
}
/* delete from list, add to another list as head */ /* delete from list, add to another list as head */
static inline void static inline void
cds_list_move (struct cds_list_head *elem, struct cds_list_head *head) cds_list_move (struct cds_list_head *elem, struct cds_list_head *head)
{ {
__cds_list_del (elem->prev, elem->next); __cds_list_del (elem->prev, elem->next);
cds_list_add (elem, head); cds_list_add (elem, head);
} }
/* replace an old entry. /* replace an old entry.
*/ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 rculfqueue.h   rculfqueue.h 
skipping to change at line 26 skipping to change at line 26
* 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.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* 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/urcu_ref.h> #include <urcu/ref.h>
#include <assert.h> #include <assert.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Lock-free RCU queue using reference counting. Enqueue and dequeue operat ions * Lock-free RCU queue using reference counting. Enqueue and dequeue operat ions
* hold a RCU read lock to deal with cmpxchg ABA problem. This implementati on * hold a RCU read lock to deal with cmpxchg ABA problem. This implementati on
* keeps a dummy head node to ensure we can always update the queue lockles sly. * keeps a dummy head node to ensure we can always update the queue lockles sly.
* Given that this is a queue, the dummy head node must always advance as w e * Given that this is a queue, the dummy head node must always advance as w e
* dequeue entries. Therefore, we keep a reference count on each entry we a re * dequeue entries. Therefore, we keep a reference count on each entry we a re
* dequeueing, so they can be kept as dummy head node until the next dequeu e, at * dequeueing, so they can be kept as dummy head node until the next dequeu e, at
* which point their reference count will be decremented. * which point their reference count will be decremented.
*/ */
struct cds_lfq_queue_rcu;
struct cds_lfq_node_rcu { struct cds_lfq_node_rcu {
struct cds_lfq_node_rcu *next; struct cds_lfq_node_rcu *next;
struct urcu_ref ref; struct urcu_ref ref;
struct cds_lfq_queue_rcu *queue;
struct rcu_head rcu_head;
}; };
struct cds_lfq_queue_rcu { struct cds_lfq_queue_rcu {
struct cds_lfq_node_rcu *head, *tail; struct cds_lfq_node_rcu *head, *tail;
struct cds_lfq_node_rcu init; /* Dummy initialization node */ struct cds_lfq_node_rcu init; /* Dummy initialization node */
void (*release)(struct urcu_ref *ref);
}; };
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu/rculfqueue-static.h> #include <urcu/static/rculfqueue.h>
#define cds_lfq_node_init_rcu _cds_lfq_node_init_rcu #define cds_lfq_node_init_rcu _cds_lfq_node_init_rcu
#define cds_lfq_init_rcu _cds_lfq_init_rcu #define cds_lfq_init_rcu _cds_lfq_init_rcu
#define cds_lfq_enqueue_rcu _cds_lfq_enqueue_rcu #define cds_lfq_enqueue_rcu _cds_lfq_enqueue_rcu
#define cds_lfq_dequeue_rcu _cds_lfq_dequeue_rcu #define cds_lfq_dequeue_rcu _cds_lfq_dequeue_rcu
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
extern void cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node); extern void cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node);
extern void cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q); extern void cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q,
extern void cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, struct cds_lfq void (*release)(struct urcu_ref *ref));
_node_rcu *node);
/*
* Should be called under rcu read lock critical section.
*/
extern void cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q,
struct cds_lfq_node_rcu *node);
/* /*
* The entry returned by dequeue must be taken care of by doing a urcu_ref_ * Should be called under rcu read lock critical section.
put, *
* which calls the release primitive when the reference count drops to zero * The entry returned by dequeue must be taken care of by doing a
. A * sequence of urcu_ref_put which release handler should do a call_rcu.
* grace period must be waited after execution of the release callback befo *
re
* performing the actual memory reclamation or modifying the cds_lfq_node_r
cu
* structure.
* In other words, the entry lfq node returned by dequeue must not be * In other words, the entry lfq node returned by dequeue must not be
* modified/re-used/freed until the reference count reaches zero and a grac e * modified/re-used/freed until the reference count reaches zero and a grac e
* period has elapsed (after the refcount reached 0). * period has elapsed (after the refcount reached 0).
*/ */
extern struct cds_lfq_node_rcu * extern
cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q, void (*release)(struct urc struct cds_lfq_node_rcu *cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q);
u_ref *));
#endif /* !_LGPL_SOURCE */ #endif /* !_LGPL_SOURCE */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _URCU_RCULFQUEUE_H */ #endif /* _URCU_RCULFQUEUE_H */
 End of changes. 9 change blocks. 
18 lines changed or deleted 23 lines changed or added


 rculfstack.h   rculfstack.h 
skipping to change at line 40 skipping to change at line 40
struct cds_lfs_node_rcu { struct cds_lfs_node_rcu {
struct cds_lfs_node_rcu *next; struct cds_lfs_node_rcu *next;
}; };
struct cds_lfs_stack_rcu { struct cds_lfs_stack_rcu {
struct cds_lfs_node_rcu *head; struct cds_lfs_node_rcu *head;
}; };
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu/rculfstack-static.h> #include <urcu/static/rculfstack.h>
#define cds_lfs_node_init_rcu _cds_lfs_node_init_rcu #define cds_lfs_node_init_rcu _cds_lfs_node_init_rcu
#define cds_lfs_init_rcu _cds_lfs_init_rcu #define cds_lfs_init_rcu _cds_lfs_init_rcu
#define cds_lfs_push_rcu _cds_lfs_push_rcu #define cds_lfs_push_rcu _cds_lfs_push_rcu
#define cds_lfs_pop_rcu _cds_lfs_pop_rcu #define cds_lfs_pop_rcu _cds_lfs_pop_rcu
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node); extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s); extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
extern void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_no de_rcu *node); extern void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_no de_rcu *node);
/* /*
* Should be called under rcu read lock critical section.
*
* The caller must wait for a grace period to pass before freeing the retur ned * The caller must wait for a grace period to pass before freeing the retur ned
* node or modifying the cds_lfs_node_rcu structure. * node or modifying the cds_lfs_node_rcu structure.
* Returns NULL if stack is empty. * Returns NULL if stack is empty.
*/ */
extern struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s ); extern struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s );
#endif /* !_LGPL_SOURCE */ #endif /* !_LGPL_SOURCE */
#ifdef __cplusplus #ifdef __cplusplus
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 uatomic_arch.h   uatomic_arch.h 
#ifndef _URCU_ARCH_UATOMIC_X86_H #warning "urcu/uatomic_arch.h is deprecated. Please include urcu/uatomic.h
#define _URCU_ARCH_UATOMIC_X86_H instead."
#include <urcu/uatomic.h>
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
* Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
* Copyright (c) 2009 Mathieu Desnoyers
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
*
* Permission is hereby granted to use or copy this program
* for any purpose, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted
,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
* Code inspired from libuatomic_ops-1.2, inherited in part from the
* Boehm-Demers-Weiser conservative garbage collector.
*/
#include <urcu/compiler.h>
#include <urcu/system.h>
#define UATOMIC_HAS_ATOMIC_BYTE
#define UATOMIC_HAS_ATOMIC_SHORT
#ifdef __cplusplus
extern "C" {
#endif
/*
* Derived from AO_compare_and_swap() and AO_test_and_set_full().
*/
struct __uatomic_dummy {
unsigned long v[10];
};
#define __hp(x) ((struct __uatomic_dummy *)(x))
#define _uatomic_set(addr, v) CMM_STORE_SHARED(*(addr), (v))
/* cmpxchg */
static inline __attribute__((always_inline))
unsigned long __uatomic_cmpxchg(void *addr, unsigned long old,
unsigned long _new, int len)
{
switch (len) {
case 1:
{
unsigned char result = old;
__asm__ __volatile__(
"lock; cmpxchgb %2, %1"
: "+a"(result), "+m"(*__hp(addr))
: "q"((unsigned char)_new)
: "memory");
return result;
}
case 2:
{
unsigned short result = old;
__asm__ __volatile__(
"lock; cmpxchgw %2, %1"
: "+a"(result), "+m"(*__hp(addr))
: "r"((unsigned short)_new)
: "memory");
return result;
}
case 4:
{
unsigned int result = old;
__asm__ __volatile__(
"lock; cmpxchgl %2, %1"
: "+a"(result), "+m"(*__hp(addr))
: "r"((unsigned int)_new)
: "memory");
return result;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
unsigned long result = old;
__asm__ __volatile__(
"lock; cmpxchgq %2, %1"
: "+a"(result), "+m"(*__hp(addr))
: "r"((unsigned long)_new)
: "memory");
return result;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return 0;
}
#define _uatomic_cmpxchg(addr, old, _new)
\
((__typeof__(*(addr))) __uatomic_cmpxchg((addr), (unsigned long)(old
),\
(unsigned long)(_new),
\
sizeof(*(addr))))
/* xchg */
static inline __attribute__((always_inline))
unsigned long __uatomic_exchange(void *addr, unsigned long val, int len)
{
/* Note: the "xchg" instruction does not need a "lock" prefix. */
switch (len) {
case 1:
{
unsigned char result;
__asm__ __volatile__(
"xchgb %0, %1"
: "=q"(result), "+m"(*__hp(addr))
: "0" ((unsigned char)val)
: "memory");
return result;
}
case 2:
{
unsigned short result;
__asm__ __volatile__(
"xchgw %0, %1"
: "=r"(result), "+m"(*__hp(addr))
: "0" ((unsigned short)val)
: "memory");
return result;
}
case 4:
{
unsigned int result;
__asm__ __volatile__(
"xchgl %0, %1"
: "=r"(result), "+m"(*__hp(addr))
: "0" ((unsigned int)val)
: "memory");
return result;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
unsigned long result;
__asm__ __volatile__(
"xchgq %0, %1"
: "=r"(result), "+m"(*__hp(addr))
: "0" ((unsigned long)val)
: "memory");
return result;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return 0;
}
#define _uatomic_xchg(addr, v)
\
((__typeof__(*(addr))) __uatomic_exchange((addr), (unsigned long)(v)
, \
sizeof(*(addr))))
/* uatomic_add_return */
static inline __attribute__((always_inline))
unsigned long __uatomic_add_return(void *addr, unsigned long val,
int len)
{
switch (len) {
case 1:
{
unsigned char result = val;
__asm__ __volatile__(
"lock; xaddb %1, %0"
: "+m"(*__hp(addr)), "+q" (result)
:
: "memory");
return result + (unsigned char)val;
}
case 2:
{
unsigned short result = val;
__asm__ __volatile__(
"lock; xaddw %1, %0"
: "+m"(*__hp(addr)), "+r" (result)
:
: "memory");
return result + (unsigned short)val;
}
case 4:
{
unsigned int result = val;
__asm__ __volatile__(
"lock; xaddl %1, %0"
: "+m"(*__hp(addr)), "+r" (result)
:
: "memory");
return result + (unsigned int)val;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
unsigned long result = val;
__asm__ __volatile__(
"lock; xaddq %1, %0"
: "+m"(*__hp(addr)), "+r" (result)
:
: "memory");
return result + (unsigned long)val;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return 0;
}
#define _uatomic_add_return(addr, v) \
((__typeof__(*(addr))) __uatomic_add_return((addr), \
(unsigned long)(v), \
sizeof(*(addr))))
/* uatomic_add */
static inline __attribute__((always_inline))
void __uatomic_add(void *addr, unsigned long val, int len)
{
switch (len) {
case 1:
{
__asm__ __volatile__(
"lock; addb %1, %0"
: "=m"(*__hp(addr))
: "iq" ((unsigned char)val)
: "memory");
return;
}
case 2:
{
__asm__ __volatile__(
"lock; addw %1, %0"
: "=m"(*__hp(addr))
: "ir" ((unsigned short)val)
: "memory");
return;
}
case 4:
{
__asm__ __volatile__(
"lock; addl %1, %0"
: "=m"(*__hp(addr))
: "ir" ((unsigned int)val)
: "memory");
return;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
"lock; addq %1, %0"
: "=m"(*__hp(addr))
: "er" ((unsigned long)val)
: "memory");
return;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return;
}
#define _uatomic_add(addr, v) \
(__uatomic_add((addr), (unsigned long)(v), sizeof(*(addr))))
/* uatomic_inc */
static inline __attribute__((always_inline))
void __uatomic_inc(void *addr, int len)
{
switch (len) {
case 1:
{
__asm__ __volatile__(
"lock; incb %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
case 2:
{
__asm__ __volatile__(
"lock; incw %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
case 4:
{
__asm__ __volatile__(
"lock; incl %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
"lock; incq %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return;
}
#define _uatomic_inc(addr) (__uatomic_inc((addr), sizeof(*(addr))))
/* uatomic_dec */
static inline __attribute__((always_inline))
void __uatomic_dec(void *addr, int len)
{
switch (len) {
case 1:
{
__asm__ __volatile__(
"lock; decb %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
case 2:
{
__asm__ __volatile__(
"lock; decw %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
case 4:
{
__asm__ __volatile__(
"lock; decl %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
#if (CAA_BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
"lock; decq %0"
: "=m"(*__hp(addr))
:
: "memory");
return;
}
#endif
}
/* generate an illegal instruction. Cannot catch this with linker tr
icks
* when optimizations are disabled. */
__asm__ __volatile__("ud2");
return;
}
#define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr))))
#if ((CAA_BITS_PER_LONG != 64) && defined(CONFIG_RCU_COMPAT_ARCH))
extern int __rcu_cas_avail;
extern int __rcu_cas_init(void);
#define UATOMIC_COMPAT(insn)
\
((likely(__rcu_cas_avail > 0))
\
? (_uatomic_##insn)
\
: ((unlikely(__rcu_cas_avail < 0)
\
? ((__rcu_cas_init() > 0)
\
? (_uatomic_##insn)
\
: (compat_uatomic_##insn))
\
: (compat_uatomic_##insn))))
extern unsigned long _compat_uatomic_set(void *addr,
unsigned long _new, int len);
#define compat_uatomic_set(addr, _new)
\
((__typeof__(*(addr))) _compat_uatomic_set((addr),
\
(unsigned long)(_new),
\
sizeof(*(addr))))
extern unsigned long _compat_uatomic_xchg(void *addr,
unsigned long _new, int len);
#define compat_uatomic_xchg(addr, _new)
\
((__typeof__(*(addr))) _compat_uatomic_xchg((addr),
\
(unsigned long)(_new),
\
sizeof(*(addr))))
extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old,
unsigned long _new, int len);
#define compat_uatomic_cmpxchg(addr, old, _new)
\
((__typeof__(*(addr))) _compat_uatomic_cmpxchg((addr),
\
(unsigned long)(old),
\
(unsigned long)(_new),
\
sizeof(*(addr))))
extern unsigned long _compat_uatomic_xchg(void *addr,
unsigned long _new, int len);
#define compat_uatomic_add_return(addr, v)
\
((__typeof__(*(addr))) _compat_uatomic_add_return((addr),
\
(unsigned long)(v),
\
sizeof(*(addr))))
#define compat_uatomic_add(addr, v)
\
((void)compat_uatomic_add_return((addr), (v)))
#define compat_uatomic_inc(addr)
\
(compat_uatomic_add((addr), 1))
#define compat_uatomic_dec(addr)
\
(compat_uatomic_add((addr), -1))
#else
#define UATOMIC_COMPAT(insn) (_uatomic_##insn)
#endif
/* Read is atomic even in compat mode */
#define uatomic_set(addr, v) \
UATOMIC_COMPAT(set(addr, v))
#define uatomic_cmpxchg(addr, old, _new) \
UATOMIC_COMPAT(cmpxchg(addr, old, _new))
#define uatomic_xchg(addr, v) \
UATOMIC_COMPAT(xchg(addr, v))
#define uatomic_add_return(addr, v) \
UATOMIC_COMPAT(add_return(addr, v))
#define uatomic_add(addr, v) UATOMIC_COMPAT(add(addr, v))
#define uatomic_inc(addr) UATOMIC_COMPAT(inc(addr))
#define uatomic_dec(addr) UATOMIC_COMPAT(dec(addr))
#ifdef __cplusplus
}
#endif
#include <urcu/uatomic_generic.h>
#endif /* _URCU_ARCH_UATOMIC_X86_H */
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added


 urcu-bp.h   urcu-bp.h 
skipping to change at line 41 skipping to change at line 41
* 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
* *
* IBM's contributions to this file may be relicensed under LGPLv2 or later . * IBM's contributions to this file may be relicensed under LGPLv2 or later .
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
/* /*
* See urcu-pointer.h and urcu-pointer-static.h for pointer publication hea * See urcu-pointer.h and urcu/static/urcu-pointer.h for pointer
ders. * publication headers.
*/ */
#include <urcu-pointer.h> #include <urcu-pointer.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <urcu/map/urcu-bp.h>
/* /*
* Important ! * Important !
* *
* Each thread containing read-side critical sections must be registered * Each thread containing read-side critical sections must be registered
* with rcu_register_thread() before calling rcu_read_lock(). * with rcu_register_thread() before calling rcu_read_lock().
* rcu_unregister_thread() should be called before the thread exits. * rcu_unregister_thread() should be called before the thread exits.
*/ */
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu-bp-static.h> #include <urcu/static/urcu-bp.h>
/* /*
* Mappings for static use of the userspace RCU library. * Mappings for static use of the userspace RCU library.
* Should only be used in LGPL-compatible code. * Should only be used in LGPL-compatible code.
*/ */
/* /*
* rcu_read_lock() * rcu_read_lock()
* rcu_read_unlock() * rcu_read_unlock()
* *
* Mark the beginning and end of a read-side critical section. * Mark the beginning and end of a read-side critical section.
*/ */
#define rcu_read_lock() _rcu_read_lock() #define rcu_read_lock_bp _rcu_read_lock
#define rcu_read_unlock() _rcu_read_unlock() #define rcu_read_unlock_bp _rcu_read_unlock
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
/* /*
* library wrappers to be used by non-LGPL compatible source code. * library wrappers to be used by non-LGPL compatible source code.
* See LGPL-only urcu-pointer-static.h for documentation. * See LGPL-only urcu/static/urcu-pointer.h for documentation.
*/ */
extern void rcu_read_lock(void); extern void rcu_read_lock(void);
extern void rcu_read_unlock(void); extern void rcu_read_unlock(void);
#endif /* !_LGPL_SOURCE */ #endif /* !_LGPL_SOURCE */
extern void synchronize_rcu(void); extern void synchronize_rcu(void);
/* /*
skipping to change at line 118 skipping to change at line 121
} }
static inline void rcu_init(void) static inline void rcu_init(void)
{ {
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu-call-rcu.h>
#include <urcu-defer.h>
#endif /* _URCU_BP_H */ #endif /* _URCU_BP_H */
 End of changes. 6 change blocks. 
6 lines changed or deleted 11 lines changed or added


 urcu-defer.h   urcu-defer.h 
skipping to change at line 56 skipping to change at line 56
* rcu_defer_register_thread(). rcu_defer_unregister_thread() should be * rcu_defer_register_thread(). rcu_defer_unregister_thread() should be
* called before the thread exits. * called before the thread exits.
* *
* *NEVER* use defer_rcu() within a RCU read-side critical section, because this * *NEVER* use defer_rcu() within a RCU read-side critical section, because this
* primitive need to call synchronize_rcu() if the thread queue is full. * primitive need to call synchronize_rcu() if the thread queue is full.
*/ */
extern void defer_rcu(void (*fct)(void *p), void *p); extern void defer_rcu(void (*fct)(void *p), void *p);
/* /*
* call_rcu will eventually be implemented with an API similar to the Linux
* kernel call_rcu(), which will allow its use within RCU read-side C.S.
* Generate an error if used for now.
*/
#define call_rcu __error_call_rcu_not_implemented_please_use_defer_rc
u
/*
* Thread registration for reclamation. * Thread registration for reclamation.
*/ */
extern int rcu_defer_register_thread(void); extern int rcu_defer_register_thread(void);
extern void rcu_defer_unregister_thread(void); extern void rcu_defer_unregister_thread(void);
extern void rcu_defer_barrier(void); extern void rcu_defer_barrier(void);
extern void rcu_defer_barrier_thread(void); extern void rcu_defer_barrier_thread(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 1 change blocks. 
9 lines changed or deleted 0 lines changed or added


 urcu-futex.h   urcu-futex.h 
#ifndef _URCU_FUTEX_H #warning "urcu/urcu-futex.h is deprecated. Please include urcu/futex.h inst
#define _URCU_FUTEX_H ead."
#include <urcu/futex.h>
/*
* urcu-futex.h
*
* Userspace RCU - sys_futex/compat_futex header.
*
* 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.
*
* 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
*/
#include <urcu/config.h>
#ifdef __cplusplus
extern "C" {
#endif
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
/*
* sys_futex compatibility header.
* Use *only* *either of* futex_noasync OR futex_async on a given address.
*
* futex_noasync cannot be executed in signal handlers, but ensures that
* it will be put in a wait queue even in compatibility mode.
*
* futex_async is signal-handler safe for the wakeup. It uses polling
* on the wait-side in compatibility mode.
*/
#ifdef CONFIG_RCU_HAVE_FUTEX
#include <sys/syscall.h>
#define futex(...) syscall(__NR_futex, __VA_ARGS__)
#define futex_noasync(uaddr, op, val, timeout, uaddr2, val3) \
futex(uaddr, op, val, timeout, uaddr2, val3)
#define futex_async(uaddr, op, val, timeout, uaddr2, val3) \
futex(uaddr, op, val, timeout, uaddr2, val3)
#else
extern int compat_futex_noasync(int *uaddr, int op, int val,
const struct timespec *timeout, int *uaddr2, int val3);
#define futex_noasync(uaddr, op, val, timeout, uaddr2, val3) \
compat_futex_noasync(uaddr, op, val, timeout, uaddr2, val3)
extern int compat_futex_async(int *uaddr, int op, int val,
const struct timespec *timeout, int *uaddr2, int val3);
#define futex_async(uaddr, op, val, timeout, uaddr2, val3) \
compat_futex_async(uaddr, op, val, timeout, uaddr2, val3)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _URCU_FUTEX_H */
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added


 urcu-pointer.h   urcu-pointer.h 
skipping to change at line 31 skipping to change at line 31
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* 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
* *
* IBM's contributions to this file may be relicensed under LGPLv2 or later . * IBM's contributions to this file may be relicensed under LGPLv2 or later .
*/ */
#include <urcu/compiler.h> #include <urcu/compiler.h>
#include <urcu/arch.h> #include <urcu/arch.h>
#include <urcu/uatomic_arch.h> #include <urcu/uatomic.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu-pointer-static.h> #include <urcu/static/urcu-pointer.h>
/* /*
* 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
/* /*
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 urcu-qsbr.h   urcu-qsbr.h 
skipping to change at line 35 skipping to change at line 35
* 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
* *
* IBM's contributions to this file may be relicensed under LGPLv2 or later . * IBM's contributions to this file may be relicensed under LGPLv2 or later .
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
/* /*
* See urcu-pointer.h and urcu-pointer-static.h for pointer publication hea * See urcu-pointer.h and urcu/static/urcu-pointer.h for pointer
ders. * publication headers.
*/ */
#include <urcu-pointer.h> #include <urcu-pointer.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <urcu/map/urcu-qsbr.h>
/* /*
* Important ! * Important !
* *
* Each thread containing read-side critical sections must be registered * Each thread containing read-side critical sections must be registered
* with rcu_register_thread() before calling rcu_read_lock(). * with rcu_register_thread() before calling rcu_read_lock().
* rcu_unregister_thread() should be called before the thread exits. * rcu_unregister_thread() should be called before the thread exits.
*/ */
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu-qsbr-static.h> #include <urcu/static/urcu-qsbr.h>
/* /*
* Mappings for static use of the userspace RCU library. * Mappings for static use of the userspace RCU library.
* Should only be used in LGPL-compatible code. * Should only be used in LGPL-compatible code.
*/ */
/* /*
* rcu_read_lock() * rcu_read_lock()
* rcu_read_unlock() * rcu_read_unlock()
* *
* Mark the beginning and end of a read-side critical section. * Mark the beginning and end of a read-side critical section.
* DON'T FORGET TO USE rcu_register_thread/rcu_unregister_thread() FOR EACH * DON'T FORGET TO USE rcu_register_thread/rcu_unregister_thread()
* THREAD WITH READ-SIDE CRITICAL SECTION. * FOR EACH THREAD WITH READ-SIDE CRITICAL SECTION.
*/ */
#define rcu_read_lock() _rcu_read_lock() #define rcu_read_lock_qsbr _rcu_read_lock
#define rcu_read_unlock() _rcu_read_unlock() #define rcu_read_unlock_qsbr _rcu_read_unlock
#define rcu_quiescent_state() _rcu_quiescent_state() #define rcu_quiescent_state_qsbr _rcu_quiescent_state
#define rcu_thread_offline() _rcu_thread_offline() #define rcu_thread_offline_qsbr _rcu_thread_offline
#define rcu_thread_online() _rcu_thread_online() #define rcu_thread_online_qsbr _rcu_thread_online
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
/* /*
* library wrappers to be used by non-LGPL compatible source code. * library wrappers to be used by non-LGPL compatible source code.
*/ */
/* /*
* QSBR read lock/unlock are guaranteed to be no-ops. Therefore, we expose them * QSBR read lock/unlock are guaranteed to be no-ops. Therefore, we expose them
* in the LGPL header for any code to use. However, the debug version is no t * in the LGPL header for any code to use. However, the debug version is no t
skipping to change at line 96 skipping to change at line 99
* best trade-off between license/performance/code triviality and * best trade-off between license/performance/code triviality and
* library debugging & tracing features we could come up with. * library debugging & tracing features we could come up with.
*/ */
#if (!defined(BUILD_QSBR_LIB) && defined(RCU_DEBUG)) #if (!defined(BUILD_QSBR_LIB) && defined(RCU_DEBUG))
static inline void rcu_read_lock(void) static inline void rcu_read_lock(void)
{ {
} }
static inline void rcu_read_lock(void) static inline void rcu_read_unlock(void)
{ {
} }
#else /* !RCU_DEBUG */ #else /* !RCU_DEBUG */
extern void rcu_read_lock(void); extern void rcu_read_lock(void);
extern void rcu_read_unlock(void); extern void rcu_read_unlock(void);
#endif /* !RCU_DEBUG */ #endif /* !RCU_DEBUG */
skipping to change at line 125 skipping to change at line 128
/* /*
* Reader thread registration. * Reader thread registration.
*/ */
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-defer.h>
#endif /* _URCU_QSBR_H */ #endif /* _URCU_QSBR_H */
 End of changes. 8 change blocks. 
11 lines changed or deleted 16 lines changed or added


 urcu.h   urcu.h 
skipping to change at line 38 skipping to change at line 38
* 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
* *
* IBM's contributions to this file may be relicensed under LGPLv2 or later . * IBM's contributions to this file may be relicensed under LGPLv2 or later .
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
/* /*
* See urcu-pointer.h and urcu-pointer-static.h for pointer publication hea * See urcu-pointer.h and urcu/static/urcu-pointer.h for pointer
ders. * publication headers.
*/ */
#include <urcu-pointer.h> #include <urcu-pointer.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <urcu/map/urcu.h>
/* /*
* Important ! * Important !
* *
* Each thread containing read-side critical sections must be registered * Each thread containing read-side critical sections must be registered
* with rcu_register_thread() before calling rcu_read_lock(). * with rcu_register_thread_mb() before calling rcu_read_lock_mb().
* rcu_unregister_thread() should be called before the thread exits. * rcu_unregister_thread_mb() should be called before the thread exits.
*/ */
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu-static.h> #include <urcu/static/urcu.h>
/* /*
* Mappings for static use of the userspace RCU library. * Mappings for static use of the userspace RCU library.
* Should only be used in LGPL-compatible code. * Should only be used in LGPL-compatible code.
*/ */
/* /*
* rcu_read_lock() * rcu_read_lock()
* rcu_read_unlock() * rcu_read_unlock()
* *
* Mark the beginning and end of a read-side critical section. * Mark the beginning and end of a read-side critical section.
* DON'T FORGET TO USE RCU_REGISTER/UNREGISTER_THREAD() FOR EACH THREAD WIT H * DON'T FORGET TO USE RCU_REGISTER/UNREGISTER_THREAD() FOR EACH THREAD WIT H
* READ-SIDE CRITICAL SECTION. * READ-SIDE CRITICAL SECTION.
*/ */
#define rcu_read_lock() _rcu_read_lock() #ifdef RCU_MEMBARRIER
#define rcu_read_unlock() _rcu_read_unlock() #define rcu_read_lock_memb _rcu_read_lock
#define rcu_read_unlock_memb _rcu_read_unlock
#elif defined(RCU_SIGNAL)
#define rcu_read_lock_sig _rcu_read_lock
#define rcu_read_unlock_sig _rcu_read_unlock
#elif defined(RCU_MB)
#define rcu_read_lock_mb _rcu_read_lock
#define rcu_read_unlock_mb _rcu_read_unlock
#endif
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
/* /*
* library wrappers to be used by non-LGPL compatible source code. * library wrappers to be used by non-LGPL compatible source code.
* See LGPL-only urcu-pointer-static.h for documentation. * See LGPL-only urcu/static/urcu-pointer.h for documentation.
*/ */
extern void rcu_read_lock(void); extern void rcu_read_lock(void);
extern void rcu_read_unlock(void); extern void rcu_read_unlock(void);
#endif /* !_LGPL_SOURCE */ #endif /* !_LGPL_SOURCE */
extern void synchronize_rcu(void); extern void synchronize_rcu(void);
/* /*
skipping to change at line 103 skipping to change at line 114
/* /*
* Explicit rcu initialization, for "early" use within library constructors . * Explicit rcu initialization, for "early" use within library constructors .
*/ */
extern void rcu_init(void); extern void rcu_init(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <urcu-call-rcu.h>
#include <urcu-defer.h>
#endif /* _URCU_H */ #endif /* _URCU_H */
 End of changes. 7 change blocks. 
8 lines changed or deleted 21 lines changed or added


 urcu_ref.h   urcu_ref.h 
#ifndef _URCU_REF_H #warning "urcu/urcu_ref.h is deprecated. Please include urcu/ref.h instead.
#define _URCU_REF_H "
#include <urcu/ref.h>
/*
* Userspace RCU - Reference counting
*
* Copyright (C) 2009 Novell Inc.
* Copyright (C) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* Author: Jan Blunck <jblunck@suse.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 2.1 as
* published by the Free Software Foundation.
*/
#include <assert.h>
#include <urcu/uatomic_arch.h>
struct urcu_ref {
long refcount; /* ATOMIC */
};
static inline void urcu_ref_set(struct urcu_ref *ref, long val)
{
uatomic_set(&ref->refcount, val);
}
static inline void urcu_ref_init(struct urcu_ref *ref)
{
urcu_ref_set(ref, 1);
}
static inline void urcu_ref_get(struct urcu_ref *ref)
{
long res = uatomic_add_return(&ref->refcount, 1);
assert(res != 0);
}
static inline void urcu_ref_put(struct urcu_ref *ref,
void (*release)(struct urcu_ref *))
{
if (!uatomic_sub_return(&ref->refcount, 1))
release(ref);
}
#endif /* _URCU_REF_H */
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added


 wfqueue.h   wfqueue.h 
skipping to change at line 55 skipping to change at line 55
}; };
struct cds_wfq_queue { struct cds_wfq_queue {
struct cds_wfq_node *head, **tail; struct cds_wfq_node *head, **tail;
struct cds_wfq_node dummy; /* Dummy node */ struct cds_wfq_node dummy; /* Dummy node */
pthread_mutex_t lock; pthread_mutex_t lock;
}; };
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu/wfqueue-static.h> #include <urcu/static/wfqueue.h>
#define cds_wfq_node_init _cds_wfq_node_init #define cds_wfq_node_init _cds_wfq_node_init
#define cds_wfq_init _cds_wfq_init #define cds_wfq_init _cds_wfq_init
#define cds_wfq_enqueue _cds_wfq_enqueue #define cds_wfq_enqueue _cds_wfq_enqueue
#define __cds_wfq_dequeue_blocking ___cds_wfq_dequeue_blocking #define __cds_wfq_dequeue_blocking ___cds_wfq_dequeue_blocking
#define cds_wfq_dequeue_blocking _cds_wfq_dequeue_blocking #define cds_wfq_dequeue_blocking _cds_wfq_dequeue_blocking
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
extern void cds_wfq_node_init(struct cds_wfq_node *node); extern void cds_wfq_node_init(struct cds_wfq_node *node);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 wfstack.h   wfstack.h 
skipping to change at line 45 skipping to change at line 45
struct cds_wfs_node *next; struct cds_wfs_node *next;
}; };
struct cds_wfs_stack { struct cds_wfs_stack {
struct cds_wfs_node *head; struct cds_wfs_node *head;
pthread_mutex_t lock; pthread_mutex_t lock;
}; };
#ifdef _LGPL_SOURCE #ifdef _LGPL_SOURCE
#include <urcu/wfstack-static.h> #include <urcu/static/wfstack.h>
#define cds_wfs_node_init _cds_wfs_node_init #define cds_wfs_node_init _cds_wfs_node_init
#define cds_wfs_init _cds_wfs_init #define cds_wfs_init _cds_wfs_init
#define cds_wfs_push _cds_wfs_push #define cds_wfs_push _cds_wfs_push
#define __cds_wfs_pop_blocking ___cds_wfs_pop_blocking #define __cds_wfs_pop_blocking ___cds_wfs_pop_blocking
#define cds_wfs_pop_blocking _cds_wfs_pop_blocking #define cds_wfs_pop_blocking _cds_wfs_pop_blocking
#else /* !_LGPL_SOURCE */ #else /* !_LGPL_SOURCE */
extern void cds_wfs_node_init(struct cds_wfs_node *node); extern void cds_wfs_node_init(struct cds_wfs_node *node);
 End of changes. 1 change blocks. 
1 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/