Changeset 198c143 in rtems


Ignore:
Timestamp:
Apr 10, 2014, 6:18:00 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
53e008b
Parents:
67a7a2c
git-author:
Sebastian Huber <sebastian.huber@…> (04/10/14 06:18:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/14/14 06:37:04)
Message:

score: Add _Per_CPU_Get_snapshot()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/percpu.h

    r67a7a2c r198c143  
    425425#endif
    426426
     427/*
     428 * If we get the current processor index in a context which allows thread
     429 * dispatching, then we may already run on another processor right after the
     430 * read instruction.  There are very few cases in which this makes sense (here
     431 * we can use _Per_CPU_Get_snapshot()).  All other places must use
     432 * _Per_CPU_Get() so that we can add checks for RTEMS_DEBUG.
     433 */
     434#define _Per_CPU_Get_snapshot() \
     435  ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu )
     436
    427437#if defined( RTEMS_SMP )
    428438static inline Per_CPU_Control *_Per_CPU_Get( void )
    429439{
    430   Per_CPU_Control *per_cpu =
    431     &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu;
     440  Per_CPU_Control *per_cpu = _Per_CPU_Get_snapshot();
    432441
    433442  _Assert(
     
    438447}
    439448#else
    440 #define _Per_CPU_Get() ( &_Per_CPU_Information[ 0 ].per_cpu )
     449#define _Per_CPU_Get() _Per_CPU_Get_snapshot()
    441450#endif
    442451
Note: See TracChangeset for help on using the changeset viewer.