forked from Imagelibrary/rtems
@@ -110,11 +110,6 @@ RTEMS_STATIC_ASSERT(
|
|||||||
SPARC_MINIMUM_STACK_FRAME_SIZE
|
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 */
|
/* https://devel.rtems.org/ticket/2352 */
|
||||||
RTEMS_STATIC_ASSERT(
|
RTEMS_STATIC_ASSERT(
|
||||||
sizeof(CPU_Interrupt_frame) % CPU_ALIGNMENT == 0,
|
sizeof(CPU_Interrupt_frame) % CPU_ALIGNMENT == 0,
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
* COPYRIGHT (c) 1989-2011.
|
* COPYRIGHT (c) 1989-2011.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2012, 2016 embedded brains GmbH
|
||||||
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
* http://www.rtems.org/license/LICENSE.
|
* http://www.rtems.org/license/LICENSE.
|
||||||
@@ -36,15 +38,27 @@ extern "C" {
|
|||||||
#endif
|
#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
|
* This ensures that on SMP configurations the individual per-CPU controls
|
||||||
* are on different cache lines to prevent false sharing. This define can be
|
* 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
|
* used in assembler code to easily get the per-CPU control for a particular
|
||||||
* processor.
|
* 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
|
#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
|
#define PER_CPU_CONTROL_SIZE_LOG2 8
|
||||||
#else
|
#else
|
||||||
#define PER_CPU_CONTROL_SIZE_LOG2 7
|
#define PER_CPU_CONTROL_SIZE_LOG2 7
|
||||||
@@ -348,6 +362,10 @@ typedef struct Per_CPU_Control {
|
|||||||
*/
|
*/
|
||||||
volatile bool dispatch_necessary;
|
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
|
* @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
|
* 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
|
PER_CPU_OFFSET_EXECUTING + CPU_SIZEOF_POINTER
|
||||||
#define PER_CPU_DISPATCH_NEEDED \
|
#define PER_CPU_DISPATCH_NEEDED \
|
||||||
PER_CPU_OFFSET_HEIR + CPU_SIZEOF_POINTER
|
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 \
|
#define THREAD_DISPATCH_DISABLE_LEVEL \
|
||||||
(SYM(_Per_CPU_Information) + PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL)
|
(SYM(_Per_CPU_Information) + PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL)
|
||||||
|
|||||||
@@ -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
|
* embedded brains GmbH
|
||||||
* Dornierstr. 4
|
* Dornierstr. 4
|
||||||
@@ -110,6 +110,18 @@ RTEMS_STATIC_ASSERT(
|
|||||||
PER_CPU_DISPATCH_NEEDED
|
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 \
|
#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
|
||||||
|| CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
|
|| CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
|
||||||
RTEMS_STATIC_ASSERT(
|
RTEMS_STATIC_ASSERT(
|
||||||
|
|||||||
Reference in New Issue
Block a user