Changeset ff3c06a in rtems


Ignore:
Timestamp:
Oct 4, 2009, 10:08:43 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
bbb96ceb
Parents:
d05ec0f
Message:

2009-10-04 Joel Sherrill <joel.sherrill@…>

  • posix/include/rtems/posix/psignal.h: Add extern for ualarm timer.
  • posix/src/alarm.c, posix/src/ualarm.c: Change from switch to if since many enumerated values have no action.
  • posix/src/psignal.c: Initialize ualarm and alarm timers.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rd05ec0f rff3c06a  
     12009-10-04      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * posix/include/rtems/posix/psignal.h: Add extern for ualarm timer.
     4        * posix/src/alarm.c, posix/src/ualarm.c: Change from switch to if since
     5        many enumerated values have no action.
     6        * posix/src/psignal.c: Initialize ualarm and alarm timers.
     7
    182009-10-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    29
  • cpukit/posix/include/rtems/posix/psignal.h

    rd05ec0f rff3c06a  
    6363
    6464extern Watchdog_Control _POSIX_signals_Alarm_timer;
     65
     66extern Watchdog_Control _POSIX_signals_Ualarm_timer;
    6567
    6668extern Thread_queue_Control _POSIX_signals_Wait_queue;
  • cpukit/posix/src/alarm.c

    rd05ec0f rff3c06a  
    5757    _Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL );
    5858  } else {
    59     switch ( _Watchdog_Remove( the_timer ) ) {
    60       case WATCHDOG_INACTIVE:
    61       case WATCHDOG_BEING_INSERTED:
    62         break;
     59    Watchdog_States state;
    6360
    64       case WATCHDOG_ACTIVE:
    65       case WATCHDOG_REMOVE_IT:
    66         /*
    67          *  The stop_time and start_time fields are snapshots of ticks since
    68          *  boot.  Since alarm() is dealing in seconds, we must account for
    69          *  this.
    70          */
     61    state = _Watchdog_Remove( the_timer );
     62    if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
     63      /*
     64       *  The stop_time and start_time fields are snapshots of ticks since
     65       *  boot.  Since alarm() is dealing in seconds, we must account for
     66       *  this.
     67       */
    7168
    72         remaining = the_timer->initial -
    73          ((the_timer->stop_time - the_timer->start_time) /
    74            TOD_TICKS_PER_SECOND);
    75         break;
     69      remaining = the_timer->initial -
     70        ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
    7671    }
    7772  }
  • cpukit/posix/src/psignal.c

    rd05ec0f rff3c06a  
    215215    _Chain_Initialize_empty( &_POSIX_signals_Inactive_siginfo );
    216216  }
     217
     218  /*
     219   *  Initialize the Alarm Timer
     220   */
     221  _Watchdog_Initialize( &_POSIX_signals_Alarm_timer, NULL, 0, NULL );
     222  _Watchdog_Initialize( &_POSIX_signals_Ualarm_timer, NULL, 0, NULL );
    217223}
  • cpukit/posix/src/ualarm.c

    rd05ec0f rff3c06a  
    6767    _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
    6868  } else {
    69     switch ( _Watchdog_Remove( the_timer ) ) {
    70       case WATCHDOG_INACTIVE:
    71       case WATCHDOG_BEING_INSERTED:
    72         break;
     69    Watchdog_States state;
    7370
    74       case WATCHDOG_ACTIVE:
    75       case WATCHDOG_REMOVE_IT:
    76         /*
    77          *  The stop_time and start_time fields are snapshots of ticks since
    78          *  boot.  Since alarm() is dealing in seconds, we must account for
    79          *  this.
    80          */
     71    state = _Watchdog_Remove( the_timer );
     72    if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
     73      /*
     74       *  The stop_time and start_time fields are snapshots of ticks since
     75       *  boot.  Since alarm() is dealing in seconds, we must account for
     76       *  this.
     77       */
    8178
    82         ticks = the_timer->initial;
    83         ticks -= (the_timer->stop_time - the_timer->start_time);
    84         /* remaining is now in ticks */
     79      ticks = the_timer->initial;
     80      ticks -= (the_timer->stop_time - the_timer->start_time);
     81      /* remaining is now in ticks */
    8582
    86         _Timespec_From_ticks( ticks, &tp );
    87         remaining  = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
    88         remaining += tp.tv_nsec / 1000;
    89         break;
     83      _Timespec_From_ticks( ticks, &tp );
     84      remaining  = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
     85      remaining += tp.tv_nsec / 1000;
    9086    }
    9187  }
Note: See TracChangeset for help on using the changeset viewer.