This source file includes following definitions.
- set_bit
- __set_bit
- clear_bit
- __clear_bit
- clear_bit_unlock
- __clear_bit_unlock
- change_bit
- __change_bit
- test_and_set_bit
- __test_and_set_bit
- test_and_set_bit_lock
- test_and_clear_bit
- __test_and_clear_bit
- test_and_change_bit
- __test_and_change_bit
- test_bit
- clear_bit_unlock_is_negative_byte
1
2
3
4
5
6
7
8
9
10
11 #ifndef _ASM_GENERIC_BITOPS_INSTRUMENTED_H
12 #define _ASM_GENERIC_BITOPS_INSTRUMENTED_H
13
14 #include <linux/kasan-checks.h>
15
16
17
18
19
20
21
22
23
24
25
26 static inline void set_bit(long nr, volatile unsigned long *addr)
27 {
28 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
29 arch_set_bit(nr, addr);
30 }
31
32
33
34
35
36
37
38
39
40
41 static inline void __set_bit(long nr, volatile unsigned long *addr)
42 {
43 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
44 arch___set_bit(nr, addr);
45 }
46
47
48
49
50
51
52
53
54 static inline void clear_bit(long nr, volatile unsigned long *addr)
55 {
56 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
57 arch_clear_bit(nr, addr);
58 }
59
60
61
62
63
64
65
66
67
68
69 static inline void __clear_bit(long nr, volatile unsigned long *addr)
70 {
71 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
72 arch___clear_bit(nr, addr);
73 }
74
75
76
77
78
79
80
81
82 static inline void clear_bit_unlock(long nr, volatile unsigned long *addr)
83 {
84 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
85 arch_clear_bit_unlock(nr, addr);
86 }
87
88
89
90
91
92
93
94
95
96
97 static inline void __clear_bit_unlock(long nr, volatile unsigned long *addr)
98 {
99 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
100 arch___clear_bit_unlock(nr, addr);
101 }
102
103
104
105
106
107
108
109
110
111
112
113 static inline void change_bit(long nr, volatile unsigned long *addr)
114 {
115 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
116 arch_change_bit(nr, addr);
117 }
118
119
120
121
122
123
124
125
126
127
128 static inline void __change_bit(long nr, volatile unsigned long *addr)
129 {
130 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
131 arch___change_bit(nr, addr);
132 }
133
134
135
136
137
138
139
140
141 static inline bool test_and_set_bit(long nr, volatile unsigned long *addr)
142 {
143 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
144 return arch_test_and_set_bit(nr, addr);
145 }
146
147
148
149
150
151
152
153
154
155 static inline bool __test_and_set_bit(long nr, volatile unsigned long *addr)
156 {
157 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
158 return arch___test_and_set_bit(nr, addr);
159 }
160
161
162
163
164
165
166
167
168
169
170 static inline bool test_and_set_bit_lock(long nr, volatile unsigned long *addr)
171 {
172 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
173 return arch_test_and_set_bit_lock(nr, addr);
174 }
175
176
177
178
179
180
181
182
183 static inline bool test_and_clear_bit(long nr, volatile unsigned long *addr)
184 {
185 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
186 return arch_test_and_clear_bit(nr, addr);
187 }
188
189
190
191
192
193
194
195
196
197 static inline bool __test_and_clear_bit(long nr, volatile unsigned long *addr)
198 {
199 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
200 return arch___test_and_clear_bit(nr, addr);
201 }
202
203
204
205
206
207
208
209
210 static inline bool test_and_change_bit(long nr, volatile unsigned long *addr)
211 {
212 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
213 return arch_test_and_change_bit(nr, addr);
214 }
215
216
217
218
219
220
221
222
223
224 static inline bool __test_and_change_bit(long nr, volatile unsigned long *addr)
225 {
226 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
227 return arch___test_and_change_bit(nr, addr);
228 }
229
230
231
232
233
234
235 static inline bool test_bit(long nr, const volatile unsigned long *addr)
236 {
237 kasan_check_read(addr + BIT_WORD(nr), sizeof(long));
238 return arch_test_bit(nr, addr);
239 }
240
241 #if defined(arch_clear_bit_unlock_is_negative_byte)
242
243
244
245
246
247
248
249
250
251
252
253 static inline bool
254 clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
255 {
256 kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
257 return arch_clear_bit_unlock_is_negative_byte(nr, addr);
258 }
259
260 #define clear_bit_unlock_is_negative_byte clear_bit_unlock_is_negative_byte
261 #endif
262
263 #endif