Changeset d50acdbb in rtems for cpukit/score/src/coretodget.c


Ignore:
Timestamp:
Mar 10, 2014, 7:25:32 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
28779c7
Parents:
ae88aa7
git-author:
Sebastian Huber <sebastian.huber@…> (03/10/14 07:25:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/11/14 09:58:09)
Message:

score: Add local context to SMP lock API

Add a local context structure to the SMP lock API for acquire and
release pairs. This context can be used to store the ISR level and
profiling information. It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.

There is only one lock that cannot be used with a local context. This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/coretodget.c

    rae88aa7 rd50acdbb  
    2828{
    2929  TOD_Control      *tod = &_TOD;
    30   ISR_Level         level;
     30  ISR_lock_Context  lock_context;
    3131  Timestamp_Control offset;
    3232  Timestamp_Control now;
    3333  uint32_t          nanoseconds;
    3434
    35   _TOD_Acquire( tod, level );
     35  _TOD_Acquire( tod, &lock_context );
    3636    nanoseconds = ( *tod->nanoseconds_since_last_tick )();
    3737    now = *clock;
    38   _TOD_Release( tod, level );
     38  _TOD_Release( tod, &lock_context );
    3939
    4040  _Timestamp_Set( &offset, 0, nanoseconds );
Note: See TracChangeset for help on using the changeset viewer.