uatomic/x86: Remove redundant memory barriers
[urcu.git] / include / urcu / flavor.h
1 // SPDX-FileCopyrightText: 2011 Lai Jiangshan <laijs@cn.fujitsu.com>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4
5 #ifndef _URCU_FLAVOR_H
6 #define _URCU_FLAVOR_H
7
8 /*
9 * Userspace RCU header - rcu flavor declarations
10 */
11
12 #include <urcu/urcu-poll.h>
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 struct rcu_head;
19
20 struct urcu_atfork {
21 void (*before_fork)(void *priv);
22 void (*after_fork_parent)(void *priv);
23 void (*after_fork_child)(void *priv);
24 void *priv;
25 };
26
27 void urcu_register_rculfhash_atfork(struct urcu_atfork *atfork);
28 void urcu_unregister_rculfhash_atfork(struct urcu_atfork *atfork);
29
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);
39
40 void (*thread_offline)(void);
41 void (*thread_online)(void);
42 void (*register_thread)(void);
43 void (*unregister_thread)(void);
44
45 void (*barrier)(void);
46
47 void (*register_rculfhash_atfork)(struct urcu_atfork *atfork);
48 void (*unregister_rculfhash_atfork)(struct urcu_atfork *atfork);
49
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);
52 };
53
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,\
72 }
73
74 extern const struct rcu_flavor_struct rcu_flavor;
75
76 #ifdef __cplusplus
77 }
78 #endif
79
80 #endif /* _URCU_FLAVOR_H */
This page took 0.030831 seconds and 5 git commands to generate.