diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-10 16:28:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-12 21:00:05 +0200 |
commit | a0ec14ca223390f7961c6dfe950edd4db4c777c3 (patch) | |
tree | c49cec354e13f2ab2e61acec79f7211300313067 /cpukit/include/rtems/score/schedulernode.h | |
parent | score: Replace priority prepend it with an enum (diff) | |
download | rtems-a0ec14ca223390f7961c6dfe950edd4db4c777c3.tar.bz2 |
score: Replace the single use of a sequence lock
In SMP configurations, on 64-bit architectures use plain atomic
operations to set/get the priority value of a scheduler node. On 32-bit
architectures use an ISR lock. Using a sequence lock has no real
benefit since it uses atomic read-modify-write operations for both the
read and the write lock. Simply use a ticket lock instead so that only
one SMP synchronization primitive is used for everything.
Diffstat (limited to 'cpukit/include/rtems/score/schedulernode.h')
-rw-r--r-- | cpukit/include/rtems/score/schedulernode.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/include/rtems/score/schedulernode.h b/cpukit/include/rtems/score/schedulernode.h index 1dba200dca..e344479718 100644 --- a/cpukit/include/rtems/score/schedulernode.h +++ b/cpukit/include/rtems/score/schedulernode.h @@ -28,7 +28,7 @@ #include <rtems/score/basedefs.h> #include <rtems/score/chain.h> #include <rtems/score/priority.h> -#include <rtems/score/smplockseq.h> +#include <rtems/score/isrlock.h> /** * @addtogroup RTEMSScoreScheduler @@ -197,14 +197,20 @@ struct Scheduler_Node { * least-significant bit which indicates if the thread should be appended * (bit set) or prepended (bit cleared) to its priority group, see * SCHEDULER_PRIORITY_APPEND(). + * + * @see _Scheduler_Node_get_priority() and _Scheduler_Node_set_priority(). */ +#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8 + Atomic_Ulong value; +#else Priority_Control value; +#endif -#if defined(RTEMS_SMP) +#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER != 8 /** - * @brief Sequence lock to synchronize priority value updates. + * @brief The lock protects the priority value. */ - SMP_sequence_lock_Control Lock; + ISR_lock_Control Lock; #endif } Priority; }; |