RTEMS  5.1
Files | Enumerations | Functions | Variables
Processor Mask

Processor Mask. More...

Files

file  processormask.h
 Processor Mask API.
 
file  processormaskcopy.c
 Processor Mask Implementation.
 

Enumerations

enum  Processor_mask_Copy_status { PROCESSOR_MASK_COPY_LOSSLESS, PROCESSOR_MASK_COPY_PARTIAL_LOSS, PROCESSOR_MASK_COPY_COMPLETE_LOSS, PROCESSOR_MASK_COPY_INVALID_SIZE }
 

Functions

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 void _Processor_mask_Zero (Processor_mask *mask)
 Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS. More...
 
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero (const Processor_mask *mask)
 Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Fill (Processor_mask *mask)
 Fills the mask, also considers CPU_MAXIMUM_PROCESSORS. More...
 
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. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Set (Processor_mask *mask, uint32_t index)
 Sets the specified index bit of the mask. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Clear (Processor_mask *mask, uint32_t index)
 Clears the specified index bit of the mask. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_And (Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
 Performs a bitwise a = b & c. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Nand (Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
 Performs a bitwise a = b & ~c. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Or (Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
 Performs a bitwise a = b | c. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_Xor (Processor_mask *a, const Processor_mask *b, const Processor_mask *c)
 Performs a bitwise a = b ^ c. More...
 
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count (const Processor_mask *a)
 Gets the number of set bits in the processor mask. More...
 
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set (const Processor_mask *a)
 Finds the last set of the processor mask. More...
 
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. More...
 
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. More...
 
RTEMS_INLINE_ROUTINE void _Processor_mask_From_index (Processor_mask *mask, uint32_t index)
 Creates a processor set from the specified index. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Variables

const Processor_mask _Processor_mask_The_one_and_only
 

Detailed Description

Processor Mask.

The processor mask provides a bit map large enough to provide one bit for each processor in the system. It is a fixed size internal data type provided for efficiency in addition to the API level cpu_set_t.

Function Documentation

◆ _Processor_mask_And()

RTEMS_INLINE_ROUTINE void _Processor_mask_And ( Processor_mask *  a,
const Processor_mask *  b,
const Processor_mask *  c 
)

Performs a bitwise a = b & c.

Parameters
[out]aThe processor mask that is set by this operation.
bThe first parameter of the AND-operation.
cThe second parameter of the AND-operation.

◆ _Processor_mask_Assign()

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.

Parameters
[out]dstThe mask to copy src to.
srcThe mask to copy to dst.

◆ _Processor_mask_Clear()

RTEMS_INLINE_ROUTINE void _Processor_mask_Clear ( Processor_mask *  mask,
uint32_t  index 
)

Clears the specified index bit of the mask.

Parameters
[out]maskThe mask to clear the bit of.
indexThe index of the bit that shall be cleared.

◆ _Processor_mask_Copy()

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.

Parameters
[out]dstThe destination of the copy operation.
dst_sizeThe size of dst.
srcThe source of the copy operation.
src_sizeThe size of src.
Return values
PROCESSOR_MASK_COPY_LOSSLESSIt is guaranteed that the copy operation is lossless.
PROCESSOR_MASK_COPY_PARTIAL_LOSSPartial loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_COMPLETE_LOSSComplete loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_INVALID_SIZEOne of the arguments sizes is invalid (bigger than the size of a long).

◆ _Processor_mask_Count()

RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count ( const Processor_mask *  a)

Gets the number of set bits in the processor mask.

Parameters
aThe processor mask of which the set bits are counted.
Returns
The number of set bits in a.

◆ _Processor_mask_Fill()

RTEMS_INLINE_ROUTINE void _Processor_mask_Fill ( Processor_mask *  mask)

Fills the mask, also considers CPU_MAXIMUM_PROCESSORS.

Parameters
[out]maskThe mask to fill

◆ _Processor_mask_Find_last_set()

RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set ( const Processor_mask *  a)

Finds the last set of the processor mask.

Parameters
aThe processor mask wo find the last set of.
Returns
The last set of a.

◆ _Processor_mask_From_cpu_set_t()

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.

Parameters
srcThe source for the copy operation.
src_sizeThe size of src.
[out]dstThe destination for the copy operation.
Return values
PROCESSOR_MASK_COPY_LOSSLESSIt is guaranteed that the copy operation is lossless.
PROCESSOR_MASK_COPY_PARTIAL_LOSSPartial loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_COMPLETE_LOSSComplete loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_INVALID_SIZEOne of the arguments sizes is invalid (bigger than the size of a long).

◆ _Processor_mask_From_index()

RTEMS_INLINE_ROUTINE void _Processor_mask_From_index ( Processor_mask *  mask,
uint32_t  index 
)

Creates a processor set from the specified index.

Parameters
[out]Themask that is created.
indexThe specified index.

◆ _Processor_mask_From_uint32_t()

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.

Parameters
[out]maskThe mask that is created.
bitsThe bits for creating the mask.
indexThe index to which the mask is relative.

◆ _Processor_mask_Has_overlap()

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.

Parameters
aThe first processor set.
bThe second processor set.
Return values
trueThe intersection of the processor sets a and b is non-empty.
falseThe intersection of the processor sets a and b is empty.

◆ _Processor_mask_Is_at_most_partial_loss()

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.

Parameters
statusThe copy status to check.
Return values
trueAt most partial loss can be guaranteed.
falseThe status indicates more than partial loss.

◆ _Processor_mask_Is_equal()

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.

Parameters
aThe first processor set.
bThe seconde processor set.
Return values
trueThe processor sets a and b are equal.
falseThe processor sets a and b are not equal.

◆ _Processor_mask_Is_set()

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.

Parameters
maskThe mask to check if the specified bit is set.
indexThe index of the bit that is checked.
Return values
trueThe specified index bit is set.
falseThe specified index bit is not set.

◆ _Processor_mask_Is_subset()

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.

Parameters
bigThe bigger processor set.
smallThe smaller processor set.
Return values
truesmall is a subset of big.
falsesmall is not a subset of big.

◆ _Processor_mask_Is_zero()

RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero ( const Processor_mask *  mask)

Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS.

Parameters
maskThe mask to check whether is is zero
Return values
trueThe mask is zero.
falseThe mask is not zero.

◆ _Processor_mask_Nand()

RTEMS_INLINE_ROUTINE void _Processor_mask_Nand ( Processor_mask *  a,
const Processor_mask *  b,
const Processor_mask *  c 
)

Performs a bitwise a = b & ~c.

Parameters
[out]aThe processor mask that is set by this operation.
bThe first parameter of the operation.
cThe second parameter of the operation.

◆ _Processor_mask_Or()

RTEMS_INLINE_ROUTINE void _Processor_mask_Or ( Processor_mask *  a,
const Processor_mask *  b,
const Processor_mask *  c 
)

Performs a bitwise a = b | c.

Parameters
[out]aThe processor mask that is set by this operation.
bThe first parameter of the OR-operation.
cThe second parameter of the OR-operation.

◆ _Processor_mask_Set()

RTEMS_INLINE_ROUTINE void _Processor_mask_Set ( Processor_mask *  mask,
uint32_t  index 
)

Sets the specified index bit of the mask.

Parameters
[out]maskThe mask to set the bit of.
indexThe index of the bit that shall be set.

◆ _Processor_mask_To_cpu_set_t()

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.

Parameters
srcThe source for the copy operation.
dst_sizeThe size of dst.
[out]dstThe destination for the copy operation.
Return values
PROCESSOR_MASK_COPY_LOSSLESSIt is guaranteed that the copy operation is lossless.
PROCESSOR_MASK_COPY_PARTIAL_LOSSPartial loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_COMPLETE_LOSSComplete loss happened due to the sizes of src and dst.
PROCESSOR_MASK_COPY_INVALID_SIZEOne of the arguments sizes is invalid (bigger than the size of a long).

◆ _Processor_mask_To_uint32_t()

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.

Parameters
maskThe processor mask.
indexThe specified index.
Returns
The subset containing the specified index as an unsigned 32-bit integer.

◆ _Processor_mask_Xor()

RTEMS_INLINE_ROUTINE void _Processor_mask_Xor ( Processor_mask *  a,
const Processor_mask *  b,
const Processor_mask *  c 
)

Performs a bitwise a = b ^ c.

Parameters
[out]aThe processor mask that is set by this operation.
bThe first parameter of the XOR-operation.
cThe second parameter of the XOR-operation.

◆ _Processor_mask_Zero()

RTEMS_INLINE_ROUTINE void _Processor_mask_Zero ( Processor_mask *  mask)

Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS.

Parameters
[out]maskThe mask to set to zero.