This source file includes following definitions.
- cvmx_coremask_is_core_set
- cvmx_coremask_copy
- cvmx_coremask_set64
- cvmx_coremask_clear_core
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef __CVMX_COREMASK_H__
30 #define __CVMX_COREMASK_H__
31
32 #define CVMX_MIPS_MAX_CORES 1024
33
34 #define CVMX_COREMASK_ELTSZ 64
35
36
37 #define CVMX_COREMASK_BMPSZ (CVMX_MIPS_MAX_CORES / CVMX_COREMASK_ELTSZ)
38
39
40
41 struct cvmx_coremask {
42 u64 coremask_bitmap[CVMX_COREMASK_BMPSZ];
43 };
44
45
46
47
48 static inline bool cvmx_coremask_is_core_set(const struct cvmx_coremask *pcm,
49 int core)
50 {
51 int n, i;
52
53 n = core % CVMX_COREMASK_ELTSZ;
54 i = core / CVMX_COREMASK_ELTSZ;
55
56 return (pcm->coremask_bitmap[i] & ((u64)1 << n)) != 0;
57 }
58
59
60
61
62 static inline void cvmx_coremask_copy(struct cvmx_coremask *dest,
63 const struct cvmx_coremask *src)
64 {
65 memcpy(dest, src, sizeof(*dest));
66 }
67
68
69
70
71 static inline void cvmx_coremask_set64(struct cvmx_coremask *pcm,
72 uint64_t coremask_64)
73 {
74 pcm->coremask_bitmap[0] = coremask_64;
75 }
76
77
78
79
80 static inline void cvmx_coremask_clear_core(struct cvmx_coremask *pcm, int core)
81 {
82 int n, i;
83
84 n = core % CVMX_COREMASK_ELTSZ;
85 i = core / CVMX_COREMASK_ELTSZ;
86 pcm->coremask_bitmap[i] &= ~(1ull << n);
87 }
88
89 #endif