Changeset 3246b0f8 in rtems


Ignore:
Timestamp:
Jun 13, 2012, 9:29:53 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
c34bb0d
Parents:
50fc8f6
git-author:
Sebastian Huber <sebastian.huber@…> (06/13/12 09:29:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/12 12:20:30)
Message:

score: New structure TOD_Control

Group the global TOD variables (_TOD_Now, _TOD_Uptime, and _TOD_Is_set)
in a structure to reduce address loads in _TOD_Tickle_ticks().

Files:
13 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/clockgetsecondssinceepoch.c

    r50fc8f6 r3246b0f8  
    2929    return RTEMS_INVALID_ADDRESS;
    3030
    31   if ( !_TOD_Is_set )
     31  if ( !_TOD.is_set )
    3232    return RTEMS_NOT_DEFINED;
    3333
  • cpukit/rtems/src/clockgettod.c

    r50fc8f6 r3246b0f8  
    3434    return RTEMS_INVALID_ADDRESS;
    3535
    36   if ( !_TOD_Is_set )
     36  if ( !_TOD.is_set )
    3737    return RTEMS_NOT_DEFINED;
    3838
  • cpukit/rtems/src/clockgettodtimeval.c

    r50fc8f6 r3246b0f8  
    2929    return RTEMS_INVALID_ADDRESS;
    3030
    31   if ( !_TOD_Is_set )
     31  if ( !_TOD.is_set )
    3232    return RTEMS_NOT_DEFINED;
    3333
  • cpukit/rtems/src/taskwakewhen.c

    r50fc8f6 r3246b0f8  
    5252  Watchdog_Interval   seconds;
    5353
    54   if ( !_TOD_Is_set )
     54  if ( !_TOD.is_set )
    5555    return RTEMS_NOT_DEFINED;
    5656
  • cpukit/rtems/src/timerfirewhen.c

    r50fc8f6 r3246b0f8  
    5151  rtems_interval       seconds;
    5252
    53   if ( !_TOD_Is_set )
     53  if ( !_TOD.is_set )
    5454    return RTEMS_NOT_DEFINED;
    5555
  • cpukit/rtems/src/timerserverfirewhen.c

    r50fc8f6 r3246b0f8  
    5656    return RTEMS_INCORRECT_STATE;
    5757
    58   if ( !_TOD_Is_set )
     58  if ( !_TOD.is_set )
    5959    return RTEMS_NOT_DEFINED;
    6060
  • cpukit/score/include/rtems/score/tod.h

    r50fc8f6 r3246b0f8  
    124124
    125125/**
    126  *  @brief Is the Time Of Day Set
    127  *
    128  *  This is true if the application has set the current
    129  *  time of day, and false otherwise.
    130  */
    131 SCORE_EXTERN bool _TOD_Is_set;
    132 
    133 /**
    134  *  @brief Current Time of Day (Timespec)
    135  *
    136  *  The following contains the current time of day.
    137  */
    138 SCORE_EXTERN Timestamp_Control _TOD_Now;
    139 
    140 /**
    141  *  @brief Current Time of Day (Timespec)
    142  *
    143  *  The following contains the running uptime.
    144  */
    145 SCORE_EXTERN Timestamp_Control _TOD_Uptime;
     126 *  @brief TOD control.
     127 */
     128typedef struct {
     129  /**
     130   *  @brief Current time of day value.
     131   */
     132  Timestamp_Control now;
     133
     134  /**
     135   *  @brief System uptime.
     136   */
     137  Timestamp_Control uptime;
     138
     139  /**
     140   *  @brief Indicates if the time of day is set.
     141   *
     142   *  This is true if the application has set the current
     143   *  time of day, and false otherwise.
     144   */
     145  bool is_set;
     146} TOD_Control;
     147
     148SCORE_EXTERN TOD_Control _TOD;
    146149
    147150/**
     
    152155 */
    153156#define _TOD_Seconds_since_epoch() \
    154   _Timestamp_Get_seconds(&_TOD_Now)
     157  _Timestamp_Get_seconds(&_TOD.now)
    155158
    156159/**
  • cpukit/score/src/coretod.c

    r50fc8f6 r3246b0f8  
    3434{
    3535  /* POSIX format TOD (timespec) */
    36   _Timestamp_Set( &_TOD_Now, TOD_SECONDS_1970_THROUGH_1988, 0 );
     36  _Timestamp_Set( &_TOD.now, TOD_SECONDS_1970_THROUGH_1988, 0 );
    3737
    3838  /* Uptime (timespec) */
    39   _Timestamp_Set_to_zero( &_TOD_Uptime );
     39  _Timestamp_Set_to_zero( &_TOD.uptime );
    4040
    4141  /* TOD has not been set */
    42   _TOD_Is_set = false;
     42  _TOD.is_set = false;
    4343  _TOD_Activate();
    4444}
  • cpukit/score/src/coretodget.c

    r50fc8f6 r3246b0f8  
    3232  /* assume time checked for NULL by caller */
    3333
    34   /* _TOD_Now is the native current time */
     34  /* _TOD.now is the native current time */
    3535  _ISR_Disable( level );
    36     now = _TOD_Now;
     36    now = _TOD.now;
    3737    nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
    3838  _ISR_Enable( level );
  • cpukit/score/src/coretodgetuptime.c

    r50fc8f6 r3246b0f8  
    4343  /* assume time checked for NULL by caller */
    4444
    45   /* _TOD_Uptime is in native timestamp format */
     45  /* _TOD.uptime is in native timestamp format */
    4646  _ISR_Disable( level );
    47     up = _TOD_Uptime;
     47    up = _TOD.uptime;
    4848    nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
    4949  _ISR_Enable( level );
  • cpukit/score/src/coretodset.c

    r50fc8f6 r3246b0f8  
    3939    _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
    4040
    41   _TOD_Now = *tod;
    42   _TOD_Is_set = true;
     41  _TOD.now = *tod;
     42  _TOD.is_set = true;
    4343
    4444  _TOD_Activate();
  • cpukit/score/src/coretodtickle.c

    r50fc8f6 r3246b0f8  
    4545
    4646  /* Update the timespec format uptime */
    47   _Timestamp_Add_to( &_TOD_Uptime, &tick );
     47  _Timestamp_Add_to( &_TOD.uptime, &tick );
    4848  /* we do not care how much the uptime changed */
    4949
    5050  /* Update the timespec format TOD */
    51   seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick );
     51  seconds = _Timestamp_Add_to_at_tick( &_TOD.now, &tick );
    5252  while ( seconds ) {
    5353    _Watchdog_Tickle_seconds();
  • testsuites/sptests/spsize/size.c

    r50fc8f6 r3246b0f8  
    407407/*timer.h*/     (sizeof _Timer_Information)               +
    408408
    409 /*tod.h*/       (sizeof _TOD_Now)                         +
    410                 (sizeof _TOD_Uptime)                      +
     409/*tod.h*/       (sizeof _TOD.now)                         +
     410                (sizeof _TOD.uptime)                      +
    411411
    412412/*tqdata.h*/    0                                         +
Note: See TracChangeset for help on using the changeset viewer.