37#ifndef _RTEMS_SCORE_PROCESSORMASK_H
38#define _RTEMS_SCORE_PROCESSORMASK_H
40#include <rtems/score/cpu.h>
42#include <sys/cpuset.h>
55#define __BIT_AND2 BIT_AND2
58#define __BIT_CLR BIT_CLR
61#define __BIT_CMP BIT_CMP
64#define __BIT_COPY BIT_COPY
67#define __BIT_COUNT BIT_COUNT
69#ifndef __BITSET_DEFINE
70#define __BITSET_DEFINE BITSET_DEFINE
73#define __BIT_EMPTY BIT_EMPTY
76#define __BIT_FILL BIT_FILL
79#define __BIT_FLS BIT_FLS
82#define __BIT_ISSET BIT_ISSET
85#define __BIT_OR2 BIT_OR2
88#define __BIT_OVERLAP BIT_OVERLAP
91#define __BIT_SET BIT_SET
94#define __BIT_SETOF BIT_SETOF
97#define __BIT_SUBSET BIT_SUBSET
100#define __BIT_XOR2 BIT_XOR2
103#define __BIT_ZERO BIT_ZERO
131static inline void _Processor_mask_Zero( Processor_mask *mask )
144static inline bool _Processor_mask_Is_zero(
const Processor_mask *mask )
154static inline void _Processor_mask_Fill( Processor_mask *mask )
165static inline void _Processor_mask_Assign(
166 Processor_mask *dst,
const Processor_mask *src
178static inline void _Processor_mask_Set(
179 Processor_mask *mask,
192static inline void _Processor_mask_Clear(
193 Processor_mask *mask,
209static inline bool _Processor_mask_Is_set(
210 const Processor_mask *mask,
226static inline bool _Processor_mask_Is_equal(
227 const Processor_mask *a,
228 const Processor_mask *b
244static inline bool _Processor_mask_Has_overlap(
245 const Processor_mask *a,
246 const Processor_mask *b
262static inline bool _Processor_mask_Is_subset(
263 const Processor_mask *big,
264 const Processor_mask *small
277static inline void _Processor_mask_And(
279 const Processor_mask *b,
280 const Processor_mask *c
293static inline void _Processor_mask_Or(
295 const Processor_mask *b,
296 const Processor_mask *c
309static inline void _Processor_mask_Xor(
311 const Processor_mask *b,
312 const Processor_mask *c
325static inline uint32_t _Processor_mask_Count(
const Processor_mask *a )
337static inline uint32_t _Processor_mask_Find_last_set(
const Processor_mask *a )
351static inline uint32_t _Processor_mask_To_uint32_t(
352 const Processor_mask *mask,
356 long bits = mask->__bits[ index / _BITSET_BITS ];
358 return (uint32_t) ( bits >> ( 32 * ( ( index % _BITSET_BITS ) / 32 ) ) );
369static inline void _Processor_mask_From_uint32_t(
370 Processor_mask *mask,
375 _Processor_mask_Zero( mask );
376 mask->__bits[ __bitset_words( index ) ] = ((long) bits) << (32 * (index % _BITSET_BITS) / 32);
385static inline void _Processor_mask_From_index(
386 Processor_mask *mask,
394 PROCESSOR_MASK_COPY_LOSSLESS,
395 PROCESSOR_MASK_COPY_PARTIAL_LOSS,
396 PROCESSOR_MASK_COPY_COMPLETE_LOSS,
397 PROCESSOR_MASK_COPY_INVALID_SIZE
398} Processor_mask_Copy_status;
408static inline bool _Processor_mask_Is_at_most_partial_loss(
409 Processor_mask_Copy_status status
412 return (
unsigned int) status <= PROCESSOR_MASK_COPY_PARTIAL_LOSS;
455static inline Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(
456 const Processor_mask *src,
485static inline Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(
499extern const Processor_mask _Processor_mask_The_one_and_only;
typedef __BITSET_DEFINE(Processor_mask, CPU_MAXIMUM_PROCESSORS) Processor_mask
A bit map which is large enough to provide one bit for each processor in the system.
Processor_mask_Copy_status _Processor_mask_Copy(long *dst, size_t dst_size, const long *src, size_t src_size)
Copies one mask to another.
Definition: processormaskcopy.c:46
#define CPU_MAXIMUM_PROCESSORS
Maximum number of processors of all systems supported by this CPU port.
Definition: cpu.h:269