Changeset b56c1a3 in rtems


Ignore:
Timestamp:
Aug 14, 2003, 1:08:58 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
427c02c
Parents:
41a53075
Message:

2003-08-14 Joel Sherrill <joel@…>

PR 92/rtems

  • Makefile.am, src/alarm.c, src/psignal.c: Added ualarm() and usleep().
  • src/ualarm.c, src/usleep.c: New files.
Location:
cpukit/posix
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/ChangeLog

    r41a53075 rb56c1a3  
     12003-08-14      Joel Sherrill <joel@OARcorp.com>
     2
     3        PR 92/rtems
     4        * Makefile.am, src/alarm.c, src/psignal.c: Added ualarm() and usleep().
     5        * src/ualarm.c, src/usleep.c: New files.
     6
    172003-07-08      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • cpukit/posix/Makefile.am

    r41a53075 rb56c1a3  
    143143    src/sigemptyset.c src/sigfillset.c src/sigismember.c src/sigpending.c src/sigprocmask.c \
    144144    src/sigqueue.c src/sigsuspend.c src/sigtimedwait.c src/sigwait.c src/sigwaitinfo.c \
    145     src/signal_2.c
     145    src/signal_2.c src/ualarm.c
    146146
    147147SEMAPHORE_C_FILES = src/semaphore.c src/semaphorecreatesupp.c src/semaphoredeletesupp.c \
     
    153153    src/posixtimespectointerval.c src/posixintervaltotimespec.c src/clockgetcpuclockid.c \
    154154    src/clockgetenableattr.c src/clockgetres.c src/clockgettime.c src/clocksetenableattr.c \
    155     src/clocksettime.c src/nanosleep.c src/sleep.c
     155    src/clocksettime.c src/nanosleep.c src/sleep.c src/usleep.c
    156156
    157157# the timer manager needs to be split further but only after its
  • cpukit/posix/src/alarm.c

    r41a53075 rb56c1a3  
    2323#include <rtems/posix/psignal.h>
    2424
     25Watchdog_Control _POSIX_signals_Alarm_timer;
     26
     27/*PAGE
     28 *
     29 *  _POSIX_signals_Alarm_TSR
     30 */
     31 
     32void _POSIX_signals_Alarm_TSR(
     33  Objects_Id      id,
     34  void           *argument
     35)
     36{
     37  int status;
     38
     39  status = kill( getpid(), SIGALRM );
     40  /* XXX can't print from an ISR, should this be fatal? */
     41}
     42
    2543unsigned int alarm(
    2644  unsigned int seconds
     
    3250  the_timer = &_POSIX_signals_Alarm_timer;
    3351
    34   switch ( _Watchdog_Remove( the_timer ) ) {
    35     case WATCHDOG_INACTIVE:
    36     case WATCHDOG_BEING_INSERTED:
    37       break;
     52  /*
     53   *  Initialize the timer used to implement alarm().
     54   */
    3855
    39     case WATCHDOG_ACTIVE:
    40     case WATCHDOG_REMOVE_IT:
    41       /*
    42        *  The stop_time and start_time fields are snapshots of ticks since
    43        *  boot.  Since alarm() is dealing in seconds, we must account for
    44        *  this.
    45        */
     56  if ( !the_timer->routine ) {
     57    _Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL );
     58  } else {
     59    switch ( _Watchdog_Remove( the_timer ) ) {
     60      case WATCHDOG_INACTIVE:
     61      case WATCHDOG_BEING_INSERTED:
     62        break;
    4663
    47       remaining = the_timer->initial -
    48        ((the_timer->stop_time - the_timer->start_time) / _TOD_Ticks_per_second);
    49       break;
     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         */
     71
     72        remaining = the_timer->initial -
     73         ((the_timer->stop_time - the_timer->start_time) /
     74           _TOD_Ticks_per_second);
     75        break;
     76    }
    5077  }
    5178
  • cpukit/posix/src/psignal.c

    r41a53075 rb56c1a3  
    7474struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
    7575
    76 Watchdog_Control _POSIX_signals_Alarm_timer;
    77 
    7876Thread_queue_Control _POSIX_signals_Wait_queue;
    7977
     
    149147/*PAGE
    150148 *
    151  *  _POSIX_signals_Alarm_TSR
    152  */
    153  
    154 void _POSIX_signals_Alarm_TSR(
    155   Objects_Id      id,
    156   void           *argument
    157 )
    158 {
    159   int status;
    160 
    161   status = kill( getpid(), SIGALRM );
    162   /* XXX can't print from an ISR, should this be fatal? */
    163   assert( !status );
    164 }
    165 
    166 /*PAGE
    167  *
    168149 *  _POSIX_signals_Manager_Initialization
    169150 */
     
    176157
    177158  /*
    178    *  Insure we have the same number of vectors and default vector entries
     159   *  Ensure we have the same number of vectors and default vector entries
    179160   */
    180161
     
    195176  sigemptyset( &_POSIX_signals_Pending );
    196177
    197   /*
    198    *  Initialize the timer used to implement alarm().
    199    */
    200 
    201   _Watchdog_Initialize(
    202     &_POSIX_signals_Alarm_timer,
    203     _POSIX_signals_Alarm_TSR,
    204     0,
    205     NULL
    206   );
    207  
    208178  /*
    209179   *  Initialize the queue we use to block for signals
Note: See TracChangeset for help on using the changeset viewer.