mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 06:28:13 +08:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user