Changeset 63b3dff5 in rtems for cpukit


Ignore:
Timestamp:
Aug 18, 2009, 3:35:51 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
7ca51e3
Parents:
7d414c3
Message:

2009-08-18 Joel Sherrill <joel.sherrill@…>

  • rtems/src/timerreset.c: Rework to ease analysis.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r7d414c3 r63b3dff5  
     12009-08-18      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * rtems/src/timerreset.c: Rework to ease analysis.
     4
    152009-08-17      Joel Sherrill <joel.sherrill@oarcorp.com>
    26
  • cpukit/rtems/src/timerreset.c

    r7d414c3 r63b3dff5  
    4646  Timer_Control     *the_timer;
    4747  Objects_Locations  location;
     48  rtems_status_code  status = RTEMS_SUCCESSFUL;
    4849
    4950  the_timer = _Timer_Get( id, &location );
     
    5152
    5253    case OBJECTS_LOCAL:
    53       switch ( the_timer->the_class ) {
    54         case TIMER_INTERVAL:
    55           _Watchdog_Remove( &the_timer->Ticker );
    56           _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
    57           break;
    58         case TIMER_INTERVAL_ON_TASK:
    59           /*
    60            *  There is no way for a timer to have this class unless
    61            *  it was scheduled as a server fire.  That requires that
    62            *  the Timer Server be initiated.  So this error cannot
    63            *  occur unless something is internally wrong.
    64            */
    65           #if defined(RTEMS_DEBUG)
    66             if ( !_Timer_Server_schedule_operation ) {
    67               _Thread_Enable_dispatch();
    68               return RTEMS_INCORRECT_STATE;
    69             }
    70           #endif
    71           _Watchdog_Remove( &the_timer->Ticker );
    72           (*_Timer_Server_schedule_operation)( the_timer );
    73           break;
    74         case TIMER_TIME_OF_DAY:
    75         case TIMER_TIME_OF_DAY_ON_TASK:
    76         case TIMER_DORMANT:
    77           _Thread_Enable_dispatch();
    78           return RTEMS_NOT_DEFINED;
     54      if ( the_timer->the_class == TIMER_INTERVAL ) {
     55        _Watchdog_Remove( &the_timer->Ticker );
     56        _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
     57      } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) {
     58        /*
     59         *  There is no way for a timer to have this class unless
     60         *  it was scheduled as a server fire.  That requires that
     61         *  the Timer Server be initiated.  So this error cannot
     62         *  occur unless something is internally wrong.
     63         */
     64        #if defined(RTEMS_DEBUG)
     65          if ( !_Timer_Server_schedule_operation ) {
     66            _Thread_Enable_dispatch();
     67            return RTEMS_INCORRECT_STATE;
     68          }
     69        #endif
     70        _Watchdog_Remove( &the_timer->Ticker );
     71        (*_Timer_Server_schedule_operation)( the_timer );
     72      } else {
     73        /*
     74         *  Must be dormant or time of day timer (e.g. TIMER_DORMANT,
     75         *  TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK).  We
     76         *  can only reset active interval timers.
     77         */
     78        status = RTEMS_NOT_DEFINED;
    7979      }
    8080      _Thread_Enable_dispatch();
    81       return RTEMS_SUCCESSFUL;
     81      return status;
    8282
    8383#if defined(RTEMS_MULTIPROCESSING)
Note: See TracChangeset for help on using the changeset viewer.