7 * Userspace RCU header - rcu flavor declarations
9 * Copyright (c) 2011 Lai Jiangshan <laijs@cn.fujitsu.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <urcu/urcu-poll.h>
35 void (*before_fork
)(void *priv
);
36 void (*after_fork_parent
)(void *priv
);
37 void (*after_fork_child
)(void *priv
);
41 void urcu_register_rculfhash_atfork(struct urcu_atfork
*atfork
);
42 void urcu_unregister_rculfhash_atfork(struct urcu_atfork
*atfork
);
44 struct rcu_flavor_struct
{
45 void (*read_lock
)(void);
46 void (*read_unlock
)(void);
47 int (*read_ongoing
)(void);
48 void (*read_quiescent_state
)(void);
49 void (*update_call_rcu
)(struct rcu_head
*head
,
50 void (*func
)(struct rcu_head
*head
));
51 void (*update_synchronize_rcu
)(void);
52 void (*update_defer_rcu
)(void (*fct
)(void *p
), void *p
);
54 void (*thread_offline
)(void);
55 void (*thread_online
)(void);
56 void (*register_thread
)(void);
57 void (*unregister_thread
)(void);
59 void (*barrier
)(void);
61 void (*register_rculfhash_atfork
)(struct urcu_atfork
*atfork
);
62 void (*unregister_rculfhash_atfork
)(struct urcu_atfork
*atfork
);
64 struct urcu_gp_poll_state (*update_start_poll_synchronize_rcu
)(void);
65 bool (*update_poll_state_synchronize_rcu
)(struct urcu_gp_poll_state state
);
68 #define DEFINE_RCU_FLAVOR(x) \
69 const struct rcu_flavor_struct x = { \
70 .read_lock = rcu_read_lock, \
71 .read_unlock = rcu_read_unlock, \
72 .read_ongoing = rcu_read_ongoing, \
73 .read_quiescent_state = rcu_quiescent_state, \
74 .update_call_rcu = call_rcu, \
75 .update_synchronize_rcu = synchronize_rcu, \
76 .update_defer_rcu = defer_rcu, \
77 .thread_offline = rcu_thread_offline, \
78 .thread_online = rcu_thread_online, \
79 .register_thread = rcu_register_thread, \
80 .unregister_thread = rcu_unregister_thread,\
81 .barrier = rcu_barrier, \
82 .register_rculfhash_atfork = urcu_register_rculfhash_atfork, \
83 .unregister_rculfhash_atfork = urcu_unregister_rculfhash_atfork,\
84 .update_start_poll_synchronize_rcu = start_poll_synchronize_rcu,\
85 .update_poll_state_synchronize_rcu = poll_state_synchronize_rcu,\
88 extern const struct rcu_flavor_struct rcu_flavor
;
94 #endif /* _URCU_FLAVOR_H */