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
30 struct rcu_flavor_struct
{
31 void (*read_lock
)(void);
32 void (*read_unlock
)(void);
33 int (*read_ongoing
)(void);
34 void (*read_quiescent_state
)(void);
35 void (*update_call_rcu
)(struct rcu_head
*head
,
36 void (*func
)(struct rcu_head
*head
));
37 void (*update_synchronize_rcu
)(void);
38 void (*update_defer_rcu
)(void (*fct
)(void *p
), void *p
);
40 void (*thread_offline
)(void);
41 void (*thread_online
)(void);
42 void (*register_thread
)(void);
43 void (*unregister_thread
)(void);
46 #define DEFINE_RCU_FLAVOR(x) \
47 const struct rcu_flavor_struct x = { \
48 .read_lock = rcu_read_lock, \
49 .read_unlock = rcu_read_unlock, \
50 .read_ongoing = rcu_read_ongoing, \
51 .read_quiescent_state = rcu_quiescent_state, \
52 .update_call_rcu = call_rcu, \
53 .update_synchronize_rcu = synchronize_rcu, \
54 .update_defer_rcu = defer_rcu, \
55 .thread_offline = rcu_thread_offline, \
56 .thread_online = rcu_thread_online, \
57 .register_thread = rcu_register_thread, \
58 .unregister_thread = rcu_unregister_thread,\
61 extern const struct rcu_flavor_struct rcu_flavor
;
67 #endif /* _URCU_FLAVOR_H */