RTEMS: Processor Mask

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Files | Enumerations | Functions | Variables
Processor Mask
Internal » SuperCore

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

## 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] | 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.

## ◆ _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] | dst | The mask to copy src to.
  | src | The 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] | mask | The mask to clear the bit of.
  | index | The 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] | 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.

Return values

  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).

## ◆ _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

  a | The 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] | mask | The 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

  a | The 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

  | src | The source for the copy operation.
  | src_size | The size of src.
  [out] | dst | The destination for the copy operation.

Return values

  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).

## ◆ _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] | The | mask that is created.
  | index | The 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] | mask | The mask that is created.
  | bits | The bits for creating the mask.
  | index | The 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

  a | The first processor set.
  b | The second processor set.

Return values

  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.

## ◆ _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

  status | The copy status to check.

Return values

  true | At most partial loss can be guaranteed.
  false | The 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

  a | The first processor set.
  b | The seconde processor set.

Return values

  true | The processor sets a and b are equal.
  false | The 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

  mask | The mask to check if the specified bit is set.
  index | The index of the bit that is checked.

Return values

  true | The specified index bit is set.
  false | The 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

  big | The bigger processor set.
  small | The smaller processor set.

Return values

  true | small is a subset of big.
  false | small 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

  mask | The mask to check whether is is zero

Return values

  true | The mask is zero.
  false | The 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] | a | The processor mask that is set by this operation.
  | b | The first parameter of the operation.
  | c | The 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] | 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.

## ◆ _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] | mask | The mask to set the bit of.
  | index | The 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

  | src | The source for the copy operation.
  | dst_size | The size of dst.
  [out] | dst | The destination for the copy operation.

Return values

  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).

## ◆ _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

  mask | The processor mask.
  index | The 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] | 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.

## ◆ _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] | mask | The mask to set to zero.