summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-01 09:17:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-09 21:58:39 +0200
commit7045dc425d9416060c9ba862e9eaf8405b688474 (patch)
treee335b6cbd6d47d52731b9230c0c8d92d261ac183 /cpukit/score/include/rtems/score/percpu.h
parentscore/cpu: Add CPU_Per_CPU_control (diff)
downloadrtems-7045dc425d9416060c9ba862e9eaf8405b688474.tar.bz2
smp: Use ISR lock in per-CPU control
Rename _Per_CPU_Lock_acquire() to _Per_CPU_ISR_disable_and_acquire(). Rename _Per_CPU_Lock_release() to _Per_CPU_Release_and_ISR_enable(). Add _Per_CPU_Acquire() and _Per_CPU_Release().
Diffstat (limited to 'cpukit/score/include/rtems/score/percpu.h')
-rw-r--r--cpukit/score/include/rtems/score/percpu.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index e6713bf502..6e3a18e6db 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -23,9 +23,8 @@
#include <rtems/asm.h>
#else
#include <rtems/score/assert.h>
- #include <rtems/score/isrlevel.h>
+ #include <rtems/score/isrlock.h>
#include <rtems/score/timestamp.h>
- #include <rtems/score/smplock.h>
#include <rtems/score/smp.h>
#endif
@@ -179,10 +178,13 @@ typedef struct {
/** This is the time of the last context switch on this CPU. */
Timestamp_Control time_of_last_context_switch;
- #if defined( RTEMS_SMP )
- /** This element is used to lock this structure */
- SMP_lock_Control lock;
+ /**
+ * @brief This lock protects the dispatch_necessary, executing, heir and
+ * message fields.
+ */
+ ISR_lock_Control lock;
+ #if defined( RTEMS_SMP )
/**
* This is the request for the interrupt.
*
@@ -220,6 +222,18 @@ typedef struct {
*/
extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
+#define _Per_CPU_ISR_disable_and_acquire( per_cpu, isr_cookie ) \
+ _ISR_lock_ISR_disable_and_acquire( &( per_cpu )->lock, isr_cookie )
+
+#define _Per_CPU_Release_and_ISR_enable( per_cpu, isr_cookie ) \
+ _ISR_lock_Release_and_ISR_enable( &( per_cpu )->lock, isr_cookie )
+
+#define _Per_CPU_Acquire( per_cpu ) \
+ _ISR_lock_Acquire( &( per_cpu )->lock )
+
+#define _Per_CPU_Release( per_cpu ) \
+ _ISR_lock_Release( &( per_cpu )->lock )
+
#if defined( RTEMS_SMP )
static inline Per_CPU_Control *_Per_CPU_Get( void )
{
@@ -275,12 +289,6 @@ void _Per_CPU_Wait_for_state(
Per_CPU_State desired_state
);
-#define _Per_CPU_Lock_acquire( per_cpu, isr_cookie ) \
- _SMP_lock_ISR_disable_and_acquire( &( per_cpu )->lock, isr_cookie )
-
-#define _Per_CPU_Lock_release( per_cpu, isr_cookie ) \
- _SMP_lock_Release_and_ISR_enable( &( per_cpu )->lock, isr_cookie )
-
#endif /* defined( RTEMS_SMP ) */
/*