summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/processormask.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-12-20 15:11:25 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-12-20 17:08:14 +0100
commitf169b513d2830d14dfff85ca17cc59d4c438ddd1 (patch)
tree17f51a0d83957b3b35130901327089f750fcfd24 /cpukit/include/rtems/score/processormask.h
parentbsp/atsam: Allow to use custom SDRAM (diff)
downloadrtems-f169b513d2830d14dfff85ca17cc59d4c438ddd1.tar.bz2
score: Fix _Processor_mask_To_uint32_t()
Correctly calculate the array index and shift value in _Processor_mask_To_uint32_t(). The bugs had no impact yet since this function was always called with a zero value for the index in RTEMS.
Diffstat (limited to '')
-rw-r--r--cpukit/include/rtems/score/processormask.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/include/rtems/score/processormask.h b/cpukit/include/rtems/score/processormask.h
index bcdc1c471e..7ad6ea6edb 100644
--- a/cpukit/include/rtems/score/processormask.h
+++ b/cpukit/include/rtems/score/processormask.h
@@ -353,9 +353,9 @@ static inline uint32_t _Processor_mask_To_uint32_t(
uint32_t index
)
{
- long bits = mask->__bits[ __bitset_words( index ) ];
+ long bits = mask->__bits[ index / _BITSET_BITS ];
- return (uint32_t) (bits >> (32 * (index % _BITSET_BITS) / 32));
+ return (uint32_t) ( bits >> ( 32 * ( ( index % _BITSET_BITS ) / 32 ) ) );
}
/**