Changeset 9bf7467 in rtems for cpukit/score/src/coretodget.c


Ignore:
Timestamp:
Jul 31, 2013, 11:30:42 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
69308895
Parents:
965a442
git-author:
Sebastian Huber <sebastian.huber@…> (07/31/13 11:30:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/01/13 14:45:46)
Message:

score: Use an ISR lock for TOD

Two issues are addressed.

  1. On single processor configurations the set/get of the now/uptime

timestamps is now consistently protected by ISR disable/enable
sequences. Previously nested interrupts could observe partially written
values since 64-bit writes are not atomic on 32-bit architectures in
general. This could lead to non-monotonic uptime timestamps.

  1. The TOD now/uptime maintanence is now independent of the giant lock.

This is the first step to remove the giant lock in _Thread_Dispatch().

File:
1 edited

Legend:

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

    r965a442 r9bf7467  
    3333  uint32_t          nanoseconds;
    3434
    35   _ISR_Disable( level );
     35  _TOD_Acquire( tod, level );
    3636    nanoseconds = ( *tod->nanoseconds_since_last_tick )();
    3737    now = *clock;
    38   _ISR_Enable( level );
     38  _TOD_Release( tod, level );
    3939
    4040  _Timestamp_Set( &offset, 0, nanoseconds );
Note: See TracChangeset for help on using the changeset viewer.