From 0a101d572d7abb5a18103143552d52c83599a6a4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 12 May 2011 13:23:12 +0000 Subject: 2011-05-12 Joel Sherrill 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. --- cpukit/ChangeLog | 8 ++++++++ cpukit/score/include/rtems/score/percpu.h | 10 ++++++++++ cpukit/score/include/rtems/score/thread.h | 10 ---------- 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'cpukit') 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 + + 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 * 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 #else + #include #if defined(RTEMS_SMP) #include #endif @@ -51,6 +52,8 @@ extern "C" { #endif #ifndef ASM +#include + #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. -- cgit v1.2.3