summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-14 10:17:34 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:42 +0200
commita5ac9da30737a3aeb2dcb0462a4eba25cb525253 (patch)
tree7bb4abcb4d350aa9618be52ceb942f63835bc6fc /cpukit/score/include/rtems/score/threadimpl.h
parentscore: Add _Scheduler_Change_priority_if_higher() (diff)
downloadrtems-a5ac9da30737a3aeb2dcb0462a4eba25cb525253.tar.bz2
score: Add and use thread get/set CPU functions
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 1be39b4e72..cc0d818a07 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -432,6 +432,32 @@ void _Thread_blocking_operation_Cancel(
ISR_Level level
);
+RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Get_CPU(
+ const Thread_Control *thread
+)
+{
+#if defined(RTEMS_SMP)
+ return thread->cpu;
+#else
+ (void) thread;
+
+ return _Per_CPU_Get();
+#endif
+}
+
+RTEMS_INLINE_ROUTINE void _Thread_Set_CPU(
+ Thread_Control *thread,
+ Per_CPU_Control *cpu
+)
+{
+#if defined(RTEMS_SMP)
+ thread->cpu = cpu;
+#else
+ (void) thread;
+ (void) cpu;
+#endif
+}
+
/**
* This function returns true if the_thread is the currently executing
* thread, and false otherwise.
@@ -584,7 +610,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread )
#if defined(RTEMS_SMP)
if ( thread->is_executing ) {
const Per_CPU_Control *cpu_of_executing = _Per_CPU_Get();
- Per_CPU_Control *cpu_of_thread = thread->cpu;
+ Per_CPU_Control *cpu_of_thread = _Thread_Get_CPU( thread );
if ( cpu_of_executing != cpu_of_thread ) {
cpu_of_thread->dispatch_necessary = true;