diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-11 11:54:30 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-12 08:00:13 +0200 |
commit | af207fa9f6ac891b9a61f36bd8382eb89358aeca (patch) | |
tree | 0f6604b9702087b467c48bd747b63f865b43c697 /cpukit | |
parent | Add interrupt server move (diff) | |
download | rtems-af207fa9f6ac891b9a61f36bd8382eb89358aeca.tar.bz2 |
Add interrupt vector set/get affinity
Close #3071.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/irq-extension.h | 37 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/processormask.h | 25 |
2 files changed, 62 insertions, 0 deletions
diff --git a/cpukit/include/rtems/irq-extension.h b/cpukit/include/rtems/irq-extension.h index e3fb4c5fea..5dd3792e22 100644 --- a/cpukit/include/rtems/irq-extension.h +++ b/cpukit/include/rtems/irq-extension.h @@ -204,6 +204,43 @@ rtems_status_code rtems_interrupt_handler_iterate( ); /** + * @brief Sets the processor affinity set of an interrupt vector. + * + * @param[in] vector The interrupt vector number. + * @param[in] affinity_size The storage size of the affinity set. + * @param[in] affinity_set The new processor affinity set for the interrupt + * vector. This pointer must not be @c NULL. + * + * @retval RTEMS_SUCCESSFUL Successful operation. + * @retval RTEMS_INVALID_ID The vector number is invalid. + * @retval RTEMS_INVALID_SIZE Invalid affinity set size. + * @retval RTEMS_INVALID_NUMBER Invalid processor affinity set. + */ +rtems_status_code rtems_interrupt_set_affinity( + rtems_vector_number vector, + size_t affinity_size, + const cpu_set_t *affinity +); + +/** + * @brief Gets the processor affinity set of an interrupt vector. + * + * @param[in] vector The interrupt vector number. + * @param[in] affinity_size The storage size of the affinity set. + * @param[out] affinity_set The current processor affinity set for the + * interrupt vector. This pointer must not be @c NULL. + * + * @retval RTEMS_SUCCESSFUL Successful operation. + * @retval RTEMS_INVALID_ID The vector number is invalid. + * @retval RTEMS_INVALID_SIZE Invalid affinity set size. + */ +rtems_status_code rtems_interrupt_get_affinity( + rtems_vector_number vector, + size_t affinity_size, + cpu_set_t *affinity +); + +/** * @brief An interrupt server action. * * This structure must be treated as an opaque data type. Members must not be diff --git a/cpukit/score/include/rtems/score/processormask.h b/cpukit/score/include/rtems/score/processormask.h index ed79e63d6f..fd256d2342 100644 --- a/cpukit/score/include/rtems/score/processormask.h +++ b/cpukit/score/include/rtems/score/processormask.h @@ -203,6 +203,31 @@ RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_To_uint32_t( return (uint32_t) (bits >> (32 * (index % _BITSET_BITS) / 32)); } +/** + * @brief Creates a processor set from an unsigned 32-bit integer relative to + * the specified index. + */ +RTEMS_INLINE_ROUTINE void _Processor_mask_From_uint32_t( + Processor_mask *mask, + uint32_t bits, + uint32_t index +) +{ + _Processor_mask_Zero( mask ); + mask->__bits[ __bitset_words( index ) ] = ((long) bits) << (32 * (index % _BITSET_BITS) / 32); +} + +/** + * @brief Creates a processor set from the specified index. + */ +RTEMS_INLINE_ROUTINE void _Processor_mask_From_index( + Processor_mask *mask, + uint32_t index +) +{ + BIT_SETOF( CPU_MAXIMUM_PROCESSORS, (int) index, mask ); +} + typedef enum { PROCESSOR_MASK_COPY_LOSSLESS, PROCESSOR_MASK_COPY_PARTIAL_LOSS, |