Root/
1 | /* |
2 | * Read-Copy Update definitions shared among RCU implementations. |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or |
7 | * (at your option) any later version. |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | * |
18 | * Copyright IBM Corporation, 2011 |
19 | * |
20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
21 | */ |
22 | |
23 | #ifndef __LINUX_RCU_H |
24 | #define __LINUX_RCU_H |
25 | |
26 | #ifdef CONFIG_RCU_TRACE |
27 | #define RCU_TRACE(stmt) stmt |
28 | #else /* #ifdef CONFIG_RCU_TRACE */ |
29 | #define RCU_TRACE(stmt) |
30 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ |
31 | |
32 | /* |
33 | * Process-level increment to ->dynticks_nesting field. This allows for |
34 | * architectures that use half-interrupts and half-exceptions from |
35 | * process context. |
36 | */ |
37 | #define DYNTICK_TASK_NESTING (LLONG_MAX / 2 - 1) |
38 | |
39 | /* |
40 | * debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally |
41 | * by call_rcu() and rcu callback execution, and are therefore not part of the |
42 | * RCU API. Leaving in rcupdate.h because they are used by all RCU flavors. |
43 | */ |
44 | |
45 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD |
46 | # define STATE_RCU_HEAD_READY 0 |
47 | # define STATE_RCU_HEAD_QUEUED 1 |
48 | |
49 | extern struct debug_obj_descr rcuhead_debug_descr; |
50 | |
51 | static inline void debug_rcu_head_queue(struct rcu_head *head) |
52 | { |
53 | WARN_ON_ONCE((unsigned long)head & 0x3); |
54 | debug_object_activate(head, &rcuhead_debug_descr); |
55 | debug_object_active_state(head, &rcuhead_debug_descr, |
56 | STATE_RCU_HEAD_READY, |
57 | STATE_RCU_HEAD_QUEUED); |
58 | } |
59 | |
60 | static inline void debug_rcu_head_unqueue(struct rcu_head *head) |
61 | { |
62 | debug_object_active_state(head, &rcuhead_debug_descr, |
63 | STATE_RCU_HEAD_QUEUED, |
64 | STATE_RCU_HEAD_READY); |
65 | debug_object_deactivate(head, &rcuhead_debug_descr); |
66 | } |
67 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
68 | static inline void debug_rcu_head_queue(struct rcu_head *head) |
69 | { |
70 | } |
71 | |
72 | static inline void debug_rcu_head_unqueue(struct rcu_head *head) |
73 | { |
74 | } |
75 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
76 | |
77 | extern void kfree(const void *); |
78 | |
79 | static inline void __rcu_reclaim(char *rn, struct rcu_head *head) |
80 | { |
81 | unsigned long offset = (unsigned long)head->func; |
82 | |
83 | if (__is_kfree_rcu_offset(offset)) { |
84 | RCU_TRACE(trace_rcu_invoke_kfree_callback(rn, head, offset)); |
85 | kfree((void *)head - offset); |
86 | } else { |
87 | RCU_TRACE(trace_rcu_invoke_callback(rn, head)); |
88 | head->func(head); |
89 | } |
90 | } |
91 | |
92 | #endif /* __LINUX_RCU_H */ |
93 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9