Changeset b56c1a3 in rtems
- Timestamp:
- 08/14/03 13:08:58 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 427c02c
- Parents:
- 41a53075
- Location:
- cpukit/posix
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/ChangeLog
r41a53075 rb56c1a3 1 2003-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 1 7 2003-07-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 8 -
cpukit/posix/Makefile.am
r41a53075 rb56c1a3 143 143 src/sigemptyset.c src/sigfillset.c src/sigismember.c src/sigpending.c src/sigprocmask.c \ 144 144 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 146 146 147 147 SEMAPHORE_C_FILES = src/semaphore.c src/semaphorecreatesupp.c src/semaphoredeletesupp.c \ … … 153 153 src/posixtimespectointerval.c src/posixintervaltotimespec.c src/clockgetcpuclockid.c \ 154 154 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 156 156 157 157 # the timer manager needs to be split further but only after its -
cpukit/posix/src/alarm.c
r41a53075 rb56c1a3 23 23 #include <rtems/posix/psignal.h> 24 24 25 Watchdog_Control _POSIX_signals_Alarm_timer; 26 27 /*PAGE 28 * 29 * _POSIX_signals_Alarm_TSR 30 */ 31 32 void _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 25 43 unsigned int alarm( 26 44 unsigned int seconds … … 32 50 the_timer = &_POSIX_signals_Alarm_timer; 33 51 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 */ 38 55 39 case WATCHDOG_ACTIVE:40 case WATCHDOG_REMOVE_IT:41 /*42 * The stop_time and start_time fields are snapshots of ticks since43 * boot. Since alarm() is dealing in seconds, we must account for44 * 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; 46 63 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 } 50 77 } 51 78 -
cpukit/posix/src/psignal.c
r41a53075 rb56c1a3 74 74 struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; 75 75 76 Watchdog_Control _POSIX_signals_Alarm_timer;77 78 76 Thread_queue_Control _POSIX_signals_Wait_queue; 79 77 … … 149 147 /*PAGE 150 148 * 151 * _POSIX_signals_Alarm_TSR152 */153 154 void _POSIX_signals_Alarm_TSR(155 Objects_Id id,156 void *argument157 )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 /*PAGE167 *168 149 * _POSIX_signals_Manager_Initialization 169 150 */ … … 176 157 177 158 /* 178 * Insure we have the same number of vectors and default vector entries159 * Ensure we have the same number of vectors and default vector entries 179 160 */ 180 161 … … 195 176 sigemptyset( &_POSIX_signals_Pending ); 196 177 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 NULL206 );207 208 178 /* 209 179 * Initialize the queue we use to block for signals
Note: See TracChangeset
for help on using the changeset viewer.