1 // SPDX-FileCopyrightText: 2011 Lai Jiangshan <laijs@cn.fujitsu.com>
3 // SPDX-License-Identifier: LGPL-2.1-or-later
9 * Userspace RCU header - rcu flavor declarations
12 #include <urcu/urcu-poll.h>
21 void (*before_fork
)(void *priv
);
22 void (*after_fork_parent
)(void *priv
);
23 void (*after_fork_child
)(void *priv
);
27 void urcu_register_rculfhash_atfork(struct urcu_atfork
*atfork
);
28 void urcu_unregister_rculfhash_atfork(struct urcu_atfork
*atfork
);
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);
45 void (*barrier
)(void);
47 void (*register_rculfhash_atfork
)(struct urcu_atfork
*atfork
);
48 void (*unregister_rculfhash_atfork
)(struct urcu_atfork
*atfork
);
50 struct urcu_gp_poll_state (*update_start_poll_synchronize_rcu
)(void);
51 bool (*update_poll_state_synchronize_rcu
)(struct urcu_gp_poll_state state
);
54 #define DEFINE_RCU_FLAVOR(x) \
55 const struct rcu_flavor_struct x = { \
56 .read_lock = rcu_read_lock, \
57 .read_unlock = rcu_read_unlock, \
58 .read_ongoing = rcu_read_ongoing, \
59 .read_quiescent_state = rcu_quiescent_state, \
60 .update_call_rcu = call_rcu, \
61 .update_synchronize_rcu = synchronize_rcu, \
62 .update_defer_rcu = defer_rcu, \
63 .thread_offline = rcu_thread_offline, \
64 .thread_online = rcu_thread_online, \
65 .register_thread = rcu_register_thread, \
66 .unregister_thread = rcu_unregister_thread,\
67 .barrier = rcu_barrier, \
68 .register_rculfhash_atfork = urcu_register_rculfhash_atfork, \
69 .unregister_rculfhash_atfork = urcu_unregister_rculfhash_atfork,\
70 .update_start_poll_synchronize_rcu = start_poll_synchronize_rcu,\
71 .update_poll_state_synchronize_rcu = poll_state_synchronize_rcu,\
74 extern const struct rcu_flavor_struct rcu_flavor
;
80 #endif /* _URCU_FLAVOR_H */