This source file includes following definitions.
- has_zero
- prep_zero_mask
- find_zero
1
2 #ifndef _ASM_WORD_AT_A_TIME_H
3 #define _ASM_WORD_AT_A_TIME_H
4
5 #include <asm/compiler.h>
6
7
8
9
10
11
12
13
14
15 struct word_at_a_time {
16 const unsigned long unused;
17 };
18
19 #define WORD_AT_A_TIME_CONSTANTS { 0 }
20
21
22 static inline unsigned long has_zero(unsigned long val, unsigned long *bits, const struct word_at_a_time *c)
23 {
24 unsigned long zero_locations = __kernel_cmpbge(0, val);
25 *bits = zero_locations;
26 return zero_locations;
27 }
28
29 static inline unsigned long prep_zero_mask(unsigned long val, unsigned long bits, const struct word_at_a_time *c)
30 {
31 return bits;
32 }
33
34 #define create_zero_mask(bits) (bits)
35
36 static inline unsigned long find_zero(unsigned long bits)
37 {
38 #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
39
40 return __kernel_cttz(bits);
41 #else
42 unsigned long t1, t2, t3;
43
44 bits &= -bits;
45
46 t1 = bits & 0xf0;
47 t2 = bits & 0xcc;
48 t3 = bits & 0xaa;
49 if (t1) t1 = 4;
50 if (t2) t2 = 2;
51 if (t3) t3 = 1;
52 return t1 + t2 + t3;
53 #endif
54 }
55
56 #define zero_bytemask(mask) ((2ul << (find_zero(mask) * 8)) - 1)
57
58 #endif