diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-28 10:54:46 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-31 15:20:32 +0200 |
commit | e358088fc25fb3f62b30ae6a187f3e374f6a5ed7 (patch) | |
tree | 554337534e7212617c1523be0453c604ad120916 /cpukit/score/include/rtems/score/thread.h | |
parent | score: Mark as no return (diff) | |
download | rtems-e358088fc25fb3f62b30ae6a187f3e374f6a5ed7.tar.bz2 |
smp: New SMP lock API
Move the SMP lock implementation to the CPU port. An optimal SMP lock
implementation is highly architecture dependent. For example the memory
models may be fundamentally different.
The new SMP lock API has a flaw. It does not provide the ability to use
a local context for acquire and release pairs. Such a context is
necessary to implement for example the Mellor-Crummey and Scott (MCS)
locks. The SMP lock is currently used in _Thread_Disable_dispatch() and
_Thread_Enable_dispatch() and makes them to a giant lock acquire and
release. Since these functions do not pass state information via a
local context there is currently no use case for such a feature.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 248be62c95..9461c85be1 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -470,11 +470,18 @@ SCORE_EXTERN Context_Control _Thread_BSP_context; SCORE_EXTERN volatile uint32_t _Thread_Dispatch_disable_level; #if defined(RTEMS_SMP) + typedef struct { + SMP_lock_Control lock; + int owner_cpu; + int nest_level; + } Thread_Dispatch_disable_level_lock_control; + /** * The following declares the smp spinlock to be used to control * the dispatch critical section accesses across cpus. */ - SCORE_EXTERN SMP_lock_spinlock_nested_Control _Thread_Dispatch_disable_level_lock; + SCORE_EXTERN Thread_Dispatch_disable_level_lock_control + _Thread_Dispatch_disable_level_lock; #endif /** |