|
26 #ifndef HWLOC_LINUX_LIBNUMA_H
27 #define HWLOC_LINUX_LIBNUMA_H
53 static __hwloc_inline int
55 unsigned long *mask, unsigned long *maxnode)
58 unsigned long outmaxnode = -1;
61 *maxnode = (*maxnode + 8* sizeof(*mask) - 1) & ~(8* sizeof(*mask) - 1);
62 memset(mask, 0, *maxnode/8);
69 mask[node-> os_index/ sizeof(*mask)/8] |= 1UL << (node-> os_index % ( sizeof(*mask)*8));
70 if (outmaxnode == ( unsigned long) -1 || outmaxnode < node->os_index)
82 *maxnode = outmaxnode+1;
96 static __hwloc_inline int
98 unsigned long *mask, unsigned long *maxnode)
101 unsigned long outmaxnode = -1;
104 *maxnode = (*maxnode + 8* sizeof(*mask) - 1) & ~(8* sizeof(*mask) - 1);
105 memset(mask, 0, *maxnode/8);
114 mask[node-> os_index/ sizeof(*mask)/8] |= 1UL << (node-> os_index % ( sizeof(*mask)*8));
115 if (outmaxnode == ( unsigned long) -1 || outmaxnode < node->os_index)
127 *maxnode = outmaxnode+1;
140 static __hwloc_inline int
142 const unsigned long *mask, unsigned long maxnode)
151 && (mask[node-> os_index/ sizeof(*mask)/8] & (1UL << (node-> os_index % ( sizeof(*mask)*8)))))
173 static __hwloc_inline int
175 const unsigned long *mask, unsigned long maxnode)
184 && (mask[node-> os_index/ sizeof(*mask)/8] & (1UL << (node-> os_index % ( sizeof(*mask)*8)))))
215 static __hwloc_inline struct bitmask *
217 static __hwloc_inline struct bitmask *
221 struct bitmask *bitmask = numa_allocate_cpumask();
229 numa_bitmask_setbit(bitmask, node-> os_index);
233 numa_bitmask_setbit(bitmask, 0);
248 static __hwloc_inline struct bitmask *
250 static __hwloc_inline struct bitmask *
254 struct bitmask *bitmask = numa_allocate_cpumask();
262 numa_bitmask_setbit(bitmask, node-> os_index);
266 numa_bitmask_setbit(bitmask, 0);
277 static __hwloc_inline int
279 const struct bitmask *bitmask)
287 if (numa_bitmask_isbitset(bitmask, node-> os_index))
291 if (numa_bitmask_isbitset(bitmask, 0))
305 static __hwloc_inline int
307 const struct bitmask *bitmask)
315 if (numa_bitmask_isbitset(bitmask, node-> os_index))
319 if (numa_bitmask_isbitset(bitmask, 0))
|
|
|