summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-05-12 13:23:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-05-12 13:23:12 +0000
commit0a101d572d7abb5a18103143552d52c83599a6a4 (patch)
tree7f1629c301a552ad0dbd72e36bc2269db67f09ed /cpukit
parent2011-05-12 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-0a101d572d7abb5a18103143552d52c83599a6a4.tar.bz2
2011-05-12 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1788/cpukit * score/include/rtems/score/percpu.h, score/include/rtems/score/thread.h: Make time of last context switch part of per cpu information since each core has a different context switch to track.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog8
-rw-r--r--cpukit/score/include/rtems/score/percpu.h10
-rw-r--r--cpukit/score/include/rtems/score/thread.h10
3 files changed, 18 insertions, 10 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 8b8c4954e4..0ce890626e 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-12 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ PR 1788/cpukit
+ * score/include/rtems/score/percpu.h,
+ score/include/rtems/score/thread.h: Make time of last context switch
+ part of per cpu information since each core has a different context
+ switch to track.
+
2011-05-12 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/sys/ucred.h: Make self-contained.
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 929dad2191..9224ad0d2e 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -24,6 +24,7 @@
#ifdef ASM
#include <rtems/asm.h>
#else
+ #include <rtems/score/timestamp.h>
#if defined(RTEMS_SMP)
#include <rtems/score/smplock.h>
#endif
@@ -51,6 +52,8 @@ extern "C" {
#endif
#ifndef ASM
+#include <rtems/score/timestamp.h>
+
#ifndef __THREAD_CONTROL_DEFINED__
#define __THREAD_CONTROL_DEFINED__
typedef struct Thread_Control_struct Thread_Control;
@@ -136,6 +139,8 @@ typedef struct {
/** This is set to true when this CPU needs to run the dispatcher. */
volatile bool dispatch_necessary;
+ /** This is the time of the last context switch on this CPU. */
+ Timestamp_Control time_of_last_context_switch;
} Per_CPU_Control;
#endif
@@ -249,6 +254,11 @@ void _Per_CPU_Initialize(void);
_Per_CPU_Information[bsp_smp_processor_id()].interrupt_stack_high
#define _Thread_Dispatch_necessary \
_Per_CPU_Information[bsp_smp_processor_id()].dispatch_necessary
+#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
+ #define _Thread_Time_of_last_context_switch \
+ _Per_CPU_Information[bsp_smp_processor_id()].time_of_last_context_switch
+#endif
+
#endif /* ASM */
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 0453912a46..785d8a149e 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -492,16 +492,6 @@ SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
*/
SCORE_EXTERN struct _reent **_Thread_libc_reent;
-#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
-
- /**
- * This contains the time since boot when the last context switch occurred.
- * By placing it in the BSS, it will automatically be zeroed out at
- * system initialization and does not need to be known outside this
- * file.
- */
- SCORE_EXTERN Timestamp_Control _Thread_Time_of_last_context_switch;
-#endif
/**
* This routine performs the initialization necessary for this handler.