Changeset e5120a5 in rtems


Ignore:
Timestamp:
Apr 22, 2014, 8:10:39 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
b2ec2d15
Parents:
0c5beb8e
git-author:
Sebastian Huber <sebastian.huber@…> (04/22/14 08:10:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/28/14 07:26:18)
Message:

score: Add _CPU_Get_current_per_CPU_control()

Add optional method _CPU_Get_current_per_CPU_control() to obtain the
per-CPU control of the current processor.

This is optional. Not every CPU port needs this. It is only an
optional optimization variant. In case this macro is undefined, the
default implementation using the current processor index will be used.

Location:
cpukit/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/no_cpu/rtems/score/cpu.h

    r0c5beb8e re5120a5  
    14621462  CPU_Counter_ticks first
    14631463);
     1464
     1465/**
     1466 * @brief Special register pointing to the per-CPU control of the current
     1467 * processor.
     1468 *
     1469 * This is optional.  Not every CPU port needs this.  It is only an optional
     1470 * optimization variant.
     1471 */
     1472register struct Per_CPU_Control *_CPU_Per_CPU_current asm( "rX" );
     1473
     1474/**
     1475 * @brief Optional method to obtain the per-CPU control of the current processor.
     1476 *
     1477 * This is optional.  Not every CPU port needs this.  It is only an optional
     1478 * optimization variant.  In case this macro is undefined, the default
     1479 * implementation using the current processor index will be used.
     1480 */
     1481#define _CPU_Get_current_per_CPU_control() ( _CPU_Per_CPU_current )
    14641482
    14651483#ifdef RTEMS_SMP
  • cpukit/score/include/rtems/score/percpu.h

    r0c5beb8e re5120a5  
    236236 *  This structure is used to hold per core state information.
    237237 */
    238 typedef struct {
     238typedef struct Per_CPU_Control {
    239239  /**
    240240   * @brief CPU port specific control.
     
    438438 * _Per_CPU_Get() so that we can add checks for RTEMS_DEBUG.
    439439 */
    440 #define _Per_CPU_Get_snapshot() \
    441   ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu )
     440#if defined( _CPU_Get_current_per_CPU_control )
     441  #define _Per_CPU_Get_snapshot() _CPU_Get_current_per_CPU_control()
     442#else
     443  #define _Per_CPU_Get_snapshot() \
     444    ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu )
     445#endif
    442446
    443447#if defined( RTEMS_SMP )
Note: See TracChangeset for help on using the changeset viewer.