]>
Commit | Line | Data |
---|---|---|
bd3239d2 MF |
1 | int test_bit(int nr, const void *addr) |
2 | { | |
3 | int *a; | |
4 | int mask; | |
5 | int nr_5; | |
6 | int nr_1f; | |
7 | a = (int *)addr; | |
8 | nr_5 = nr >> 5; | |
9 | a += nr_5; | |
10 | nr_1f = nr & 0x1f; | |
11 | mask = 1 << nr_1f; | |
12 | if (mask & *a) | |
13 | return 1; | |
14 | else | |
15 | return 0; | |
16 | } | |
17 | ||
18 | struct { | |
19 | struct { int disabled; } *data[1]; | |
20 | } global_trace; | |
21 | ||
22 | struct { | |
23 | unsigned long bits[1]; | |
24 | } tracing_cpumask; | |
25 | ||
26 | foo() | |
27 | { | |
28 | int cpu; | |
29 | for (cpu = 0; cpu < 1; cpu++) { | |
30 | if (test_bit(cpu, tracing_cpumask.bits)) | |
31 | inc(&global_trace.data[cpu]->disabled); | |
32 | if (!test_bit(cpu, tracing_cpumask.bits)) | |
33 | dec(&global_trace.data[cpu]->disabled); | |
34 | } | |
35 | } |