score: Add Per_CPU_Control::Interrupt_frame

Update #2809.
This commit is contained in:
Sebastian Huber
2016-11-11 14:12:03 +01:00
parent 2072dd242f
commit f9aa34ddd9
3 changed files with 38 additions and 9 deletions

View File

@@ -110,11 +110,6 @@ RTEMS_STATIC_ASSERT(
SPARC_MINIMUM_STACK_FRAME_SIZE
);
RTEMS_STATIC_ASSERT(
sizeof(CPU_Interrupt_frame) == CPU_INTERRUPT_FRAME_SIZE,
CPU_Interrupt_frame_size
);
/* https://devel.rtems.org/ticket/2352 */
RTEMS_STATIC_ASSERT(
sizeof(CPU_Interrupt_frame) % CPU_ALIGNMENT == 0,

View File

@@ -9,6 +9,8 @@
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* Copyright (c) 2012, 2016 embedded brains GmbH
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
@@ -35,16 +37,28 @@
extern "C" {
#endif
#if defined( RTEMS_SMP )
#if defined(RTEMS_SMP)
#if defined(RTEMS_PROFILING)
#define PER_CPU_CONTROL_SIZE_APPROX ( 512 + CPU_INTERRUPT_FRAME_SIZE )
#elif defined(RTEMS_DEBUG)
#define PER_CPU_CONTROL_SIZE_APPROX ( 256 + CPU_INTERRUPT_FRAME_SIZE )
#else
#define PER_CPU_CONTROL_SIZE_APPROX ( 128 + CPU_INTERRUPT_FRAME_SIZE )
#endif
/*
* This ensures that on SMP configurations the individual per-CPU controls
* are on different cache lines to prevent false sharing. This define can be
* used in assembler code to easily get the per-CPU control for a particular
* processor.
*/
#if defined( RTEMS_PROFILING )
#if PER_CPU_CONTROL_SIZE_APPROX > 1024
#define PER_CPU_CONTROL_SIZE_LOG2 11
#elif PER_CPU_CONTROL_SIZE_APPROX > 512
#define PER_CPU_CONTROL_SIZE_LOG2 10
#elif PER_CPU_CONTROL_SIZE_APPROX > 256
#define PER_CPU_CONTROL_SIZE_LOG2 9
#elif defined( RTEMS_DEBUG )
#elif PER_CPU_CONTROL_SIZE_APPROX > 128
#define PER_CPU_CONTROL_SIZE_LOG2 8
#else
#define PER_CPU_CONTROL_SIZE_LOG2 7
@@ -348,6 +362,10 @@ typedef struct Per_CPU_Control {
*/
volatile bool dispatch_necessary;
#if defined(RTEMS_SMP)
CPU_Interrupt_frame Interrupt_frame;
#endif
/**
* @brief The CPU usage timestamp contains the time point of the last heir
* thread change or last CPU usage update of the executing thread of this
@@ -800,6 +818,10 @@ RTEMS_INLINE_ROUTINE struct _Thread_Control *_Thread_Get_executing( void )
PER_CPU_OFFSET_EXECUTING + CPU_SIZEOF_POINTER
#define PER_CPU_DISPATCH_NEEDED \
PER_CPU_OFFSET_HEIR + CPU_SIZEOF_POINTER
#if defined(RTEMS_SMP)
#define PER_CPU_INTERRUPT_FRAME_AREA \
PER_CPU_DISPATCH_NEEDED + 4
#endif
#define THREAD_DISPATCH_DISABLE_LEVEL \
(SYM(_Per_CPU_Information) + PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2014 embedded brains GmbH. All rights reserved.
* Copyright (c) 2012, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -110,6 +110,18 @@ RTEMS_STATIC_ASSERT(
PER_CPU_DISPATCH_NEEDED
);
#if defined(RTEMS_SMP)
RTEMS_STATIC_ASSERT(
offsetof(Per_CPU_Control, Interrupt_frame) == PER_CPU_INTERRUPT_FRAME_AREA,
PER_CPU_INTERRUPT_FRAME_AREA
);
RTEMS_STATIC_ASSERT(
sizeof( CPU_Interrupt_frame ) == CPU_INTERRUPT_FRAME_SIZE,
CPU_INTERRUPT_FRAME_SIZE
);
#endif
#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
|| CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
RTEMS_STATIC_ASSERT(