summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulerimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-13 08:57:29 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:43 +0100
commit913864c0b85c9e94140515a44e79d13e999ff9a2 (patch)
tree2bca1b18a07972948290afee551bda967c452185 /cpukit/score/include/rtems/score/schedulerimpl.h
parentscore: Yield support for new SMP helping protocol (diff)
downloadrtems-913864c0b85c9e94140515a44e79d13e999ff9a2.tar.bz2
score: Use scheduler instance specific locks
Update #2556.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index ea32e00a65..25b961fcd6 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -101,8 +101,6 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU(
return _Scheduler_Get_by_CPU_index( cpu_index );
}
-ISR_LOCK_DECLARE( extern, _Scheduler_Lock )
-
/**
* @brief Acquires the scheduler instance inside a critical section (interrupts
* disabled).
@@ -116,8 +114,15 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Acquire_critical(
ISR_lock_Context *lock_context
)
{
+#if defined(RTEMS_SMP)
+ Scheduler_Context *context;
+
+ context = _Scheduler_Get_context( scheduler );
+ _ISR_lock_Acquire( &context->Lock, lock_context );
+#else
(void) scheduler;
- _ISR_lock_Acquire( &_Scheduler_Lock, lock_context );
+ (void) lock_context;
+#endif
}
/**
@@ -133,8 +138,15 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
ISR_lock_Context *lock_context
)
{
+#if defined(RTEMS_SMP)
+ Scheduler_Context *context;
+
+ context = _Scheduler_Get_context( scheduler );
+ _ISR_lock_Release( &context->Lock, lock_context );
+#else
(void) scheduler;
- _ISR_lock_Release( &_Scheduler_Lock, lock_context );
+ (void) lock_context;
+#endif
}
RTEMS_INLINE_ROUTINE Scheduler_Node *_Scheduler_Thread_get_node(