23 #ifndef _RTEMS_SCORE_PROCESSORMASK_H 24 #define _RTEMS_SCORE_PROCESSORMASK_H 26 #include <rtems/score/cpu.h> 28 #include <sys/cpuset.h> 96 Processor_mask *dst,
const Processor_mask *src
109 Processor_mask *mask,
123 Processor_mask *mask,
140 const Processor_mask *mask,
157 const Processor_mask *a,
158 const Processor_mask *b
175 const Processor_mask *a,
176 const Processor_mask *b
193 const Processor_mask *big,
194 const Processor_mask *small
209 const Processor_mask *b,
210 const Processor_mask *c
225 const Processor_mask *b,
226 const Processor_mask *c
241 const Processor_mask *b,
242 const Processor_mask *c
257 const Processor_mask *b,
258 const Processor_mask *c
298 const Processor_mask *mask,
302 long bits = mask->__bits[ __bitset_words( index ) ];
304 return (uint32_t) (bits >> (32 * (index % _BITSET_BITS) / 32));
316 Processor_mask *mask,
322 mask->__bits[ __bitset_words( index ) ] = ((long) bits) << (32 * (index % _BITSET_BITS) / 32);
332 Processor_mask *mask,
340 PROCESSOR_MASK_COPY_LOSSLESS,
341 PROCESSOR_MASK_COPY_PARTIAL_LOSS,
342 PROCESSOR_MASK_COPY_COMPLETE_LOSS,
343 PROCESSOR_MASK_COPY_INVALID_SIZE
344 } Processor_mask_Copy_status;
355 Processor_mask_Copy_status status
358 return (
unsigned int) status <= PROCESSOR_MASK_COPY_PARTIAL_LOSS;
402 const Processor_mask *src,
445 extern const Processor_mask _Processor_mask_The_one_and_only;
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_at_most_partial_loss(Processor_mask_Copy_status status)
Checks if the copy status guarantees at most partial loss.
Definition: processormask.h:354
RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(Processor_mask *dst, size_t src_size, const cpu_set_t *src)
Copies one mask to another.
Definition: processormask.h:431
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero(const Processor_mask *mask)
Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS.
Definition: processormask.h:74
#define CPU_MAXIMUM_PROCESSORS
Maximum number of processors of all systems supported by this CPU port.
Definition: cpu.h:250
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_equal(const Processor_mask *a, const Processor_mask *b)
Checks if the processor sets a and b are equal.
Definition: processormask.h:156
RTEMS_INLINE_ROUTINE void _Processor_mask_Or(Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
Performs a bitwise a = b | c.
Definition: processormask.h:239
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count(const Processor_mask *a)
Gets the number of set bits in the processor mask.
Definition: processormask.h:271
RTEMS_INLINE_ROUTINE void _Processor_mask_Clear(Processor_mask *mask, uint32_t index)
Clears the specified index bit of the mask.
Definition: processormask.h:122
RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(const Processor_mask *src, size_t dst_size, cpu_set_t *dst)
Copies one mask to another.
Definition: processormask.h:401
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_To_uint32_t(const Processor_mask *mask, uint32_t index)
Returns the subset of 32 processors containing the specified index as an unsigned 32-bit integer.
Definition: processormask.h:297
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set(const Processor_mask *a)
Finds the last set of the processor mask.
Definition: processormask.h:283
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:31
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.
RTEMS_INLINE_ROUTINE bool _Processor_mask_Has_overlap(const Processor_mask *a, const Processor_mask *b)
Checks if the intersection of the processor sets a and b is non-empty.
Definition: processormask.h:174
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_set(const Processor_mask *mask, uint32_t index)
Checks if the specified index bit of the mask is set.
Definition: processormask.h:139
RTEMS_INLINE_ROUTINE void _Processor_mask_Xor(Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
Performs a bitwise a = b ^ c.
Definition: processormask.h:255
RTEMS_INLINE_ROUTINE void _Processor_mask_Zero(Processor_mask *mask)
Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS.
Definition: processormask.h:61
RTEMS_INLINE_ROUTINE void _Processor_mask_And(Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
Performs a bitwise a = b & c.
Definition: processormask.h:207
RTEMS_INLINE_ROUTINE void _Processor_mask_Nand(Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
Performs a bitwise a = b & ~c.
Definition: processormask.h:223
RTEMS_INLINE_ROUTINE void _Processor_mask_From_uint32_t(Processor_mask *mask, uint32_t bits, uint32_t index)
Creates a processor set from an unsigned 32-bit integer relative to the specified index.
Definition: processormask.h:315
RTEMS_INLINE_ROUTINE void _Processor_mask_From_index(Processor_mask *mask, uint32_t index)
Creates a processor set from the specified index.
Definition: processormask.h:331
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_subset(const Processor_mask *big, const Processor_mask *small)
Checks if the processor set small is a subset of processor set big.
Definition: processormask.h:192
RTEMS_INLINE_ROUTINE void _Processor_mask_Assign(Processor_mask *dst, const Processor_mask *src)
Copies the mask to another mask, also considers CPU_MAXIMUM_PROCESSORS.
Definition: processormask.h:95
RTEMS_INLINE_ROUTINE void _Processor_mask_Fill(Processor_mask *mask)
Fills the mask, also considers CPU_MAXIMUM_PROCESSORS.
Definition: processormask.h:84
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE void _Processor_mask_Set(Processor_mask *mask, uint32_t index)
Sets the specified index bit of the mask.
Definition: processormask.h:108