RTEMS
5.1
|
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 |
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.
RTEMS_INLINE_ROUTINE void _Processor_mask_And | ( | Processor_mask * | a, |
const Processor_mask * | b, | ||
const Processor_mask * | c | ||
) |
Performs a bitwise a = b & c.
[out] | a | The processor mask that is set by this operation. |
b | The first parameter of the AND-operation. | |
c | The second parameter of the AND-operation. |
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.
[out] | dst | The mask to copy src to. |
src | The mask to copy to dst. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Clear | ( | Processor_mask * | mask, |
uint32_t | index | ||
) |
Clears the specified index bit of the mask.
[out] | mask | The mask to clear the bit of. |
index | The index of the bit that shall be cleared. |
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.
[out] | dst | The destination of the copy operation. |
dst_size | The size of dst. | |
src | The source of the copy operation. | |
src_size | The size of src. |
PROCESSOR_MASK_COPY_LOSSLESS | It is guaranteed that the copy operation is lossless. |
PROCESSOR_MASK_COPY_PARTIAL_LOSS | Partial loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_COMPLETE_LOSS | Complete loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_INVALID_SIZE | One of the arguments sizes is invalid (bigger than the size of a long). |
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count | ( | const Processor_mask * | a | ) |
Gets the number of set bits in the processor mask.
a | The processor mask of which the set bits are counted. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Fill | ( | Processor_mask * | mask | ) |
Fills the mask, also considers CPU_MAXIMUM_PROCESSORS.
[out] | mask | The mask to fill |
RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set | ( | const Processor_mask * | a | ) |
Finds the last set of the processor mask.
a | The processor mask wo find the last set of. |
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.
src | The source for the copy operation. | |
src_size | The size of src. | |
[out] | dst | The destination for the copy operation. |
PROCESSOR_MASK_COPY_LOSSLESS | It is guaranteed that the copy operation is lossless. |
PROCESSOR_MASK_COPY_PARTIAL_LOSS | Partial loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_COMPLETE_LOSS | Complete loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_INVALID_SIZE | One of the arguments sizes is invalid (bigger than the size of a long). |
RTEMS_INLINE_ROUTINE void _Processor_mask_From_index | ( | Processor_mask * | mask, |
uint32_t | index | ||
) |
Creates a processor set from the specified index.
[out] | The | mask that is created. |
index | The specified index. |
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.
[out] | mask | The mask that is created. |
bits | The bits for creating the mask. | |
index | The index to which the mask is relative. |
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.
a | The first processor set. |
b | The second processor set. |
true | The intersection of the processor sets a and b is non-empty. |
false | The intersection of the processor sets a and b is empty. |
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.
status | The copy status to check. |
true | At most partial loss can be guaranteed. |
false | The status indicates more than partial loss. |
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.
a | The first processor set. |
b | The seconde processor set. |
true | The processor sets a and b are equal. |
false | The processor sets a and b are not equal. |
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.
mask | The mask to check if the specified bit is set. |
index | The index of the bit that is checked. |
true | The specified index bit is set. |
false | The specified index bit is not set. |
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.
big | The bigger processor set. |
small | The smaller processor set. |
true | small is a subset of big. |
false | small is not a subset of big. |
RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero | ( | const Processor_mask * | mask | ) |
Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS.
mask | The mask to check whether is is zero |
true | The mask is zero. |
false | The mask is not zero. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Nand | ( | Processor_mask * | a, |
const Processor_mask * | b, | ||
const Processor_mask * | c | ||
) |
Performs a bitwise a = b & ~c.
[out] | a | The processor mask that is set by this operation. |
b | The first parameter of the operation. | |
c | The second parameter of the operation. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Or | ( | Processor_mask * | a, |
const Processor_mask * | b, | ||
const Processor_mask * | c | ||
) |
Performs a bitwise a = b | c.
[out] | a | The processor mask that is set by this operation. |
b | The first parameter of the OR-operation. | |
c | The second parameter of the OR-operation. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Set | ( | Processor_mask * | mask, |
uint32_t | index | ||
) |
Sets the specified index bit of the mask.
[out] | mask | The mask to set the bit of. |
index | The index of the bit that shall be set. |
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.
src | The source for the copy operation. | |
dst_size | The size of dst. | |
[out] | dst | The destination for the copy operation. |
PROCESSOR_MASK_COPY_LOSSLESS | It is guaranteed that the copy operation is lossless. |
PROCESSOR_MASK_COPY_PARTIAL_LOSS | Partial loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_COMPLETE_LOSS | Complete loss happened due to the sizes of src and dst. |
PROCESSOR_MASK_COPY_INVALID_SIZE | One of the arguments sizes is invalid (bigger than the size of a long). |
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.
mask | The processor mask. |
index | The specified index. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Xor | ( | Processor_mask * | a, |
const Processor_mask * | b, | ||
const Processor_mask * | c | ||
) |
Performs a bitwise a = b ^ c.
[out] | a | The processor mask that is set by this operation. |
b | The first parameter of the XOR-operation. | |
c | The second parameter of the XOR-operation. |
RTEMS_INLINE_ROUTINE void _Processor_mask_Zero | ( | Processor_mask * | mask | ) |
Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS.
[out] | mask | The mask to set to zero. |