From 2b3e9d9b244e279ef5693a7cf5dacc7903164af5 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Mon, 22 Jul 2002 09:46:48 +0000 Subject: Remove, moved to cpukit. --- c/src/exec/posix/.cvsignore | 14 - c/src/exec/posix/ChangeLog | 379 ---------- c/src/exec/posix/Makefile.am | 10 - c/src/exec/posix/configure.ac | 58 -- c/src/exec/posix/include/.cvsignore | 2 - c/src/exec/posix/include/Makefile.am | 55 -- c/src/exec/posix/include/aio.h | 145 ---- c/src/exec/posix/include/devctl.h | 38 - c/src/exec/posix/include/intr.h | 80 --- c/src/exec/posix/include/mqueue.h | 153 ---- c/src/exec/posix/include/rtems/.cvsignore | 2 - c/src/exec/posix/include/rtems/posix/.cvsignore | 2 - c/src/exec/posix/include/rtems/posix/cancel.h | 29 - c/src/exec/posix/include/rtems/posix/cond.h | 169 ----- c/src/exec/posix/include/rtems/posix/condmp.h | 161 ----- c/src/exec/posix/include/rtems/posix/config.h | 62 -- c/src/exec/posix/include/rtems/posix/intr.h | 153 ---- c/src/exec/posix/include/rtems/posix/key.h | 135 ---- c/src/exec/posix/include/rtems/posix/mqueue.h | 249 ------- c/src/exec/posix/include/rtems/posix/mqueuemp.h | 160 ----- c/src/exec/posix/include/rtems/posix/mutex.h | 158 ----- c/src/exec/posix/include/rtems/posix/mutexmp.h | 173 ----- c/src/exec/posix/include/rtems/posix/posixapi.h | 33 - c/src/exec/posix/include/rtems/posix/priority.h | 44 -- c/src/exec/posix/include/rtems/posix/psignal.h | 121 ---- c/src/exec/posix/include/rtems/posix/pthread.h | 150 ---- c/src/exec/posix/include/rtems/posix/pthreadmp.h | 160 ----- c/src/exec/posix/include/rtems/posix/ptimer.h | 91 --- c/src/exec/posix/include/rtems/posix/semaphore.h | 181 ----- c/src/exec/posix/include/rtems/posix/semaphoremp.h | 160 ----- c/src/exec/posix/include/rtems/posix/threadsup.h | 45 -- c/src/exec/posix/include/rtems/posix/time.h | 50 -- c/src/exec/posix/include/rtems/posix/timer.h | 71 -- c/src/exec/posix/include/sched.h | 96 --- c/src/exec/posix/include/semaphore.h | 116 --- c/src/exec/posix/inline/.cvsignore | 2 - c/src/exec/posix/inline/Makefile.am | 26 - c/src/exec/posix/inline/rtems/.cvsignore | 2 - c/src/exec/posix/inline/rtems/posix/.cvsignore | 2 - c/src/exec/posix/inline/rtems/posix/cond.inl | 79 --- c/src/exec/posix/inline/rtems/posix/intr.inl | 71 -- c/src/exec/posix/inline/rtems/posix/key.inl | 69 -- c/src/exec/posix/inline/rtems/posix/mqueue.inl | 150 ---- c/src/exec/posix/inline/rtems/posix/mutex.inl | 110 --- c/src/exec/posix/inline/rtems/posix/priority.inl | 37 - c/src/exec/posix/inline/rtems/posix/pthread.inl | 69 -- c/src/exec/posix/inline/rtems/posix/semaphore.inl | 85 --- c/src/exec/posix/inline/rtems/posix/timer.inl | 90 --- c/src/exec/posix/macros/.cvsignore | 2 - c/src/exec/posix/macros/Makefile.am | 26 - c/src/exec/posix/macros/rtems/.cvsignore | 2 - c/src/exec/posix/macros/rtems/posix/.cvsignore | 2 - c/src/exec/posix/macros/rtems/posix/cond.inl | 66 -- c/src/exec/posix/macros/rtems/posix/intr.inl | 55 -- c/src/exec/posix/macros/rtems/posix/key.inl | 54 -- c/src/exec/posix/macros/rtems/posix/mqueue.inl | 101 --- c/src/exec/posix/macros/rtems/posix/mutex.inl | 100 --- c/src/exec/posix/macros/rtems/posix/priority.inl | 25 - c/src/exec/posix/macros/rtems/posix/pthread.inl | 54 -- c/src/exec/posix/macros/rtems/posix/semaphore.inl | 64 -- c/src/exec/posix/macros/rtems/posix/timer.inl | 53 -- c/src/exec/posix/src/.cvsignore | 6 - c/src/exec/posix/src/Makefile.am | 116 --- c/src/exec/posix/src/README.mqueue | 38 - c/src/exec/posix/src/adasupp.c | 32 - c/src/exec/posix/src/aio.c | 118 --- c/src/exec/posix/src/alarm.c | 56 -- c/src/exec/posix/src/cancel.c | 62 -- c/src/exec/posix/src/cancelrun.c | 67 -- c/src/exec/posix/src/cleanuppop.c | 51 -- c/src/exec/posix/src/cleanuppush.c | 51 -- c/src/exec/posix/src/clockgetcpuclockid.c | 32 - c/src/exec/posix/src/clockgetenableattr.c | 32 - c/src/exec/posix/src/clockgetres.c | 55 -- c/src/exec/posix/src/clockgettime.c | 69 -- c/src/exec/posix/src/clocksetenableattr.c | 32 - c/src/exec/posix/src/clocksettime.c | 88 --- c/src/exec/posix/src/cond.c | 52 -- c/src/exec/posix/src/condattrdestroy.c | 35 - c/src/exec/posix/src/condattrgetpshared.c | 36 - c/src/exec/posix/src/condattrinit.c | 35 - c/src/exec/posix/src/condattrsetpshared.c | 43 -- c/src/exec/posix/src/condbroadcast.c | 30 - c/src/exec/posix/src/conddefaultattributes.c | 28 - c/src/exec/posix/src/conddestroy.c | 80 --- c/src/exec/posix/src/condinit.c | 99 --- c/src/exec/posix/src/condmp.c | 46 -- c/src/exec/posix/src/condsignal.c | 30 - c/src/exec/posix/src/condsignalsupp.c | 61 -- c/src/exec/posix/src/condtimedwait.c | 61 -- c/src/exec/posix/src/condwait.c | 36 - c/src/exec/posix/src/condwaitsupp.c | 108 --- c/src/exec/posix/src/devctl.c | 26 - c/src/exec/posix/src/execl.c | 21 - c/src/exec/posix/src/execle.c | 21 - c/src/exec/posix/src/execlp.c | 21 - c/src/exec/posix/src/execv.c | 20 - c/src/exec/posix/src/execve.c | 21 - c/src/exec/posix/src/execvp.c | 20 - c/src/exec/posix/src/fork.c | 18 - c/src/exec/posix/src/getegid.c | 33 - c/src/exec/posix/src/geteuid.c | 33 - c/src/exec/posix/src/getgid.c | 47 -- c/src/exec/posix/src/getgroups.c | 30 - c/src/exec/posix/src/getlogin.c | 64 -- c/src/exec/posix/src/getpagesize.c | 23 - c/src/exec/posix/src/getpgrp.c | 31 - c/src/exec/posix/src/getpid.c | 45 -- c/src/exec/posix/src/getppid.c | 29 - c/src/exec/posix/src/getuid.c | 47 -- c/src/exec/posix/src/intr.c | 349 --------- c/src/exec/posix/src/key.c | 46 -- c/src/exec/posix/src/keycreate.c | 90 --- c/src/exec/posix/src/keydelete.c | 58 -- c/src/exec/posix/src/keygetspecific.c | 47 -- c/src/exec/posix/src/keyrundestructors.c | 80 --- c/src/exec/posix/src/keysetspecific.c | 47 -- c/src/exec/posix/src/kill.c | 52 -- c/src/exec/posix/src/killinfo.c | 336 --------- c/src/exec/posix/src/mprotect.c | 23 - c/src/exec/posix/src/mqueue.c | 81 --- c/src/exec/posix/src/mqueueclose.c | 79 --- c/src/exec/posix/src/mqueuecreatesupp.c | 156 ---- c/src/exec/posix/src/mqueuedeletesupp.c | 74 -- c/src/exec/posix/src/mqueuegetattr.c | 80 --- c/src/exec/posix/src/mqueuenametoid.c | 66 -- c/src/exec/posix/src/mqueuenotify.c | 108 --- c/src/exec/posix/src/mqueueopen.c | 158 ----- c/src/exec/posix/src/mqueuereceive.c | 57 -- c/src/exec/posix/src/mqueuerecvsupp.c | 108 --- c/src/exec/posix/src/mqueuesend.c | 57 -- c/src/exec/posix/src/mqueuesendsupp.c | 117 --- c/src/exec/posix/src/mqueuesetattr.c | 82 --- c/src/exec/posix/src/mqueuetimedreceive.c | 58 -- c/src/exec/posix/src/mqueuetimedsend.c | 58 -- c/src/exec/posix/src/mqueuetranslatereturncode.c | 101 --- c/src/exec/posix/src/mqueueunlink.c | 84 --- c/src/exec/posix/src/mutex.c | 54 -- c/src/exec/posix/src/mutexattrdestroy.c | 38 - c/src/exec/posix/src/mutexattrgetprioceiling.c | 38 - c/src/exec/posix/src/mutexattrgetprotocol.c | 38 - c/src/exec/posix/src/mutexattrgetpshared.c | 38 - c/src/exec/posix/src/mutexattrinit.c | 37 - c/src/exec/posix/src/mutexattrsetprioceiling.c | 41 -- c/src/exec/posix/src/mutexattrsetprotocol.c | 46 -- c/src/exec/posix/src/mutexattrsetpshared.c | 46 -- c/src/exec/posix/src/mutexdefaultattributes.c | 34 - c/src/exec/posix/src/mutexdestroy.c | 87 --- c/src/exec/posix/src/mutexfromcorestatus.c | 52 -- c/src/exec/posix/src/mutexgetprioceiling.c | 55 -- c/src/exec/posix/src/mutexinit.c | 186 ----- c/src/exec/posix/src/mutexlock.c | 35 - c/src/exec/posix/src/mutexlocksupp.c | 67 -- c/src/exec/posix/src/mutexmp.c | 66 -- c/src/exec/posix/src/mutexsetprioceiling.c | 82 --- c/src/exec/posix/src/mutextimedlock.c | 40 -- c/src/exec/posix/src/mutextrylock.c | 35 - c/src/exec/posix/src/mutexunlock.c | 66 -- c/src/exec/posix/src/nanosleep.c | 104 --- c/src/exec/posix/src/pause.c | 41 -- c/src/exec/posix/src/posixintervaltotimespec.c | 38 - c/src/exec/posix/src/posixtimespecsubtract.c | 50 -- c/src/exec/posix/src/posixtimespectointerval.c | 42 -- c/src/exec/posix/src/psignal.c | 250 ------- c/src/exec/posix/src/psignalchecksignal.c | 94 --- c/src/exec/posix/src/psignalclearprocesssignals.c | 42 -- c/src/exec/posix/src/psignalclearsignals.c | 89 --- c/src/exec/posix/src/psignalsetprocesssignals.c | 42 -- c/src/exec/posix/src/psignalunblockthread.c | 93 --- c/src/exec/posix/src/pthread.c | 387 ---------- c/src/exec/posix/src/pthreadatfork.c | 31 - c/src/exec/posix/src/pthreadattrdestroy.c | 32 - c/src/exec/posix/src/pthreadattrgetdetachstate.c | 32 - c/src/exec/posix/src/pthreadattrgetinheritsched.c | 32 - c/src/exec/posix/src/pthreadattrgetschedparam.c | 31 - c/src/exec/posix/src/pthreadattrgetschedpolicy.c | 32 - c/src/exec/posix/src/pthreadattrgetscope.c | 31 - c/src/exec/posix/src/pthreadattrgetstackaddr.c | 31 - c/src/exec/posix/src/pthreadattrgetstacksize.c | 31 - c/src/exec/posix/src/pthreadattrinit.c | 33 - c/src/exec/posix/src/pthreadattrsetdetachstate.c | 38 - c/src/exec/posix/src/pthreadattrsetinheritsched.c | 41 -- c/src/exec/posix/src/pthreadattrsetschedparam.c | 31 - c/src/exec/posix/src/pthreadattrsetschedpolicy.c | 43 -- c/src/exec/posix/src/pthreadattrsetscope.c | 43 -- c/src/exec/posix/src/pthreadattrsetstackaddr.c | 31 - c/src/exec/posix/src/pthreadattrsetstacksize.c | 37 - c/src/exec/posix/src/pthreadcreate.c | 257 ------- c/src/exec/posix/src/pthreaddetach.c | 48 -- c/src/exec/posix/src/pthreadequal.c | 83 --- c/src/exec/posix/src/pthreadexit.c | 49 -- c/src/exec/posix/src/pthreadgetcpuclockid.c | 30 - c/src/exec/posix/src/pthreadgetcputime.c | 32 - c/src/exec/posix/src/pthreadgetschedparam.c | 59 -- c/src/exec/posix/src/pthreadjoin.c | 72 -- c/src/exec/posix/src/pthreadkill.c | 80 --- c/src/exec/posix/src/pthreadonce.c | 45 -- c/src/exec/posix/src/pthreadself.c | 27 - c/src/exec/posix/src/pthreadsetcputime.c | 39 - c/src/exec/posix/src/pthreadsetschedparam.c | 129 ---- c/src/exec/posix/src/pthreadsigmask.c | 73 -- c/src/exec/posix/src/ptimer.c | 102 --- c/src/exec/posix/src/ptimer1.c | 790 --------------------- c/src/exec/posix/src/sched.c | 157 ---- c/src/exec/posix/src/semaphore.c | 54 -- c/src/exec/posix/src/semaphorecreatesupp.c | 129 ---- c/src/exec/posix/src/semaphoredeletesupp.c | 65 -- c/src/exec/posix/src/semaphoremp.c | 146 ---- c/src/exec/posix/src/semaphorenametoid.c | 52 -- c/src/exec/posix/src/semaphorewaitsupp.c | 71 -- c/src/exec/posix/src/semclose.c | 55 -- c/src/exec/posix/src/semdestroy.c | 58 -- c/src/exec/posix/src/semgetvalue.c | 50 -- c/src/exec/posix/src/seminit.c | 51 -- c/src/exec/posix/src/semopen.c | 124 ---- c/src/exec/posix/src/sempost.c | 57 -- c/src/exec/posix/src/semtimedwait.c | 40 -- c/src/exec/posix/src/semtrywait.c | 35 - c/src/exec/posix/src/semunlink.c | 75 -- c/src/exec/posix/src/semwait.c | 35 - c/src/exec/posix/src/setcancelstate.c | 61 -- c/src/exec/posix/src/setcanceltype.c | 61 -- c/src/exec/posix/src/setpgid.c | 29 - c/src/exec/posix/src/setsid.c | 28 - c/src/exec/posix/src/sigaction.c | 94 --- c/src/exec/posix/src/sigaddset.c | 42 -- c/src/exec/posix/src/sigdelset.c | 47 -- c/src/exec/posix/src/sigemptyset.c | 36 - c/src/exec/posix/src/sigfillset.c | 36 - c/src/exec/posix/src/sigismember.c | 45 -- c/src/exec/posix/src/signal_2.c | 52 -- c/src/exec/posix/src/sigpending.c | 40 -- c/src/exec/posix/src/sigprocmask.c | 39 - c/src/exec/posix/src/sigqueue.c | 33 - c/src/exec/posix/src/sigsuspend.c | 45 -- c/src/exec/posix/src/sigtimedwait.c | 140 ---- c/src/exec/posix/src/sigwait.c | 45 -- c/src/exec/posix/src/sigwaitinfo.c | 34 - c/src/exec/posix/src/sleep.c | 31 - c/src/exec/posix/src/sysconf.c | 44 -- c/src/exec/posix/src/testcancel.c | 46 -- c/src/exec/posix/src/time.c | 52 -- c/src/exec/posix/src/types.c | 47 -- c/src/exec/posix/src/wait.c | 21 - c/src/exec/posix/src/waitpid.c | 23 - 245 files changed, 17361 deletions(-) delete mode 100644 c/src/exec/posix/.cvsignore delete mode 100644 c/src/exec/posix/ChangeLog delete mode 100644 c/src/exec/posix/Makefile.am delete mode 100644 c/src/exec/posix/configure.ac delete mode 100644 c/src/exec/posix/include/.cvsignore delete mode 100644 c/src/exec/posix/include/Makefile.am delete mode 100644 c/src/exec/posix/include/aio.h delete mode 100644 c/src/exec/posix/include/devctl.h delete mode 100644 c/src/exec/posix/include/intr.h delete mode 100644 c/src/exec/posix/include/mqueue.h delete mode 100644 c/src/exec/posix/include/rtems/.cvsignore delete mode 100644 c/src/exec/posix/include/rtems/posix/.cvsignore delete mode 100644 c/src/exec/posix/include/rtems/posix/cancel.h delete mode 100644 c/src/exec/posix/include/rtems/posix/cond.h delete mode 100644 c/src/exec/posix/include/rtems/posix/condmp.h delete mode 100644 c/src/exec/posix/include/rtems/posix/config.h delete mode 100644 c/src/exec/posix/include/rtems/posix/intr.h delete mode 100644 c/src/exec/posix/include/rtems/posix/key.h delete mode 100644 c/src/exec/posix/include/rtems/posix/mqueue.h delete mode 100644 c/src/exec/posix/include/rtems/posix/mqueuemp.h delete mode 100644 c/src/exec/posix/include/rtems/posix/mutex.h delete mode 100644 c/src/exec/posix/include/rtems/posix/mutexmp.h delete mode 100644 c/src/exec/posix/include/rtems/posix/posixapi.h delete mode 100644 c/src/exec/posix/include/rtems/posix/priority.h delete mode 100644 c/src/exec/posix/include/rtems/posix/psignal.h delete mode 100644 c/src/exec/posix/include/rtems/posix/pthread.h delete mode 100644 c/src/exec/posix/include/rtems/posix/pthreadmp.h delete mode 100644 c/src/exec/posix/include/rtems/posix/ptimer.h delete mode 100644 c/src/exec/posix/include/rtems/posix/semaphore.h delete mode 100644 c/src/exec/posix/include/rtems/posix/semaphoremp.h delete mode 100644 c/src/exec/posix/include/rtems/posix/threadsup.h delete mode 100644 c/src/exec/posix/include/rtems/posix/time.h delete mode 100644 c/src/exec/posix/include/rtems/posix/timer.h delete mode 100644 c/src/exec/posix/include/sched.h delete mode 100644 c/src/exec/posix/include/semaphore.h delete mode 100644 c/src/exec/posix/inline/.cvsignore delete mode 100644 c/src/exec/posix/inline/Makefile.am delete mode 100644 c/src/exec/posix/inline/rtems/.cvsignore delete mode 100644 c/src/exec/posix/inline/rtems/posix/.cvsignore delete mode 100644 c/src/exec/posix/inline/rtems/posix/cond.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/intr.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/key.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/mqueue.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/mutex.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/priority.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/pthread.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/semaphore.inl delete mode 100644 c/src/exec/posix/inline/rtems/posix/timer.inl delete mode 100644 c/src/exec/posix/macros/.cvsignore delete mode 100644 c/src/exec/posix/macros/Makefile.am delete mode 100644 c/src/exec/posix/macros/rtems/.cvsignore delete mode 100644 c/src/exec/posix/macros/rtems/posix/.cvsignore delete mode 100644 c/src/exec/posix/macros/rtems/posix/cond.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/intr.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/key.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/mqueue.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/mutex.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/priority.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/pthread.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/semaphore.inl delete mode 100644 c/src/exec/posix/macros/rtems/posix/timer.inl delete mode 100644 c/src/exec/posix/src/.cvsignore delete mode 100644 c/src/exec/posix/src/Makefile.am delete mode 100644 c/src/exec/posix/src/README.mqueue delete mode 100644 c/src/exec/posix/src/adasupp.c delete mode 100644 c/src/exec/posix/src/aio.c delete mode 100644 c/src/exec/posix/src/alarm.c delete mode 100644 c/src/exec/posix/src/cancel.c delete mode 100644 c/src/exec/posix/src/cancelrun.c delete mode 100644 c/src/exec/posix/src/cleanuppop.c delete mode 100644 c/src/exec/posix/src/cleanuppush.c delete mode 100644 c/src/exec/posix/src/clockgetcpuclockid.c delete mode 100644 c/src/exec/posix/src/clockgetenableattr.c delete mode 100644 c/src/exec/posix/src/clockgetres.c delete mode 100644 c/src/exec/posix/src/clockgettime.c delete mode 100644 c/src/exec/posix/src/clocksetenableattr.c delete mode 100644 c/src/exec/posix/src/clocksettime.c delete mode 100644 c/src/exec/posix/src/cond.c delete mode 100644 c/src/exec/posix/src/condattrdestroy.c delete mode 100644 c/src/exec/posix/src/condattrgetpshared.c delete mode 100644 c/src/exec/posix/src/condattrinit.c delete mode 100644 c/src/exec/posix/src/condattrsetpshared.c delete mode 100644 c/src/exec/posix/src/condbroadcast.c delete mode 100644 c/src/exec/posix/src/conddefaultattributes.c delete mode 100644 c/src/exec/posix/src/conddestroy.c delete mode 100644 c/src/exec/posix/src/condinit.c delete mode 100644 c/src/exec/posix/src/condmp.c delete mode 100644 c/src/exec/posix/src/condsignal.c delete mode 100644 c/src/exec/posix/src/condsignalsupp.c delete mode 100644 c/src/exec/posix/src/condtimedwait.c delete mode 100644 c/src/exec/posix/src/condwait.c delete mode 100644 c/src/exec/posix/src/condwaitsupp.c delete mode 100644 c/src/exec/posix/src/devctl.c delete mode 100644 c/src/exec/posix/src/execl.c delete mode 100644 c/src/exec/posix/src/execle.c delete mode 100644 c/src/exec/posix/src/execlp.c delete mode 100644 c/src/exec/posix/src/execv.c delete mode 100644 c/src/exec/posix/src/execve.c delete mode 100644 c/src/exec/posix/src/execvp.c delete mode 100644 c/src/exec/posix/src/fork.c delete mode 100644 c/src/exec/posix/src/getegid.c delete mode 100644 c/src/exec/posix/src/geteuid.c delete mode 100644 c/src/exec/posix/src/getgid.c delete mode 100644 c/src/exec/posix/src/getgroups.c delete mode 100644 c/src/exec/posix/src/getlogin.c delete mode 100644 c/src/exec/posix/src/getpagesize.c delete mode 100644 c/src/exec/posix/src/getpgrp.c delete mode 100644 c/src/exec/posix/src/getpid.c delete mode 100644 c/src/exec/posix/src/getppid.c delete mode 100644 c/src/exec/posix/src/getuid.c delete mode 100644 c/src/exec/posix/src/intr.c delete mode 100644 c/src/exec/posix/src/key.c delete mode 100644 c/src/exec/posix/src/keycreate.c delete mode 100644 c/src/exec/posix/src/keydelete.c delete mode 100644 c/src/exec/posix/src/keygetspecific.c delete mode 100644 c/src/exec/posix/src/keyrundestructors.c delete mode 100644 c/src/exec/posix/src/keysetspecific.c delete mode 100644 c/src/exec/posix/src/kill.c delete mode 100644 c/src/exec/posix/src/killinfo.c delete mode 100644 c/src/exec/posix/src/mprotect.c delete mode 100644 c/src/exec/posix/src/mqueue.c delete mode 100644 c/src/exec/posix/src/mqueueclose.c delete mode 100644 c/src/exec/posix/src/mqueuecreatesupp.c delete mode 100644 c/src/exec/posix/src/mqueuedeletesupp.c delete mode 100644 c/src/exec/posix/src/mqueuegetattr.c delete mode 100644 c/src/exec/posix/src/mqueuenametoid.c delete mode 100644 c/src/exec/posix/src/mqueuenotify.c delete mode 100644 c/src/exec/posix/src/mqueueopen.c delete mode 100644 c/src/exec/posix/src/mqueuereceive.c delete mode 100644 c/src/exec/posix/src/mqueuerecvsupp.c delete mode 100644 c/src/exec/posix/src/mqueuesend.c delete mode 100644 c/src/exec/posix/src/mqueuesendsupp.c delete mode 100644 c/src/exec/posix/src/mqueuesetattr.c delete mode 100644 c/src/exec/posix/src/mqueuetimedreceive.c delete mode 100644 c/src/exec/posix/src/mqueuetimedsend.c delete mode 100644 c/src/exec/posix/src/mqueuetranslatereturncode.c delete mode 100644 c/src/exec/posix/src/mqueueunlink.c delete mode 100644 c/src/exec/posix/src/mutex.c delete mode 100644 c/src/exec/posix/src/mutexattrdestroy.c delete mode 100644 c/src/exec/posix/src/mutexattrgetprioceiling.c delete mode 100644 c/src/exec/posix/src/mutexattrgetprotocol.c delete mode 100644 c/src/exec/posix/src/mutexattrgetpshared.c delete mode 100644 c/src/exec/posix/src/mutexattrinit.c delete mode 100644 c/src/exec/posix/src/mutexattrsetprioceiling.c delete mode 100644 c/src/exec/posix/src/mutexattrsetprotocol.c delete mode 100644 c/src/exec/posix/src/mutexattrsetpshared.c delete mode 100644 c/src/exec/posix/src/mutexdefaultattributes.c delete mode 100644 c/src/exec/posix/src/mutexdestroy.c delete mode 100644 c/src/exec/posix/src/mutexfromcorestatus.c delete mode 100644 c/src/exec/posix/src/mutexgetprioceiling.c delete mode 100644 c/src/exec/posix/src/mutexinit.c delete mode 100644 c/src/exec/posix/src/mutexlock.c delete mode 100644 c/src/exec/posix/src/mutexlocksupp.c delete mode 100644 c/src/exec/posix/src/mutexmp.c delete mode 100644 c/src/exec/posix/src/mutexsetprioceiling.c delete mode 100644 c/src/exec/posix/src/mutextimedlock.c delete mode 100644 c/src/exec/posix/src/mutextrylock.c delete mode 100644 c/src/exec/posix/src/mutexunlock.c delete mode 100644 c/src/exec/posix/src/nanosleep.c delete mode 100644 c/src/exec/posix/src/pause.c delete mode 100644 c/src/exec/posix/src/posixintervaltotimespec.c delete mode 100644 c/src/exec/posix/src/posixtimespecsubtract.c delete mode 100644 c/src/exec/posix/src/posixtimespectointerval.c delete mode 100644 c/src/exec/posix/src/psignal.c delete mode 100644 c/src/exec/posix/src/psignalchecksignal.c delete mode 100644 c/src/exec/posix/src/psignalclearprocesssignals.c delete mode 100644 c/src/exec/posix/src/psignalclearsignals.c delete mode 100644 c/src/exec/posix/src/psignalsetprocesssignals.c delete mode 100644 c/src/exec/posix/src/psignalunblockthread.c delete mode 100644 c/src/exec/posix/src/pthread.c delete mode 100644 c/src/exec/posix/src/pthreadatfork.c delete mode 100644 c/src/exec/posix/src/pthreadattrdestroy.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetdetachstate.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetinheritsched.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetschedparam.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetschedpolicy.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetscope.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetstackaddr.c delete mode 100644 c/src/exec/posix/src/pthreadattrgetstacksize.c delete mode 100644 c/src/exec/posix/src/pthreadattrinit.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetdetachstate.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetinheritsched.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetschedparam.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetschedpolicy.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetscope.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetstackaddr.c delete mode 100644 c/src/exec/posix/src/pthreadattrsetstacksize.c delete mode 100644 c/src/exec/posix/src/pthreadcreate.c delete mode 100644 c/src/exec/posix/src/pthreaddetach.c delete mode 100644 c/src/exec/posix/src/pthreadequal.c delete mode 100644 c/src/exec/posix/src/pthreadexit.c delete mode 100644 c/src/exec/posix/src/pthreadgetcpuclockid.c delete mode 100644 c/src/exec/posix/src/pthreadgetcputime.c delete mode 100644 c/src/exec/posix/src/pthreadgetschedparam.c delete mode 100644 c/src/exec/posix/src/pthreadjoin.c delete mode 100644 c/src/exec/posix/src/pthreadkill.c delete mode 100644 c/src/exec/posix/src/pthreadonce.c delete mode 100644 c/src/exec/posix/src/pthreadself.c delete mode 100644 c/src/exec/posix/src/pthreadsetcputime.c delete mode 100644 c/src/exec/posix/src/pthreadsetschedparam.c delete mode 100644 c/src/exec/posix/src/pthreadsigmask.c delete mode 100644 c/src/exec/posix/src/ptimer.c delete mode 100644 c/src/exec/posix/src/ptimer1.c delete mode 100644 c/src/exec/posix/src/sched.c delete mode 100644 c/src/exec/posix/src/semaphore.c delete mode 100644 c/src/exec/posix/src/semaphorecreatesupp.c delete mode 100644 c/src/exec/posix/src/semaphoredeletesupp.c delete mode 100644 c/src/exec/posix/src/semaphoremp.c delete mode 100644 c/src/exec/posix/src/semaphorenametoid.c delete mode 100644 c/src/exec/posix/src/semaphorewaitsupp.c delete mode 100644 c/src/exec/posix/src/semclose.c delete mode 100644 c/src/exec/posix/src/semdestroy.c delete mode 100644 c/src/exec/posix/src/semgetvalue.c delete mode 100644 c/src/exec/posix/src/seminit.c delete mode 100644 c/src/exec/posix/src/semopen.c delete mode 100644 c/src/exec/posix/src/sempost.c delete mode 100644 c/src/exec/posix/src/semtimedwait.c delete mode 100644 c/src/exec/posix/src/semtrywait.c delete mode 100644 c/src/exec/posix/src/semunlink.c delete mode 100644 c/src/exec/posix/src/semwait.c delete mode 100644 c/src/exec/posix/src/setcancelstate.c delete mode 100644 c/src/exec/posix/src/setcanceltype.c delete mode 100644 c/src/exec/posix/src/setpgid.c delete mode 100644 c/src/exec/posix/src/setsid.c delete mode 100644 c/src/exec/posix/src/sigaction.c delete mode 100644 c/src/exec/posix/src/sigaddset.c delete mode 100644 c/src/exec/posix/src/sigdelset.c delete mode 100644 c/src/exec/posix/src/sigemptyset.c delete mode 100644 c/src/exec/posix/src/sigfillset.c delete mode 100644 c/src/exec/posix/src/sigismember.c delete mode 100644 c/src/exec/posix/src/signal_2.c delete mode 100644 c/src/exec/posix/src/sigpending.c delete mode 100644 c/src/exec/posix/src/sigprocmask.c delete mode 100644 c/src/exec/posix/src/sigqueue.c delete mode 100644 c/src/exec/posix/src/sigsuspend.c delete mode 100644 c/src/exec/posix/src/sigtimedwait.c delete mode 100644 c/src/exec/posix/src/sigwait.c delete mode 100644 c/src/exec/posix/src/sigwaitinfo.c delete mode 100644 c/src/exec/posix/src/sleep.c delete mode 100644 c/src/exec/posix/src/sysconf.c delete mode 100644 c/src/exec/posix/src/testcancel.c delete mode 100644 c/src/exec/posix/src/time.c delete mode 100644 c/src/exec/posix/src/types.c delete mode 100644 c/src/exec/posix/src/wait.c delete mode 100644 c/src/exec/posix/src/waitpid.c (limited to 'c/src/exec/posix') diff --git a/c/src/exec/posix/.cvsignore b/c/src/exec/posix/.cvsignore deleted file mode 100644 index d29e5050f5..0000000000 --- a/c/src/exec/posix/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -missing -mkinstalldirs diff --git a/c/src/exec/posix/ChangeLog b/c/src/exec/posix/ChangeLog deleted file mode 100644 index 1e6184b3fa..0000000000 --- a/c/src/exec/posix/ChangeLog +++ /dev/null @@ -1,379 +0,0 @@ -2002-07-05 Joel Sherrill - - * include/rtems/posix/cancel.h, src/cancel.c, src/cancelrun.c, - src/mqueue.c, src/pthread.c, src/semaphore.c, src/setcancelstate.c, - src/setcanceltype.c, src/testcancel.c: Per PR164, corrected the - behavior of thread cancellation and did some cleanup as a side-effect. - -2002-07-05 Ralf Corsepius - - * configure.ac: RTEMS_TOP(../..). - -2002-07-01 Joel Sherrill - - * Mega patch merge to change the format of the object IDs to - loosen the dependency between the SCORE and the various APIs. - There was considerable work to simplify the object name management - and it appears that the name_table field is no longer needed. - This patch also includes the addition of the internal mutex - which is currently only used to protect some types of allocation - and deallocation. This significantly can reduce context - switch latency under certain circumstances. In particular, - some heap/region operations were O(n) and had dispatching - disabled. This should help enormously. With this merge, - the patch is not as clean as it should be. In particular, - the documentation has not been modified to reflect the new object - ID layout, the IDs in the test screens are not updated, and - _Objects_Get_information needs to be a real routine not inlined. - As part of this patch a lot of MP code for thread/proxy blocking - was made conditional and cleaned up. - * include/rtems/posix/key.h, src/cond.c, src/condinit.c, src/intr.c, - src/key.c, src/keycreate.c, src/keydelete.c, src/killinfo.c, - src/mqueue.c, src/mqueuecreatesupp.c, src/mutex.c, src/mutexinit.c, - src/psignal.c, src/pthread.c, src/semaphore.c, - src/semaphorecreatesupp.c: Modified as part of above. - -2002-07-01 Ralf Corsepius - - * configure.ac: Remove RTEMS_PROJECT_ROOT. - -2002-06-27 Ralf Corsepius - - * configure.ac: Use AC_CONFIG_AUX_DIR(../..). - Add AC_PROG_RANLIB. - -2002-06-26 Ralf Corsepius - - * configure.ac: Remove references to RTEMS_BSP. - * src/Makefile.am: Add libposix.a. - -2002-06-17 Ralf Corsepius - - * include/Makefile.am: Include $(top_srcdir)/../automake/*.am. - * Makefile.am: Include $(top_srcdir)/../automake/*.am. - Use ../aclocal. - * inline/Makefile.am: Include $(top_srcdir)/../automake/*.am. - * macros/Makefile.am: Include $(top_srcdir)/../automake/*.am. - * src/Makefile.am: Include $(top_srcdir)/../automake/*.am. - -2001-05-17 Joel Sherrill - - * macros/rtems/posix/mqueue.inl: Implemented missing routines - to support message queue FDs. - -2002-05-03 Ralf Corsepius - - * include/sys/utsname.h: Remove. - * include/Makefile.am: Reflect changes above. - * src/utsname.c: Remove. - * src/Makefile.am: Reflect changes above. - -2001-04-26 Joel Sherrill - - * include/rtems/posix/mqueue.h, inline/rtems/posix/mqueue.inl, - src/mqueue.c, src/mqueueclose.c, src/mqueuecreatesupp.c, - src/mqueuegetattr.c, src/mqueuenotify.c, src/mqueueopen.c, - src/mqueuerecvsupp.c, src/mqueuesendsupp.c, src/mqueuesetattr.c: - Per PR81 reworked to add a message queue descriptor separate from - the underlying message queue. This allows non-blocking to follow - the "open" not the underlying queue. - -2002-04-06 Ralf Corsepius - - * src/psignal.c: Include . - -2002-04-08 Chris Johns - - * Per PR142, make task switch extension its own list. - * src/pthread.c (_POSIX_Threads_User_extensions): Reflect above. - -2002-04-02 Ralf Corsepius - - * src/getegid.c: Remove . - * src/geteuid.c: Ditto. - * src/getgid.c: Ditto. - * src/getuid.c: Ditto. - * src/getlogin.c: Move . - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * src/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * include/Makefile.am: Remove AUTOMAKE_OPTIONS. - * inline/Makefile.am: Remove AUTOMAKE_OPTIONS. - * macros/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2002-03-01 Eric Norum - - * src/pthreadonce.c: Task is not preemptable while running a - pthread_once init function. This is slightly less heavy handed - than disabling dispatching and seems better than consuming a mutex. - -2002-02-09 Ralf Corsepius - - * src/getegid.c: Add #include . - Remove #include . - * src/geteuid.c: Ditto. - * src/getgid.c: Ditto. - * src/getlogin.c: Ditto. - * src/getuid.c: Ditto. - - -2001-01-16 Joel Sherrill - - * inline/rtems/posix/mutex.inl (_POSIX_Mutex_Get_support): Corrected - name of routine in header. - -2002-01-07 Joel Sherrill - - * optman/, optman/.cvsignore, optman/Makefile.am: Removed entire - contents of optman/ directory since it has been moved. - -2002-02-05 Ralf Corsepius - - * configure.ac: AC_CONFIG_SRCDIR([src/pthreads.c]) - * src/psignal.c: #include . - -2001-12-22 Ralf Corsepius - - * configure.ac: Remove optman/Makefile from CONFIG_FILES. - * Makefile.am: Remove optman from SUBDIRS. - -2001-12-19 Ralf Corsepius - - * optman/Makefile.am: Add multilib support. Remove ASM4FLAGS. - * src/Makefile.am: Add multilib support. - -2001-10-16 Ralf Corsepius - - * include/sys/Makefile.am: Remove. - * include/rtems/Makefile.am: Remove. - * include/rtems/posix/Makefile.am: Remove. - * include/Makefile.am: Handle subdirs. - * inline/rtems/Makefile.am: Remove. - * inline/rtems/posix/Makefile.am: Remove. - * inline/Makefile.am: Handle subdirs. - * macros/rtems/Makefile.am: Remove. - * macros/rtems/posix/Makefile.am: Remove. - * macros/Makefile.am: Handle subdirs. - * configure.ac: Reflect changes above. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-28 Joel Sherrill - - * src/mqueueopen.c, src/semopen.c: Clarify type on va_arg. - -2001-09-23 Ralf Corsepius - - * include/sys/Makefile.am: Use 'PREINSTALL_FILES ='. - * include/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. - * include/Makefile.am: Use 'PREINSTALL_FILES ='. - * inline/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. - * macros/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. - -2001-09-22 Ralf Corsepius - - * optman/Makefile.am: Adapt ASM4FLAGS to automake-1.5 happy. - * src/Makefile.am: Adapt INCLUDES to make automake-1.5 happy. - -2001-09-13 Joel Sherrill - - * src/sysconf.c: Fix typo syntax error accidentally committed. - -2001-09-13 Joel Sherrill - - * src/mprotect.c: New file. Stub required by some gcc's to pass tests. - In particular, about 350 ACATS tests fail if this is not present. - * src/getpagesize.c: Ditto. - * src/sysconf.c: Addition of Solaris value for _SC_STACK_PROT required - to pass about 350 ACATS test cases. - * src/Makefile.am: Added new files. - -2001-08-30 Joel Sherrill - - * macros/rtems/posix/mqueue.inl: Add cast so negation works. - -2001-08-16 Joel Sherrill - - * src/mqueuesendsupp.c: Account for possibly blocking during the - core send operation. - -2001-08-09 Joel Sherrill - - * src/mqueuesendsupp.c: Unblocking message queue operations should - NOT use _Thread_Executing for return status since it is permissible - to invoke message send operations from an ISR. This was reported - by Suvrat Gupta . - -2000-05-24 Fernando Ruiz Casas - - * src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c, - src/getuid.c: Now save their values in private user environment. - -2001-04-27 Ralf Corsepius - - * configure.in: Add [-ansi -fasm] to RTEMS_PROG_CC_FOR_TARGET. - -2001-03-19 Joel Sherrill - - * sys/utsname.h: Added C++ wrapper. - -2001-02-03 Ralf Corsepius - - * include/Makefile.am, include/rtems/posix/Makefile.am, - include/sys/Makefile.am, inline/rtems/posix/Makefile.am, - macros/rtems/posix/Makefile.am: - Apply include_*HEADERS instead of H_FILES. - -2001-01-24 Ralf Corsepius - - * configure.in: Add src/config.h - * src/Makefile.am: Add INCLUDES += -I. to pickup config.h - * src/.cvsignore: Add config.h and stamp-h - * src/*.c: Add config.h support. - -2001-01-23 Joel Sherrill - - * src/alarm.c: Eliminated use of C++ style comments. - -2001-01-12 Joel Sherrill - - * src/clockgetres.c: Fixed match problem. We are not converting - an interval to a timespec -- it is actually a real number of - microseconds. - -2001-01-22 Michael Hamel - - * include/rtems/posix/semaphore.h, inline/rtems/posix/semaphore.inl, - src/ptimer1.c, include/rtems/posix/semaphore.h, - inline/rtems/posix/semaphore.inl, src/alarm.c, src/ptimer1.c, - src/semaphorenametoid.c, src/semopen.c, src/semunlink.c: - Modifications to make CodeWarrior happy. - -2001-01-12 Joel Sherrill - - * src/README.mqueue: Enhanced example. - -2000-12-19 Joel Sherrill - - * src/pthreadgetschedparam.c: Do not set output parameters if - the pointers are NULL. - -2000-12-06 Joel Sherrill - - * src/pthreadgetcpuclockid.c: Add include of to - eliminate warning. - -2000-12-01 Joel Sherrill - - * include/rtems/posix/cond.h: #if 0'ed out prototype of - _POSIX_Condition_variables_Get to avoid conflict with macro - implementation. - -2000-12-01 Joel Sherrill - - * Added macro support to POSIX API. This is known to compile. - * macros/rtems/posix/cond.inl, macros/rtems/posix/intr.inl, - macros/rtems/posix/key.inl, macros/rtems/posix/mqueue.inl, - macros/rtems/posix/mutex.inl, macros/rtems/posix/priority.inl, - macros/rtems/posix/pthread.inl, macros/rtems/posix/semaphore.inl, - macros/rtems/posix/timer.inl: New files. - * configure.in: Removed error check for enabling macros. - * rtems/posix/mutex.h: #if 0'ed out prototypes for inlined routines - since you cannot have prototypes for macros. - * macros/rtems/posix/Makefile.am: Added files. - -2000-11-30 Joel Sherrill - - * inline/rtems/posix/mqueue.inl: Removed explicit dependency on abs(). - -2000-11-27 Joel Sherrill - - * src/sysconf.c: Add support for _SC_CLK_TCK and _SC_OPEN_MAX. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-30 Ralf Corsepius - - * configure.in: Cleanup comments. - -2000-10-30 Joel Sherrill - - * include/Makefile.am: Updated to reflect files merged into newlib. - This resulted in some definitions moving to other files and thus - some secondary effects in RTEMS source code. - * include/unistd.h: Removed. Now use newlib's. - * include/rtems/posix/mqueue.h: Add include of . - * include/rtems/posix/threadsup.h: Add include of - * src/execv.c: Corrected prototype to agree with newlib. - * src/execve.c: Corrected prototype to agree with newlib. - * src/execvp.c: Corrected prototype to agree with newlib. - * src/psignal.c: Rewrote reference to in comment since - that file no longer exists. - * src/pthreadkill.c: Added include of . - * src/sigaction.c: Added include of . - * src/sigtimedwait.c: Rewrote reference to in comment since - that file no longer exists. - -2000-10-25 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - -2000-09-04 Ralf Corsepius - - * src/Makefile.am, optman/Makefile.am: Include compile.am. - -2000-08-30 Joel Sherrill - - * Many files: Moved posix/include/rtems/posix/seterr.h to - score/include/rtems/seterr.h so it would be available within - all APIs. - -2000-08-25 Joel Sherrill - - * inline/rtems/posix/timer.inl, include/rtems/posix/timer.h, - inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the - style of src/ptimer1.c. Continued effort to make the - POSIX Timer implementation match that of other managers. - Added data structures required to use SuperCore Object Handler. - -2000-08-15 Joel Sherrill - - * src/ptimer1.c: Minor formatting fixes. - -2000-08-15 Joel Sherrill - - * src/ptimer1.c: Removed unused routine PRINT_ERRNO_S. - * src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S - and used structure copy instead. - * src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control. - * include/rtems/posix/timer.h: Ditto. - -2000-08-15 Joel Sherrill - - * src/ptimer1.c: Switched to using set_errno_and_return_minus_one() - to ensure that errno was always set. - -2000-08-15 Joel Sherrill - - * src/ptimer1.c (timer_settime): Converted use of rtems_clock_get - to use SuperCore _TOD_Current variable. - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/c/src/exec/posix/Makefile.am b/c/src/exec/posix/Makefile.am deleted file mode 100644 index e76b696b26..0000000000 --- a/c/src/exec/posix/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../aclocal - -SUBDIRS = include inline macros src - -include $(top_srcdir)/../automake/subdirs.am -include $(top_srcdir)/../automake/local.am diff --git a/c/src/exec/posix/configure.ac b/c/src/exec/posix/configure.ac deleted file mode 100644 index 608135484e..0000000000 --- a/c/src/exec/posix/configure.ac +++ /dev/null @@ -1,58 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.52) -AC_INIT([rtems-c-src-exec-posix],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([src/pthread.c]) -RTEMS_TOP(../..) -AC_CONFIG_AUX_DIR(../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.6]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_POSIX -RTEMS_ENABLE_INLINES - -RTEMS_ENV_RTEMSCPU - -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) -RTEMS_CANONICALIZE_TOOLS -AC_PROG_RANLIB - -RTEMS_CHECK_MULTIPROCESSING -RTEMS_CHECK_POSIX_API - -# If RTEMS macros are enabled, then use them. Otherwise, use inlines. -if test "$RTEMS_USE_MACROS" = "yes"; then - INLINEdir="macros" -else - INLINEdir="inline" -fi -AM_CONDITIONAL(INLINE,test "$INLINEdir" = "inline" ) -AM_CONDITIONAL(MACROS,test "$INLINEdir" = "macros" ) -AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes" ) - -## Needed when using automake for libs/rels -RTEMS_CHECK_NEWLIB - -## Refuse to build if bsp does not support libposix -if test "$HAS_POSIX_API" != "yes"; then -AC_MSG_ERROR([libposix is not supported by this configuration]) -fi - -AM_CONFIG_HEADER(src/config.h) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -src/Makefile -include/Makefile -inline/Makefile -macros/Makefile -]) -AC_OUTPUT diff --git a/c/src/exec/posix/include/.cvsignore b/c/src/exec/posix/include/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/include/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/include/Makefile.am b/c/src/exec/posix/include/Makefile.am deleted file mode 100644 index 46b1d374ca..0000000000 --- a/c/src/exec/posix/include/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -## -## $Id$ -## - - -$(PROJECT_INCLUDE): - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/sys: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/rtems/posix: - @$(mkinstalldirs) $@ - -$(PROJECT_INCLUDE)/%.h: %.h - $(INSTALL_DATA) $< $@ - -# include -noinst_HEADERS = devctl.h intr.h - -include_HEADERS = sched.h aio.h mqueue.h semaphore.h - -PREINSTALL_FILES = $(PROJECT_INCLUDE) \ - $(include_HEADERS:%=$(PROJECT_INCLUDE)/%) - -# rtems/posix - -include_rtems_posixdir = $(includedir)/rtems/posix - -MP_H_FILES = rtems/posix/condmp.h rtems/posix/mqueuemp.h rtems/posix/mutexmp.h \ - rtems/posix/pthreadmp.h rtems/posix/semaphoremp.h - -STD_H_FILES = rtems/posix/cancel.h rtems/posix/cond.h rtems/posix/config.h \ - rtems/posix/key.h rtems/posix/mqueue.h rtems/posix/mutex.h \ - rtems/posix/posixapi.h rtems/posix/priority.h rtems/posix/psignal.h \ - rtems/posix/pthread.h rtems/posix/ptimer.h rtems/posix/semaphore.h \ - rtems/posix/threadsup.h rtems/posix/time.h rtems/posix/timer.h \ - $(MP_H_FILES) - -noinst_HEADERS += rtems/posix/intr.h rtems/posix/threadsup.h - -if HAS_MP -include_rtems_posix_HEADERS = $(STD_H_FILES) $(MP_H_FILES) -else -include_rtems_posix_HEADERS = $(STD_H_FILES) -endif - -PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix \ - $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%) - -## General - -all-local: $(PREINSTALL_FILES) - -EXTRA_DIST = $(noinst_HEADERS) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/exec/posix/include/aio.h b/c/src/exec/posix/include/aio.h deleted file mode 100644 index 8fc18a59f2..0000000000 --- a/c/src/exec/posix/include/aio.h +++ /dev/null @@ -1,145 +0,0 @@ -/* aio.h - * - * $Id$ - */ - -#ifndef __POSIX_ASYNCHRONOUS_IO_h -#define __POSIX_ASYNCHRONOUS_IO_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_ASYNCHRONOUS_IO) - -/* - * 6.7.1 Data Definitions for Asynchronous Input and Output, - * P1003.1b-1993, p. 151 - */ - -#include -#include -#include -#include - -/* - * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153 - */ - -#define AIO_CANCELED 0 /* all requested operations have been canceled */ -#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */ - /* since they are in progress */ -#define AIO_ALLDONE 2 /* none of the requested operations could be */ - /* canceled since they are already complete */ - -/* lio_listio() options */ - -#define LIO_WAIT 0 /* calling process is to suspend until the */ - /* operation is complete */ -#define LIO_NOWAIT 1 /* calling process is to continue execution while */ - /* the operation is performed and no notification */ - /* shall be given when the operation is completed */ -#define LIO_READ 2 /* request a read() */ -#define LIO_WRITE 3 /* request a write() */ -#define LIO_NOP 4 /* no transfer is requested */ - -/* - * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151 - */ - -struct aiocb { - int aio_fildes; /* File descriptor */ - off_t aio_offset; /* File offset */ - volatile void *aio_buf; /* Location of buffer */ - size_t aio_nbytes; /* Length of transfer */ - int aio_reqprio; /* Request priority offset */ - struct sigevent aio_sigevent; /* Signal number and value */ - int aoi_lio_opcode; /* Operation to be performed */ -}; - -/* - * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154 - */ - -int aio_read( - struct aiocb *aiocbp -); - -/* - * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155 - */ - -int aio_write( - struct aiocb *aiocbp -); - -/* - * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158 - */ - -int lio_listio( - int mode, - struct aiocb * const list[], - int nent, - struct sigevent *sig -); - -/* - * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161 - */ - -int aio_error( - const struct aiocb *aiocbp -); - -/* - * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, - * P1003.1b-1993, p. 162 - */ - -int aio_return( - const struct aiocb *aiocbp -); - -/* - * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 - */ - -int aio_cancel( - int filedes, - struct aiocb *aiocbp -); - -/* - * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164 - */ - -int aio_suspend( - struct aiocb * const list[], - int nent, - const struct timespec *timeout -); - -#if defined(_POSIX_SYNCHRONIZED_IO) - -/* - * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166 - */ - -int aio_fsync( - int op, - struct aiocb *aiocbp -); - -#endif /* _POSIX_SYNCHRONIZED_IO */ - -#endif /* _POSIX_ASYNCHRONOUS_IO */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/devctl.h b/c/src/exec/posix/include/devctl.h deleted file mode 100644 index 85fca4cc11..0000000000 --- a/c/src/exec/posix/include/devctl.h +++ /dev/null @@ -1,38 +0,0 @@ -/* devctl.h - * - * $Id$ - */ - -#ifndef __POSIX_DEVICE_CONTROL_h -#define __POSIX_DEVICE_CONTROL_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_DEVICE_CONTROL) - -#include -#include - -/* - * 21.2.1 Control a Device, P1003.4b/D8, p. 65 - */ - -int devctl( - int filedes, - void *dev_data_ptr, - size_t nbyte, - int *dev_info_ptr -); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/intr.h b/c/src/exec/posix/include/intr.h deleted file mode 100644 index 48aaf64160..0000000000 --- a/c/src/exec/posix/include/intr.h +++ /dev/null @@ -1,80 +0,0 @@ -/* intr.h - * - * XXX: It is unclear if the type "intr_t" should be defined when - * _POSIX_INTERRUPT_CONTROL is not. - * - * $Id$ - */ - -#ifndef __POSIX_INTERRUPTS_h -#define __POSIX_INTERRUPTS_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#if defined(_POSIX_INTERRUPT_CONTROL) - -/* - * 22.2 Concepts, P1003.4b/D8, p. 73 - */ - -typedef int intr_t; - -/* - * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 - */ - -/* - * Return codes from an interrupt handler - */ - -#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */ - /* the thread that registered the */ - /* ISR that the interrupt occurred. */ -#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */ - /* do NOT perform notification. */ -#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */ - /* let the next handler try. */ - -int intr_capture( - intr_t intr, - int (*intr_handler)( void *area ), - volatile void *area, - size_t areasize -); - -int intr_release( - intr_t intr, - int (*intr_handler)( void *area ) -); - -int intr_lock( - intr_t intr -); - -int intr_unlock( - intr_t intr -); - -/* - * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 - */ - -int intr_timed_wait( - int flags, - const struct timespec *timeout -); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/mqueue.h b/c/src/exec/posix/include/mqueue.h deleted file mode 100644 index 8d117862ea..0000000000 --- a/c/src/exec/posix/include/mqueue.h +++ /dev/null @@ -1,153 +0,0 @@ -/* mqueue.h - * - * $Id$ - */ - -#ifndef __POSIX_MESSAGE_QUEUE_h -#define __POSIX_MESSAGE_QUEUE_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_MESSAGE_PASSING) - -#include - -#include -#include - -/* - * 15.1.1 Data Structures, P1003.1b-1993, p. 271 - */ - -typedef Objects_Id mqd_t; - -struct mq_attr { - long mq_flags; /* Message queue flags */ - long mq_maxmsg; /* Maximum number of messages */ - long mq_msgsize; /* Maximum message size */ - long mq_curmsgs; /* Number of messages currently queued */ -}; - -/* - * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272 - */ - -mqd_t mq_open( - const char *name, - int oflag, - ... -); - -/* - * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275 - */ - -int mq_close( - mqd_t mqdes -); - -/* - * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276 - */ - -int mq_unlink( - const char *name -); - -/* - * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend(). - */ - -int mq_send( - mqd_t mqdes, - const char *msg_ptr, - size_t msg_len, - unsigned int msg_prio -); - -#if defined(_POSIX_TIMEOUTS) - -#include - -int mq_timedsend( - mqd_t mqdes, - const char *msg_ptr, - size_t msg_len, - unsigned int msg_prio, - const struct timespec *timeout -); - -#endif /* _POSIX_TIMEOUTS */ - -/* - * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). - */ - -ssize_t mq_receive( - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio -); - -#if defined(_POSIX_TIMEOUTS) - -int mq_timedreceive( /* XXX: should this be ssize_t */ - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio, - const struct timespec *timeout -); - -#endif /* _POSIX_TIMEOUTS */ - -#if defined(_POSIX_REALTIME_SIGNALS) - -/* - * 15.2.6 Notify Process that a Message is Available on a Queue, - * P1003.1b-1993, p. 280 - */ - -int mq_notify( - mqd_t mqdes, - const struct sigevent *notification -); - -#endif /* _POSIX_REALTIME_SIGNALS */ - -/* - * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281 - */ - -int mq_setattr( - mqd_t mqdes, - const struct mq_attr *mqstat, - struct mq_attr *omqstat -); - -/* - * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283 - */ - -int mq_getattr( - mqd_t mqdes, - struct mq_attr *mqstat -); - -#endif /* _POSIX_MESSAGE_PASSING */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/rtems/.cvsignore b/c/src/exec/posix/include/rtems/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/include/rtems/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/include/rtems/posix/.cvsignore b/c/src/exec/posix/include/rtems/posix/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/include/rtems/posix/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/include/rtems/posix/cancel.h b/c/src/exec/posix/include/rtems/posix/cancel.h deleted file mode 100644 index 935912a298..0000000000 --- a/c/src/exec/posix/include/rtems/posix/cancel.h +++ /dev/null @@ -1,29 +0,0 @@ -/* rtems/posix/cancel.h - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CANCEL_h -#define __RTEMS_POSIX_CANCEL_h - -typedef struct { - Chain_Node Node; - void (*routine)( void * ); - void *arg; -} POSIX_Cancel_Handler_control; - -/* - * _POSIX_Threads_cancel_run - * - * DESCRIPTION: - * - * This support routine runs through the chain of cancel handlers that - * have been registered and executes them. - */ - -void _POSIX_Threads_cancel_run( - Thread_Control *the_thread -); - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/rtems/posix/cond.h b/c/src/exec/posix/include/rtems/posix/cond.h deleted file mode 100644 index 25e0fd96c2..0000000000 --- a/c/src/exec/posix/include/rtems/posix/cond.h +++ /dev/null @@ -1,169 +0,0 @@ -/* rtems/posix/cond.h - * - * This include file contains all the private support information for - * POSIX condition variables. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h -#define __RTEMS_POSIX_CONDITION_VARIABLES_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/* - * Constant to indicate condition variable does not currently have - * a mutex assigned to it. - */ - -#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0 - -/* - * Data Structure used to manage a POSIX condition variable - */ - -typedef struct { - Objects_Control Object; - int process_shared; - pthread_mutex_t Mutex; - Thread_queue_Control Wait_queue; -} POSIX_Condition_variables_Control; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information; - -/* - * The default condition variable attributes structure. - */ - -extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes; - -/* - * _POSIX_Condition_variables_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Condition_variables_Manager_initialization( - unsigned32 maximum_condition_variables -); - -/* - * _POSIX_Condition_variables_Allocate - * - * DESCRIPTION: - * - * This function allocates a condition variable control block from - * the inactive chain of free condition variable control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control * - _POSIX_Condition_variables_Allocate( void ); - -/* - * _POSIX_Condition_variables_Free - * - * DESCRIPTION: - * - * This routine frees a condition variable control block to the - * inactive chain of free condition variable control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free ( - POSIX_Condition_variables_Control *the_condition_variable -); - -/* - * _POSIX_Condition_variables_Get - * - * DESCRIPTION: - * - * This function maps condition variable IDs to condition variable control - * blocks. If ID corresponds to a local condition variable, then it returns - * the_condition variable control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the condition variable ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_condition variable is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_condition variable is undefined. - */ - -#if 0 -RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( - Objects_Id *id, - Objects_Locations *location -); -#endif - -/* - * _POSIX_Condition_variables_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_condition variable is NULL - * and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( - POSIX_Condition_variables_Control *the_condition_variable -); - -/* - * _POSIX_Condition_variables_Signal_support - * - * DESCRIPTION: - * - * A support routine which implements guts of the broadcast and single task - * wake up version of the "signal" operation. - */ - -int _POSIX_Condition_variables_Signal_support( - pthread_cond_t *cond, - boolean is_broadcast -); - -/* - * _POSIX_Condition_variables_Wait_support - * - * DESCRIPTION: - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of condition variable wait routines. - */ - -int _POSIX_Condition_variables_Wait_support( - pthread_cond_t *cond, - pthread_mutex_t *mutex, - Watchdog_Interval timeout, - boolean already_timedout -); - -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/condmp.h b/c/src/exec/posix/include/rtems/posix/condmp.h deleted file mode 100644 index dfd10e57a3..0000000000 --- a/c/src/exec/posix/include/rtems/posix/condmp.h +++ /dev/null @@ -1,161 +0,0 @@ -/* condmp.h - * - * This include file contains all the constants and structures associated - * with the Multiprocessing Support in the POSIX Condition Variable Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_MP_h -#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -/* - * The following enumerated type defines the list of - * remote condition variable operations. - */ - -typedef enum { - POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0, - POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1, - POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2, - POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3, - POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4, - POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5, - POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6, -} POSIX_Condition_variables_MP_Remote_operations; - -/* - * The following data structure defines the packet used to perform - * remote condition variable operations. - */ - -typedef struct { - MP_packet_Prefix Prefix; - POSIX_Condition_variables_MP_Remote_operations operation; - Objects_Name name; - boolean wait; /* XXX options */ - Objects_Id proxy_id; -} POSIX_Condition_variables_MP_Packet; - -/* - * _POSIX_Condition_variables_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Condition_variables_MP_Send_process_packet ( - POSIX_Condition_variables_MP_Remote_operations operation, - Objects_Id condition_variables_id, - Objects_Name name, - Objects_Id proxy_id -); - -/* - * _POSIX_Condition_variables_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Condition_variables_MP_Send_request_packet ( - POSIX_Condition_variables_MP_Remote_operations operation, - Objects_Id condition_variables_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -); - -/* - * _POSIX_Condition_variables_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Condition_variables_MP_Send_response_packet ( - POSIX_Condition_variables_MP_Remote_operations operation, - Objects_Id condition_variables_id, - Thread_Control *the_thread -); - -/* - * - * _POSIX_Condition_variables_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Condition_variables_MP_Process_packet ( - MP_packet_Prefix *the_packet_prefix -); - -/* - * _POSIX_Condition_variables_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Condition_variables_MP_Send_object_was_deleted ( - Thread_Control *the_proxy -); - -/* - * _POSIX_Condition_variables_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Condition_variables_MP_Send_extract_proxy ( - Thread_Control *the_thread -); - -/* - * _POSIX_Condition_variables_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a condition variable mp packet. - */ - -POSIX_Condition_variables_MP_Packet - *_POSIX_Condition_variables_MP_Get_packet ( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/config.h b/c/src/exec/posix/include/rtems/posix/config.h deleted file mode 100644 index 6725d12e09..0000000000 --- a/c/src/exec/posix/include/rtems/posix/config.h +++ /dev/null @@ -1,62 +0,0 @@ -/* config.h - * - * This include file contains the table of user defined configuration - * parameters specific for the POSIX API. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CONFIGURATION_h -#define __RTEMS_POSIX_CONFIGURATION_h - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * XXX - * - * The following records define the Configuration Table. The - * information contained in this table is required in all - * RTEMS systems, whether single or multiprocessor. This - * table primarily defines the following: - * - * + required number of each object type - */ - -/* - * For now, we are only allowing the user to specify the entry point - * and stack size for POSIX initialization threads. - */ - -typedef struct { - void *(*thread_entry)(void *); - int stack_size; -} posix_initialization_threads_table; - -typedef struct { - int maximum_threads; - int maximum_mutexes; - int maximum_condition_variables; - int maximum_keys; - int maximum_timers; - int maximum_queued_signals; - int maximum_message_queues; - int maximum_semaphores; - int number_of_initialization_threads; - posix_initialization_threads_table *User_initialization_threads_table; -} posix_api_configuration_table; - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/rtems/posix/intr.h b/c/src/exec/posix/include/rtems/posix/intr.h deleted file mode 100644 index 0dcadd6722..0000000000 --- a/c/src/exec/posix/include/rtems/posix/intr.h +++ /dev/null @@ -1,153 +0,0 @@ -/* rtems/posix/intr.h - * - * This include file contains all the private support information for - * POSIX Interrupt Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_KEY_h -#define __RTEMS_POSIX_KEY_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/* - * Data Structure used to manage each POSIX Interrupt Vector - */ - -typedef struct { - int number_installed; - int lock_count; - int deferred_count; - Chain_Control Handlers; -} POSIX_Interrupt_Control; - -/* - * Data Structure used to manage a POSIX Interrupt Handler - */ - -typedef struct { - Objects_Control Object; - int is_active; - intr_t vector; - Thread_Control *server; - int (*handler)( void *area ); - volatile void *user_data_area; -} POSIX_Interrupt_Handler_control; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information; - -/* - * The following is an array which is used to manage the set of - * interrupt handlers installed on each vector. - */ - -POSIX_EXTERN POSIX_Interrupt_Control - _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ]; - -/* - * _POSIX_Interrupt_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Interrupt_Manager_initialization( - unsigned32 maximum_interrupt_handlers -); - -/* - * _POSIX_Interrupt_Allocate - * - * DESCRIPTION: - * - * This function allocates a interrupt handler control block from - * the inactive chain of free interrupt handler control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control * - _POSIX_Interrupt_Allocate( void ); - -/* - * _POSIX_Interrupt_Free - * - * DESCRIPTION: - * - * This routine frees a interrupt handler control block to the - * inactive chain of free interrupt handler control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free ( - POSIX_Interrupt_Handler_control *the_intr -); - -/* - * _POSIX_Interrupt_Get - * - * DESCRIPTION: - * - * This function maps interrupt handler IDs to interrupt handler control - * blocks. If ID corresponds to a local interrupt handler, then it returns - * the_intr control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the interrupt handler ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_intr is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_intr is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get ( - Objects_Id id, - Objects_Locations *location -); - -/* - * _POSIX_Interrupt_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_intr is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null ( - POSIX_Interrupt_Handler_control *the_intr -); - -/* - * _POSIX_Interrupt_Handler - * - * DESCRIPTION: - * - * This function XXX. - */ - -void _POSIX_Interrupt_Handler( - ISR_Vector_number vector -); - -#include - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/key.h b/c/src/exec/posix/include/rtems/posix/key.h deleted file mode 100644 index b45539baae..0000000000 --- a/c/src/exec/posix/include/rtems/posix/key.h +++ /dev/null @@ -1,135 +0,0 @@ -/* rtems/posix/key.h - * - * This include file contains all the private support information for - * POSIX key. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_KEY_h -#define __RTEMS_POSIX_KEY_h - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Data Structure used to manage a POSIX key - * - * NOTE: The Values is a table indexed by the index portion of the - * ID of the currently executing thread. - */ - -typedef struct { - Objects_Control Object; - boolean is_active; - void (*destructor)( void * ); - void **Values[ OBJECTS_APIS_LAST + 1 ]; -} POSIX_Keys_Control; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Keys_Information; - -/* - * _POSIX_Keys_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Key_Manager_initialization( - unsigned32 maximum_keys -); - -/* - * _POSIX_Keys_Run_destructors - * - * DESCRIPTION: - * - * This function executes all the destructors associated with the thread's - * keys. This function will execute until all values have been set to NULL. - * - * NOTE: This is the routine executed when a thread exits to - * run through all the keys and do the destructor action. - */ - -void _POSIX_Keys_Run_destructors( - Thread_Control *thread -); - -/* - * _POSIX_Keys_Allocate - * - * DESCRIPTION: - * - * This function allocates a keys control block from - * the inactive chain of free keys control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ); - -/* - * _POSIX_Keys_Free - * - * DESCRIPTION: - * - * This routine frees a keys control block to the - * inactive chain of free keys control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( - POSIX_Keys_Control *the_key -); - -/* - * _POSIX_Keys_Get - * - * DESCRIPTION: - * - * This function maps key IDs to key control blocks. - * If ID corresponds to a local keys, then it returns - * the_key control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the keys ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_key is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_key is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( - Objects_Id id, - Objects_Locations *location -); - -/* - * _POSIX_Keys_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_key is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null ( - POSIX_Keys_Control *the_key -); - -#include - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/mqueue.h b/c/src/exec/posix/include/rtems/posix/mqueue.h deleted file mode 100644 index 076ea1d6c2..0000000000 --- a/c/src/exec/posix/include/rtems/posix/mqueue.h +++ /dev/null @@ -1,249 +0,0 @@ -/* rtems/posix/mqueue.h - * - * This include file contains all the private support information for - * POSIX Message Queues. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h -#define __RTEMS_POSIX_MESSAGE_QUEUE_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -/* - * Data Structure used to manage a POSIX message queue - */ - -typedef struct { - Objects_Control Object; - int process_shared; - boolean named; - boolean linked; - unsigned32 open_count; - CORE_message_queue_Control Message_queue; - struct sigevent notification; -} POSIX_Message_queue_Control; - -typedef struct { - Objects_Control Object; - POSIX_Message_queue_Control *Queue; - int oflag; -} POSIX_Message_queue_Control_fd; - -/* - * The following defines the information control block used to manage - * this class of objects. The second item is used to manage the set - * of "file descriptors" associated with the message queues. - */ - -POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information; -POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds; - -/* - * _POSIX_Message_queue_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Message_queue_Manager_initialization( - unsigned32 maximum_message_queues -); - -/* - * - * _POSIX_Message_queue_Create_support - * - * DESCRIPTION: - * - * This routine performs the creation of a message queue utilizing the - * core message queue. - */ - -int _POSIX_Message_queue_Create_support( - const char *name, - int pshared, - struct mq_attr *attr, - POSIX_Message_queue_Control **message_queue -); - -/* - * _POSIX_Message_queue_Delete - * - * DESCRIPTION: - * - * This routine supports the mq_unlink and mq_close routines by - * doing most of the work involved with removing a message queue. - */ - -void _POSIX_Message_queue_Delete( - POSIX_Message_queue_Control *the_mq -); - -/* - * _POSIX_Message_queue_Receive_support - * - * DESCRIPTION: - * - * This routine supports the various flavors of receiving a message. - */ - -ssize_t _POSIX_Message_queue_Receive_support( - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio, - Watchdog_Interval timeout -); - -/* - * _POSIX_Message_queue_Send_support - * - * DESCRIPTION: - * - * This routine posts a message to a specified message queue. - */ - -int _POSIX_Message_queue_Send_support( - mqd_t mqdes, - const char *msg_ptr, - unsigned32 msg_len, - unsigned32 msg_prio, - Watchdog_Interval timeout -); - -/* - * _POSIX_Message_queue_Allocate - * - * DESCRIPTION: - * - * This function allocates a message queue control block from - * the inactive chain of free message queue control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ); - -/* - * _POSIX_Message_queue_Free - * - * DESCRIPTION: - * - * This routine frees a message queue control block to the - * inactive chain of free message queue control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( - POSIX_Message_queue_Control *the_mq -); - -/* - * _POSIX_Message_queue_Get - * - * DESCRIPTION: - * - * This function maps message queue IDs to message queue control blocks. - * If ID corresponds to a local message queue, then it returns - * the_mq control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the message queue ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_message queue is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_mq is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( - Objects_Id id, - Objects_Locations *location -); - -/* - * _POSIX_Message_queue_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_message_queue is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null ( - POSIX_Message_queue_Control *the_mq -); - -/* - * _POSIX_Message_queue_Name_to_id - * - * DESCRIPTION: - * - * This routine looks up the specified name for a message queue and returns the - * id of the message queue associated with it. - */ - -int _POSIX_Message_queue_Name_to_id( - const char *name, - Objects_Id *id -); - -/* - * _POSIX_Message_queue_Priority_to_core - * - * DESCRIPTION: - * - * XXX - */ - -RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core( - unsigned int priority -); - -/* - * _POSIX_Message_queue_Priority_from_core - * - * DESCRIPTION: - * - * XXX - */ - -RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( - CORE_message_queue_Submit_types priority -); - -/*PAGE - * - * _POSIX_Message_queue_Translate_core_message_queue_return_code - * - * DESCRIPTION: - * - * XXX - */ - -int _POSIX_Message_queue_Translate_core_message_queue_return_code( - unsigned32 the_message_queue_status -); - - -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/mqueuemp.h b/c/src/exec/posix/include/rtems/posix/mqueuemp.h deleted file mode 100644 index 19fb58ea29..0000000000 --- a/c/src/exec/posix/include/rtems/posix/mqueuemp.h +++ /dev/null @@ -1,160 +0,0 @@ -/* mqueuemp.h - * - * This include file contains all the constants and structures associated - * with the Multiprocessing Support in the POSIX Message Queue Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_MP_h -#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -/* - * The following enumerated type defines the list of - * remote message queue operations. - */ - -typedef enum { - POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, - POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, - POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, - POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3, - POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4, - POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5, - POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6, -} POSIX_Message_queue_MP_Remote_operations; - -/* - * The following data structure defines the packet used to perform - * remote message queue operations. - */ - -typedef struct { - MP_packet_Prefix Prefix; - POSIX_Message_queue_MP_Remote_operations operation; - Objects_Name name; - boolean wait; /* XXX options */ - Objects_Id proxy_id; -} POSIX_Message_queue_MP_Packet; - -/* - * _POSIX_Message_queue_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Message_queue_MP_Send_process_packet ( - POSIX_Message_queue_MP_Remote_operations operation, - Objects_Id mq_id, - Objects_Name name, - Objects_Id proxy_id -); - -/* - * _POSIX_Message_queue_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Message_queue_MP_Send_request_packet ( - POSIX_Message_queue_MP_Remote_operations operation, - Objects_Id mq_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -); - -/* - * _POSIX_Message_queue_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Message_queue_MP_Send_response_packet ( - POSIX_Message_queue_MP_Remote_operations operation, - Objects_Id mq_id, - Thread_Control *the_thread -); - -/* - * - * _POSIX_Message_queue_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Message_queue_MP_Process_packet ( - MP_packet_Prefix *the_packet_prefix -); - -/* - * _POSIX_Message_queue_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Message_queue_MP_Send_object_was_deleted ( - Thread_Control *the_proxy -); - -/* - * _POSIX_Message_queue_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Message_queue_MP_Send_extract_proxy ( - Thread_Control *the_thread -); - -/* - * _POSIX_Message_queue_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a message queue mp packet. - */ - -POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/mutex.h b/c/src/exec/posix/include/rtems/posix/mutex.h deleted file mode 100644 index 3d716cdc29..0000000000 --- a/c/src/exec/posix/include/rtems/posix/mutex.h +++ /dev/null @@ -1,158 +0,0 @@ -/* rtems/posix/mutex.h - * - * This include file contains all the private support information for - * POSIX mutex's. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MUTEX_h -#define __RTEMS_POSIX_MUTEX_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/* - * Data Structure used to manage a POSIX mutex - */ - -typedef struct { - Objects_Control Object; - int process_shared; - CORE_mutex_Control Mutex; -} POSIX_Mutex_Control; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Mutex_Information; - -/* - * The default mutex attributes structure. - */ - -extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes; - -/* - * _POSIX_Mutex_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Mutex_Manager_initialization( - unsigned32 maximum_mutexes -); - -/* - * _POSIX_Mutex_Allocate - * - * DESCRIPTION: - * - * This function allocates a mutexes control block from - * the inactive chain of free mutexes control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ); - -/* - * _POSIX_Mutex_Free - * - * DESCRIPTION: - * - * This routine frees a mutexes control block to the - * inactive chain of free mutexes control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( - POSIX_Mutex_Control *the_mutex -); - -#if 0 -/* - * _POSIX_Mutex_Get - * - * DESCRIPTION: - * - * This function maps mutexes IDs to mutexes control blocks. - * If ID corresponds to a local mutexes, then it returns - * the_mutex control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the mutexes ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_mutex is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_mutex is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get ( - Objects_Id *id, - Objects_Locations *location -); - -/* - * _POSIX_Mutex_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_mutex is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( - POSIX_Mutex_Control *the_mutex -); -#endif - -/* - * _POSIX_Mutex_Lock_support - * - * DESCRIPTION: - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of mutex lock. - */ - -int _POSIX_Mutex_Lock_support( - pthread_mutex_t *mutex, - boolean blocking, - Watchdog_Interval timeout -); - -/* - * _POSIX_Mutex_From_core_mutex_status - * - * DESCRIPTION: - * - * A support routine which converts core mutex status codes into the - * appropriate POSIX status values. - */ - -int _POSIX_Mutex_From_core_mutex_status( - CORE_mutex_Status status -); - - -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/mutexmp.h b/c/src/exec/posix/include/rtems/posix/mutexmp.h deleted file mode 100644 index 4d0f074f98..0000000000 --- a/c/src/exec/posix/include/rtems/posix/mutexmp.h +++ /dev/null @@ -1,173 +0,0 @@ -/* mutexmp.h - * - * This include file contains all the constants and structures associated - * with the Multiprocessing Support in the POSIX Mutex Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MUTEX_MP_h -#define __RTEMS_POSIX_MUTEX_MP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -/* - * The following enumerated type defines the list of - * remote mutex operations. - */ - -typedef enum { - POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0, - POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1, - POSIX_MUTEX_MP_EXTRACT_PROXY = 2, - POSIX_MUTEX_MP_OBTAIN_REQUEST = 3, - POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4, - POSIX_MUTEX_MP_RELEASE_REQUEST = 5, - POSIX_MUTEX_MP_RELEASE_RESPONSE = 6, -} POSIX_Mutex_MP_Remote_operations; - -/* - * The following data structure defines the packet used to perform - * remote mutex operations. - */ - -typedef struct { - MP_packet_Prefix Prefix; - POSIX_Mutex_MP_Remote_operations operation; - Objects_Name name; - boolean wait; /* XXX options */ - Objects_Id proxy_id; -} POSIX_Mutex_MP_Packet; - -/* - * _POSIX_Mutex_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Mutex_MP_Send_process_packet ( - POSIX_Mutex_MP_Remote_operations operation, - Objects_Id mutex_id, - Objects_Name name, - Objects_Id proxy_id -); - -/* - * _POSIX_Mutex_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Mutex_MP_Send_request_packet ( - POSIX_Mutex_MP_Remote_operations operation, - Objects_Id mutex_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -); - -/* - * _POSIX_Mutex_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Mutex_MP_Send_response_packet ( - POSIX_Mutex_MP_Remote_operations operation, - Objects_Id mutex_id, - Thread_Control *the_thread -); - -/* - * - * _POSIX_Mutex_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Mutex_MP_Process_packet ( - MP_packet_Prefix *the_packet_prefix -); - -/* - * _POSIX_Mutex_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Mutex_MP_Send_object_was_deleted ( - Thread_Control *the_proxy -); - -/* - * _POSIX_Mutex_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Mutex_MP_Send_extract_proxy ( - Thread_Control *the_thread -); - -/* - * _POSIX_Threads_mutex_MP_support - * - * DESCRIPTION: - * - * This routine XXX - */ - -void _POSIX_Threads_mutex_MP_support( - Thread_Control *the_thread, - Objects_Id id -); - -/* - * _POSIX_Mutex_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a mutex mp packet. - */ - -POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/posixapi.h b/c/src/exec/posix/include/rtems/posix/posixapi.h deleted file mode 100644 index 13c416ef90..0000000000 --- a/c/src/exec/posix/include/rtems/posix/posixapi.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * POSIX API Support - * - * NOTE: - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __POSIX_API_h -#define __POSIX_API_h - -#include - -/*PAGE - * - * _POSIX_API_Initialize - * - * XXX - */ - -void _POSIX_API_Initialize( - rtems_configuration_table *configuration_table -); - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/include/rtems/posix/priority.h b/c/src/exec/posix/include/rtems/posix/priority.h deleted file mode 100644 index c0253f3bab..0000000000 --- a/c/src/exec/posix/include/rtems/posix/priority.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_PRIORITY_h -#define __RTEMS_POSIX_PRIORITY_h - -#include - -/* - * 1003.1b-1993,2.2.2.80 definition of priority, p. 19 - * - * "Numericallly higher values represent higher priorities." - * - * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API. - * - * There are only 254 posix priority levels since a task at priority level - * 255 would never run because of the RTEMS idle task. This is necessary - * because GNAT maps the lowest Ada task priority to the lowest thread - * priority. The lowest priority Ada task should get to run, so there is - * a fundamental conflict with having 255 priorities. - */ - -#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254) - -#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1) - -RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid( - int priority -); - -RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( - int priority -); - -RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core( - Priority_Control priority -); - -#include - -#endif diff --git a/c/src/exec/posix/include/rtems/posix/psignal.h b/c/src/exec/posix/include/rtems/posix/psignal.h deleted file mode 100644 index c15ca78d34..0000000000 --- a/c/src/exec/posix/include/rtems/posix/psignal.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Id$ - */ - -#ifndef __RTEMS_POSIX_SIGNALS_h -#define __RTEMS_POSIX_SIGNALS_h - -#include - -/* - * Currently 32 signals numbered 1-32 are defined - */ - -#define SIGNAL_EMPTY_MASK 0x00000000 -#define SIGNAL_ALL_MASK 0xffffffff - -#define signo_to_mask( _sig ) (1 << ((_sig) - 1)) - -#define is_valid_signo( _sig ) \ - ((_sig) >= 1 && (_sig) <= 32 ) - -#define _States_Is_interruptible_signal( _states ) \ - ( ((_states) & \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) - -#define SIGACTION_TERMINATE \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} } -#define SIGACTION_IGNORE \ - { 0, SIGNAL_ALL_MASK, {SIG_IGN} } -#define SIGACTION_STOP \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} } -#define SIGACTION_CONTINUE \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} } - -#define SIG_ARRAY_MAX (SIGRTMAX + 1) - -/* - * Variables - */ - -extern sigset_t _POSIX_signals_Pending; - -extern struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ]; - -extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; - -extern Watchdog_Control _POSIX_signals_Alarm_timer; - -extern Thread_queue_Control _POSIX_signals_Wait_queue; - -extern Chain_Control _POSIX_signals_Inactive_siginfo; - -extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; - -/* - * POSIX internal siginfo structure - */ - -typedef struct { - Chain_Node Node; - siginfo_t Info; -} POSIX_signals_Siginfo_node; - -/* - * Internal routines - */ - -void _POSIX_signals_Manager_Initialization( - int maximum_queued_signals -); - -void _POSIX_signals_Post_switch_extension( - Thread_Control *the_thread -); - -boolean _POSIX_signals_Unblock_thread( - Thread_Control *the_thread, - int signo, - siginfo_t *info -); - -boolean _POSIX_signals_Check_signal( - POSIX_API_Control *api, - int signo, - boolean is_global -); - -boolean _POSIX_signals_Clear_signals( - POSIX_API_Control *api, - int signo, - siginfo_t *info, - boolean is_global, - boolean check_blocked -); - -int killinfo( - pid_t pid, - int sig, - const union sigval *value -); - -void _POSIX_signals_Set_process_signals( - sigset_t mask -); - -void _POSIX_signals_Clear_process_signals( - sigset_t mask -); - -/* - * Default signal handlers - */ - -#define _POSIX_signals_Stop_handler NULL -#define _POSIX_signals_Continue_handler NULL - -void _POSIX_signals_Abnormal_termination_handler( int signo ); - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/pthread.h b/c/src/exec/posix/include/rtems/posix/pthread.h deleted file mode 100644 index 10a1b051e1..0000000000 --- a/c/src/exec/posix/include/rtems/posix/pthread.h +++ /dev/null @@ -1,150 +0,0 @@ -/* rtems/posix/pthread.h - * - * This include file contains all the private support information for - * POSIX threads. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_THREADS_h -#define __RTEMS_POSIX_THREADS_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2) - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Threads_Information; - -/* - * These are used to manage the user initialization threads. - */ - -POSIX_EXTERN posix_initialization_threads_table - *_POSIX_Threads_User_initialization_threads; -POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads; - -extern const pthread_attr_t _POSIX_Threads_Default_attributes; - -/* - * _POSIX_Threads_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Threads_Manager_initialization( - unsigned32 maximum_pthreads, - unsigned32 number_of_initialization_threads, - posix_initialization_threads_table *user_threads -); - -/* - * _POSIX_Threads_Allocate - * - * DESCRIPTION: - * - * This function allocates a pthread control block from - * the inactive chain of free pthread control blocks. - */ - -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ); - -/* - * _POSIX_Threads_Free - * - * DESCRIPTION: - * - * This routine frees a pthread control block to the - * inactive chain of free pthread control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free( - Thread_Control *the_pthread -); - -/* - * _POSIX_Threads_Get - * - * DESCRIPTION: - * - * This function maps pthread IDs to pthread control blocks. - * If ID corresponds to a local pthread, then it returns - * the_pthread control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the pthread ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_pthread is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_pthread is undefined. - */ - -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get( - pthread_t id, - Objects_Locations *location -); - -/* - * _POSIX_Threads_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_pthread is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( - Thread_Control *the_pthread -); - -/* - * _POSIX_Threads_Sporadic_budget_callout - * - * DESCRIPTION: - * - * This routine handles the sporadic scheduling algorithm. - */ - -void _POSIX_Threads_Sporadic_budget_callout( - Thread_Control *the_thread -); - -/* - * _POSIX_Threads_Sporadic_budget_TSR - * - * DESCRIPTION: - * - * This routine supports the sporadic scheduling algorithm. - */ - -void _POSIX_Threads_Sporadic_budget_TSR( - Objects_Id id, - void *argument -); - -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/pthreadmp.h b/c/src/exec/posix/include/rtems/posix/pthreadmp.h deleted file mode 100644 index 4bd6cc41e8..0000000000 --- a/c/src/exec/posix/include/rtems/posix/pthreadmp.h +++ /dev/null @@ -1,160 +0,0 @@ -/* pthreadmp.h - * - * This include file contains all the constants and structures associated - * with the Multiprocessing Support in the POSIX Threads Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_THREADS_MP_h -#define __RTEMS_POSIX_THREADS_MP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -/* - * The following enumerated type defines the list of - * remote pthread operations. - */ - -typedef enum { - POSIX_THREADS_MP_ANNOUNCE_CREATE = 0, - POSIX_THREADS_MP_ANNOUNCE_DELETE = 1, - POSIX_THREADS_MP_EXTRACT_PROXY = 2, - POSIX_THREADS_MP_OBTAIN_REQUEST = 3, - POSIX_THREADS_MP_OBTAIN_RESPONSE = 4, - POSIX_THREADS_MP_RELEASE_REQUEST = 5, - POSIX_THREADS_MP_RELEASE_RESPONSE = 6 -} POSIX_Threads_MP_Remote_operations; - -/* - * The following data structure defines the packet used to perform - * remote pthread operations. - */ - -typedef struct { - MP_packet_Prefix Prefix; - POSIX_Threads_MP_Remote_operations operation; - Objects_Name name; - boolean wait; - Objects_Id proxy_id; -} POSIX_Threads_MP_Packet; - -/* - * _POSIX_Threads_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Threads_MP_Send_process_packet ( - POSIX_Threads_MP_Remote_operations operation, - Objects_Id pthread_id, - Objects_Name name, - Objects_Id proxy_id -); - -/* - * _POSIX_Threads_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Threads_MP_Send_request_packet ( - POSIX_Threads_MP_Remote_operations operation, - Objects_Id pthread_id, - boolean wait, - Watchdog_Interval timeout -); - -/* - * _POSIX_Threads_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Threads_MP_Send_response_packet ( - POSIX_Threads_MP_Remote_operations operation, - Objects_Id pthread_id, - Thread_Control *the_thread -); - -/* - * - * _POSIX_Threads_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Threads_MP_Process_packet ( - MP_packet_Prefix *the_packet_prefix -); - -/* - * _POSIX_Threads_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Threads_MP_Send_object_was_deleted ( - Thread_Control *the_proxy -); - -/* - * _POSIX_Threads_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Threads_MP_Send_extract_proxy ( - Thread_Control *the_thread -); - -/* - * _POSIX_Threads_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a pthread mp packet. - */ - -POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/ptimer.h b/c/src/exec/posix/include/rtems/posix/ptimer.h deleted file mode 100644 index c19f10c54c..0000000000 --- a/c/src/exec/posix/include/rtems/posix/ptimer.h +++ /dev/null @@ -1,91 +0,0 @@ -/* rtems/posix/ptimer.h - * - * This include file contains all the private support information for - * POSIX timers. - * - * COPYRIGHT (c) 1998. - * Alfonso Escalera Piña - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * ptimer.h,v 1.0 1998/03/31 16:21:16 - */ - -#ifndef __RTEMS_POSIX_TIMERS_h -#define __RTEMS_POSIX_TIMERS_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * _POSIX_Timers_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Timer_Manager_initialization ( int max_timers ); - -/* - * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 - * - * timer_create - */ - -int timer_create( - clockid_t clock_id, - struct sigevent *evp, - timer_t *timerid -); - -/* - * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 - */ - -int timer_delete( - timer_t timerid -); - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - * - * timer_settime - */ - -int timer_settime( - timer_t timerid, - int flags, - const struct itimerspec *value, - struct itimerspec *ovalue -); - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - * - * timer_gettime - */ - -int timer_gettime( - timer_t timerid, - struct itimerspec *value -); - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - * - * timer_getoverrun - * - */ - -int timer_getoverrun( - timer_t timerid -); - -#endif - diff --git a/c/src/exec/posix/include/rtems/posix/semaphore.h b/c/src/exec/posix/include/rtems/posix/semaphore.h deleted file mode 100644 index 0bbca530af..0000000000 --- a/c/src/exec/posix/include/rtems/posix/semaphore.h +++ /dev/null @@ -1,181 +0,0 @@ -/* rtems/posix/semaphore.h - * - * This include file contains all the private support information for - * POSIX Semaphores. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_SEMAPHORE_h -#define __RTEMS_POSIX_SEMAPHORE_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define SEM_FAILED (sem_t *) -1 - -/* - * Data Structure used to manage a POSIX semaphore - */ - -typedef struct { - Objects_Control Object; - int process_shared; - boolean named; - boolean linked; - unsigned32 open_count; - CORE_semaphore_Control Semaphore; -} POSIX_Semaphore_Control; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information; - -/* - * _POSIX_Semaphore_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Semaphore_Manager_initialization( - unsigned32 maximum_semaphorees -); - -/* - * _POSIX_Semaphore_Allocate - * - * DESCRIPTION: - * - * This function allocates a semaphore control block from - * the inactive chain of free semaphore control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ); - -/* - * _POSIX_Semaphore_Free - * - * DESCRIPTION: - * - * This routine frees a semaphore control block to the - * inactive chain of free semaphore control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( - POSIX_Semaphore_Control *the_semaphore -); - -/* - * _POSIX_Semaphore_Get - * - * DESCRIPTION: - * - * This function maps semaphore IDs to semaphore control blocks. - * If ID corresponds to a local semaphore, then it returns - * the_semaphore control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the semaphore ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_semaphore is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_semaphore is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( - sem_t *id, - Objects_Locations *location -); - -/* - * _POSIX_Semaphore_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_semaphore is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null ( - POSIX_Semaphore_Control *the_semaphore -); - -/* - * _POSIX_Semaphore_Create_support - * - * DESCRIPTION: - * - * This routine supports the sem_init and sem_open routines. - */ - -int _POSIX_Semaphore_Create_support( - const char *name, - int pshared, - unsigned int value, - POSIX_Semaphore_Control **the_sem -); - -/* - * _POSIX_Semaphore_Delete - * - * DESCRIPTION: - * - * This routine supports the sem_close and sem_unlink routines. - */ - -void _POSIX_Semaphore_Delete( - POSIX_Semaphore_Control *the_semaphore -); - -/* - * _POSIX_Semaphore_Wait_support - * - * DESCRIPTION: - * - * This routine supports the sem_wait, sem_trywait, and sem_timedwait - * services. - */ - -int _POSIX_Semaphore_Wait_support( - sem_t *sem, - boolean blocking, - Watchdog_Interval timeout -); - -/* - * _POSIX_Semaphore_Name_to_id - * - * DESCRIPTION: - * - * This routine performs name to id translation. - */ - -int _POSIX_Semaphore_Name_to_id( - const char *name, - sem_t *id -); - -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/semaphoremp.h b/c/src/exec/posix/include/rtems/posix/semaphoremp.h deleted file mode 100644 index b56cbb5dac..0000000000 --- a/c/src/exec/posix/include/rtems/posix/semaphoremp.h +++ /dev/null @@ -1,160 +0,0 @@ -/* semaphoremp.h - * - * This include file contains all the constants and structures associated - * with the Multiprocessing Support in the POSIX Semaphore Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_SEMAPHORE_MP_h -#define __RTEMS_POSIX_SEMAPHORE_MP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -/* - * The following enumerated type defines the list of - * remote semaphore operations. - */ - -typedef enum { - POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0, - POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1, - POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2, - POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3, - POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4, - POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5, - POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6, -} POSIX_Semaphore_MP_Remote_operations; - -/* - * The following data structure defines the packet used to perform - * remote semaphore operations. - */ - -typedef struct { - MP_packet_Prefix Prefix; - POSIX_Semaphore_MP_Remote_operations operation; - Objects_Name name; - boolean wait; /* XXX options */ - Objects_Id proxy_id; -} POSIX_Semaphore_MP_Packet; - -/* - * _POSIX_Semaphore_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Semaphore_MP_Send_process_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - Objects_Name name, - Objects_Id proxy_id -); - -/* - * _POSIX_Semaphore_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Semaphore_MP_Send_request_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -); - -/* - * _POSIX_Semaphore_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Semaphore_MP_Send_response_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - Thread_Control *the_thread -); - -/* - * - * _POSIX_Semaphore_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Semaphore_MP_Process_packet( - MP_packet_Prefix *the_packet_prefix -); - -/* - * _POSIX_Semaphore_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Semaphore_MP_Send_object_was_deleted( - Thread_Control *the_proxy -); - -/* - * _POSIX_Semaphore_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Semaphore_MP_Send_extract_proxy( - Thread_Control *the_thread -); - -/* - * _POSIX_Semaphore_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a semaphore mp packet. - */ - -POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of file */ diff --git a/c/src/exec/posix/include/rtems/posix/threadsup.h b/c/src/exec/posix/include/rtems/posix/threadsup.h deleted file mode 100644 index 2ffc606911..0000000000 --- a/c/src/exec/posix/include/rtems/posix/threadsup.h +++ /dev/null @@ -1,45 +0,0 @@ -/* threadsup.h - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h -#define __RTEMS_POSIX_THREAD_SUPPORT_h - -#include -#include -#include - -typedef struct { - pthread_attr_t Attributes; - int detachstate; - Thread_queue_Control Join_List; - int schedpolicy; - struct sched_param schedparam; - int ss_high_priority; - Watchdog_Control Sporadic_timer; - - sigset_t signals_blocked; - sigset_t signals_pending; - -#if 0 - /* - * POSIX Interrupts - */ - unsigned32 interrupts_installed; - CORE_semaphore_Control Interrupt_Semaphore; -#endif - - /* - * POSIX Cancelability - */ - int cancelability_state; - int cancelability_type; - int cancelation_requested; - Chain_Control Cancellation_Handlers; - -} POSIX_API_Control; - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/rtems/posix/time.h b/c/src/exec/posix/include/rtems/posix/time.h deleted file mode 100644 index 0e87db388e..0000000000 --- a/c/src/exec/posix/include/rtems/posix/time.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_TIME_h -#define __RTEMS_POSIX_TIME_h - -#include - -/* - * Seconds from January 1, 1970 to January 1, 1988. Used to account for - * differences between POSIX API and RTEMS core. - */ - -#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \ - (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \ - (4 * TOD_SECONDS_PER_DAY)) - -/*PAGE - * - * _POSIX_Timespec_subtract - */ - -void _POSIX_Timespec_subtract( - const struct timespec *the_start, - const struct timespec *end, - struct timespec *result -); - -/* - * _POSIX_Timespec_to_interval - */ - -Watchdog_Interval _POSIX_Timespec_to_interval( - const struct timespec *time -); - -/*PAGE - * - * _POSIX_Interval_to_timespec - */ - -void _POSIX_Interval_to_timespec( - Watchdog_Interval ticks, - struct timespec *time -); - -#endif diff --git a/c/src/exec/posix/include/rtems/posix/timer.h b/c/src/exec/posix/include/rtems/posix/timer.h deleted file mode 100644 index ba0745b8b3..0000000000 --- a/c/src/exec/posix/include/rtems/posix/timer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * $Id$ - */ - -#ifndef __RTEMS_POSIX_TIMERS_h -#define __RTEMS_POSIX_TIMERS_h - -/* ************ - * Constants - * ************/ - -#define STATE_FREE_C 0x01 /* Free position of the table of timers */ -#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */ -#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */ -#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */ -#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */ -#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */ -#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is - * relative to the current one */ -#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/ -#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */ - -#define NO_MORE_TIMERS_C 11 /* There is not available timers */ -#define BAD_TIMER_C 11 /* The timer does not exist in the table */ - -#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 ) -#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 ) -#define SECONDS_PER_DAY_C ( 24 * 60 * 60 ) -#define SECONDS_PER_HOUR_C ( 60 * 60 ) -#define SECONDS_PER_MINUTE_C ( 60 ) - - -/* - * Data for a timer - */ - -typedef struct { - Objects_Control Object; - Watchdog_Control Ticker; - - pthread_t thread_id; /* Thread identifier */ - char state; /* State of the timer */ - struct sigevent inf; /* Information associated to the timer */ - timer_t timer_id; /* Created timer identifier */ - struct itimerspec timer_data; /* Timing data of the timer */ - unsigned32 ticks; /* Number of ticks of the initialization */ - unsigned32 overrun; /* Number of expirations of the timer */ - rtems_time_of_day time; /* Time in which the timer was started */ -} POSIX_Timer_Control; - -/* - * Array of Timers - */ - -extern int timer_max; -extern POSIX_Timer_Control *timer_struct; - -/* - * The following defines the information control block used to manage - * this class of objects. - */ - -RTEMS_EXTERN Objects_Information _POSIX_Timer_Information; - -#ifndef __RTEMS_APPLICATION__ -#include -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/sched.h b/c/src/exec/posix/include/sched.h deleted file mode 100644 index ccc42d35e2..0000000000 --- a/c/src/exec/posix/include/sched.h +++ /dev/null @@ -1,96 +0,0 @@ -/* sched.h - * - * $Id$ - */ - - -#ifndef __POSIX_SCHEDULING_h -#define __POSIX_SCHEDULING_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_PRIORITY_SCHEDULING) - -#include -#include -#include -#include - -/* - * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 - * - */ - -int sched_setparam( - pid_t pid, - const struct sched_param *param -); - -/* - * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 - */ - -int sched_getparam( - pid_t pid, - const struct sched_param *param -); - -/* - * 13.3.3 Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-1993, p. 254 - */ - -int sched_setscheduler( - pid_t pid, - int policy, - const struct sched_param *param -); - -/* - * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 - */ - -int sched_getscheduler( - pid_t pid -); - -/* - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_get_priority_max( - int policy -); - -int sched_get_priority_min( - int policy -); - -int sched_rr_get_interval( - pid_t pid, - struct timespec *interval -); - -#endif /* _POSIX_PRIORITY_SCHEDULING */ - -#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING) - -/* - * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 - */ - -int sched_yield( void ); - -#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/include/semaphore.h b/c/src/exec/posix/include/semaphore.h deleted file mode 100644 index 79e85f2d6a..0000000000 --- a/c/src/exec/posix/include/semaphore.h +++ /dev/null @@ -1,116 +0,0 @@ -/* semaphore.h - * - * $Id$ - */ - -#ifndef __POSIX_SEMAPHORE_h -#define __POSIX_SEMAPHORE_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_SEMAPHORES) - -#include - -/* - * 11.1 Semaphore Characteristics, P1003.1b-1993, p.219 - */ - -typedef int sem_t; - -/* - * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219 - */ - -int sem_init( - sem_t *sem, - int pshared, - unsigned int value -); - -/* - * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 - */ - -int sem_destroy( - sem_t *sem -); - -/* - * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221 - * - * NOTE: Follows open() calling conventions. - */ - -sem_t *sem_open( - const char *name, - int oflag, - ... -); - -/* - * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 - */ - -int sem_close( - sem_t *sem -); - -/* - * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 - */ - -int sem_unlink( - const char *name -); - -/* - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - -int sem_wait( - sem_t *sem -); - -int sem_trywait( - sem_t *sem -); - -#if defined(_POSIX_TIMEOUTS) -int sem_timedwait( - sem_t *sem, - const struct timespec *timeout -); -#endif - -/* - * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 - */ - -int sem_post( - sem_t *sem -); - -/* - * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 - */ - -int sem_getvalue( - sem_t *sem, - int *sval -); - -#endif /* _POSIX_SEMAPHORES */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/inline/.cvsignore b/c/src/exec/posix/inline/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/inline/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/inline/Makefile.am b/c/src/exec/posix/inline/Makefile.am deleted file mode 100644 index 131ba6b783..0000000000 --- a/c/src/exec/posix/inline/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -## -## $Id$ -## - - -include_rtems_posixdir = $(includedir)/rtems/posix - -$(PROJECT_INCLUDE)/rtems/posix: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/%: % - $(INSTALL_DATA) $< $@ - -if INLINE -noinst_HEADERS = rtems/posix/intr.inl -include_rtems_posix_HEADERS = rtems/posix/cond.inl rtems/posix/key.inl \ - rtems/posix/mqueue.inl rtems/posix/mutex.inl \ - rtems/posix/pthread.inl rtems/posix/priority.inl \ - rtems/posix/semaphore.inl rtems/posix/timer.inl - -PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems/posix \ - $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%) -endif - -all-local: $(PREINSTALL_FILES) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/exec/posix/inline/rtems/.cvsignore b/c/src/exec/posix/inline/rtems/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/inline/rtems/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/inline/rtems/posix/.cvsignore b/c/src/exec/posix/inline/rtems/posix/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/inline/rtems/posix/cond.inl b/c/src/exec/posix/inline/rtems/posix/cond.inl deleted file mode 100644 index 19d5c6ec4b..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/cond.inl +++ /dev/null @@ -1,79 +0,0 @@ -/* rtems/posix/cond.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX condition variables. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl -#define __RTEMS_POSIX_CONDITION_VARIABLES_inl - -/*PAGE - * - * _POSIX_Condition_variables_Allocate - */ - -RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control - *_POSIX_Condition_variables_Allocate( void ) -{ - return (POSIX_Condition_variables_Control *) - _Objects_Allocate( &_POSIX_Condition_variables_Information ); -} - -/*PAGE - * - * _POSIX_Condition_variables_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free ( - POSIX_Condition_variables_Control *the_condition_variable -) -{ - _Objects_Free( - &_POSIX_Condition_variables_Information, - &the_condition_variable->Object - ); -} - -/*PAGE - * - * _POSIX_Condition_variables_Get - */ - -RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( - Objects_Id *id, - Objects_Locations *location -) -{ -/* XXX should support COND_INITIALIZER */ - if ( id ) - return (POSIX_Condition_variables_Control *) - _Objects_Get( &_POSIX_Condition_variables_Information, *id, location ); - - *location = OBJECTS_ERROR; - return NULL; -} - -/*PAGE - * - * _POSIX_Condition_variables_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( - POSIX_Condition_variables_Control *the_condition_variable -) -{ - return !the_condition_variable; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/intr.inl b/c/src/exec/posix/inline/rtems/posix/intr.inl deleted file mode 100644 index 2539719b8c..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/intr.inl +++ /dev/null @@ -1,71 +0,0 @@ -/* rtems/posix/intr.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX Interrupt Manager - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_INTERRUPT_inl -#define __RTEMS_POSIX_INTERRUPT_inl - -/*PAGE - * - * _POSIX_Interrupt_Allocate - */ - -RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control * - _POSIX_Interrupt_Allocate( void ) -{ - return (POSIX_Interrupt_Handler_control *) - _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information ); -} - -/*PAGE - * - * _POSIX_Interrupt_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free ( - POSIX_Interrupt_Handler_control *the_intr -) -{ - _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object ); -} - -/*PAGE - * - * _POSIX_Interrupt_Get - */ - -RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - return (POSIX_Interrupt_Control *) - _Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location ); -} - -/*PAGE - * - * _POSIX_Interrupt_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null ( - POSIX_Interrupt_Handler_control *the_intr -) -{ - return !the_intr; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/key.inl b/c/src/exec/posix/inline/rtems/posix/key.inl deleted file mode 100644 index 73855ad601..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/key.inl +++ /dev/null @@ -1,69 +0,0 @@ -/* rtems/posix/key.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX key's. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_KEY_inl -#define __RTEMS_POSIX_KEY_inl - -/*PAGE - * - * _POSIX_Keys_Allocate - */ - -RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ) -{ - return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ); -} - -/*PAGE - * - * _POSIX_Keys_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( - POSIX_Keys_Control *the_key -) -{ - _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); -} - -/*PAGE - * - * _POSIX_Keys_Get - */ - -RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - return (POSIX_Keys_Control *) - _Objects_Get( &_POSIX_Keys_Information, id, location ); -} - -/*PAGE - * - * _POSIX_Keys_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null ( - POSIX_Keys_Control *the_key -) -{ - return !the_key; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/mqueue.inl b/c/src/exec/posix/inline/rtems/posix/mqueue.inl deleted file mode 100644 index d37431038b..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/mqueue.inl +++ /dev/null @@ -1,150 +0,0 @@ -/* rtems/posix/mqueue.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX Message Queue. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl -#define __RTEMS_POSIX_MESSAGE_QUEUE_inl - -/*PAGE - * - * _POSIX_Message_queue_Allocate - */ - -RTEMS_INLINE_ROUTINE - POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ) -{ - return (POSIX_Message_queue_Control *) - _Objects_Allocate( &_POSIX_Message_queue_Information ); -} - -/*PAGE - * - * _POSIX_Message_queue_Allocate_fd - */ - -RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * - _POSIX_Message_queue_Allocate_fd( void ) -{ - return (POSIX_Message_queue_Control_fd *) - _Objects_Allocate( &_POSIX_Message_queue_Information_fds ); -} - -/*PAGE - * - * _POSIX_Message_queue_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( - POSIX_Message_queue_Control *the_mq -) -{ - _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); -} - -/*PAGE - * - * _POSIX_Message_queue_Free_fd - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( - POSIX_Message_queue_Control_fd *the_mq_fd -) -{ - _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); -} - -/*PAGE - * - * _POSIX_Message_queue_Namespace_remove - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove ( - POSIX_Message_queue_Control *the_mq -) -{ - _Objects_Namespace_remove( - &_POSIX_Message_queue_Information, &the_mq->Object ); -} - -/*PAGE - * - * _POSIX_Message_queue_Get - */ - -RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - return (POSIX_Message_queue_Control *) - _Objects_Get( &_POSIX_Message_queue_Information, id, location ); -} - -/*PAGE - * - * _POSIX_Message_queue_Get_fd - */ - -RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( - Objects_Id id, - Objects_Locations *location -) -{ - return (POSIX_Message_queue_Control_fd *) - _Objects_Get( &_POSIX_Message_queue_Information_fds, id, location ); -} - -/*PAGE - * - * _POSIX_Message_queue_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null ( - POSIX_Message_queue_Control *the_mq -) -{ - return !the_mq; -} - -/*PAGE - * - * _POSIX_Message_queue_Priority_to_core - */ - -RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core( - unsigned int priority -) -{ - return priority * -1; -} - -/* - * _POSIX_Message_queue_Priority_from_core - * - * DESCRIPTION: - * - * XXX - */ - -RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( - CORE_message_queue_Submit_types priority -) -{ - /* absolute value without a library dependency */ - return ((priority >= 0) ? priority : -priority); -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/mutex.inl b/c/src/exec/posix/inline/rtems/posix/mutex.inl deleted file mode 100644 index 4b0f4221fd..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/mutex.inl +++ /dev/null @@ -1,110 +0,0 @@ -/* rtems/posix/mutex.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX mutex's. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MUTEX_inl -#define __RTEMS_POSIX_MUTEX_inl - -/*PAGE - * - * _POSIX_Mutex_Allocate - */ - -RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ) -{ - return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ); -} - -/*PAGE - * - * _POSIX_Mutex_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( - POSIX_Mutex_Control *the_mutex -) -{ - _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object ); -} - -/*PAGE - * - * _POSIX_Mutex_Get_support - * - * NOTE: The support macro makes it possible for both to use exactly - * the same code to check for NULL id pointer and - * PTHREAD_MUTEX_INITIALIZER without adding overhead. - */ - -#define ___POSIX_Mutex_Get_support( _id, _location ) \ - do { \ - int _status; \ - \ - if ( !_id ) { \ - *_location = OBJECTS_ERROR; \ - return (POSIX_Mutex_Control *) 0; \ - } \ - \ - if ( *_id == PTHREAD_MUTEX_INITIALIZER ) { \ - /* \ - * Do an "auto-create" here. \ - */ \ - \ - _status = pthread_mutex_init( _id, 0 ); \ - if ( _status ) { \ - *_location = OBJECTS_ERROR; \ - return (POSIX_Mutex_Control *) 0; \ - } \ - } \ - } while (0) - -RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get ( - Objects_Id *id, - Objects_Locations *location -) -{ - ___POSIX_Mutex_Get_support( id, location ); - - return (POSIX_Mutex_Control *) - _Objects_Get( &_POSIX_Mutex_Information, *id, location ); -} - -RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable ( - Objects_Id *id, - Objects_Locations *location, - ISR_Level *level -) -{ - ___POSIX_Mutex_Get_support( id, location ); - - return (POSIX_Mutex_Control *) - _Objects_Get_isr_disable( &_POSIX_Mutex_Information, *id, location, level ); -} - - -/*PAGE - * - * _POSIX_Mutex_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( - POSIX_Mutex_Control *the_mutex -) -{ - return !the_mutex; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/priority.inl b/c/src/exec/posix/inline/rtems/posix/priority.inl deleted file mode 100644 index dc8187d4ef..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/priority.inl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * $Id$ - */ - -#ifndef __RTEMS_POSIX_PRIORITY_inl -#define __RTEMS_POSIX_PRIORITY_inl - -/* - * 1003.1b-1993,2.2.2.80 definition of priority, p. 19 - * - * "Numericallly higher values represent higher priorities." - * - * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid( - int priority -) -{ - return (boolean) (priority >= 1 && priority <= 254); -} - -RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( - int priority -) -{ - return (Priority_Control) (255 - priority); -} - -RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core( - Priority_Control priority -) -{ - return 255 - priority; -} - -#endif diff --git a/c/src/exec/posix/inline/rtems/posix/pthread.inl b/c/src/exec/posix/inline/rtems/posix/pthread.inl deleted file mode 100644 index 9fc32ddff8..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/pthread.inl +++ /dev/null @@ -1,69 +0,0 @@ -/* rtems/posix/pthread.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX threads. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_THREADS_inl -#define __RTEMS_POSIX_THREADS_inl - -/*PAGE - * - * _POSIX_Threads_Allocate - */ - -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) -{ - return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); -} - -/*PAGE - * - * _POSIX_Threads_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( - Thread_Control *the_pthread -) -{ - _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); -} - -/*PAGE - * - * _POSIX_Threads_Get - */ - -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( - pthread_t id, - Objects_Locations *location -) -{ - return (Thread_Control *) - _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location ); -} - -/*PAGE - * - * _POSIX_Threads_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null ( - Thread_Control *the_pthread -) -{ - return !the_pthread; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/semaphore.inl b/c/src/exec/posix/inline/rtems/posix/semaphore.inl deleted file mode 100644 index fb20c8ad64..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/semaphore.inl +++ /dev/null @@ -1,85 +0,0 @@ -/* rtems/posix/semaphore.inl - * - * This include file contains the static inline implementation of the private - * inlined routines for POSIX Semaphores. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_SEMAPHORE_inl -#define __RTEMS_POSIX_SEMAPHORE_inl - -/*PAGE - * - * _POSIX_Semaphore_Allocate - */ - -RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) -{ - return (POSIX_Semaphore_Control *) - _Objects_Allocate( &_POSIX_Semaphore_Information ); -} - -/*PAGE - * - * _POSIX_Semaphore_Free - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( - POSIX_Semaphore_Control *the_semaphore -) -{ - _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); -} - -/*PAGE - * - * _POSIX_Semaphore_Namespace_remove - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove ( - POSIX_Semaphore_Control *the_semaphore -) -{ - _Objects_Namespace_remove( - &_POSIX_Semaphore_Information, &the_semaphore->Object ); -} - - - -/*PAGE - * - * _POSIX_Semaphore_Get - */ - -RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( - sem_t *id, - Objects_Locations *location -) -{ - return (POSIX_Semaphore_Control *) - _Objects_Get( &_POSIX_Semaphore_Information, *id, location ); -} - -/*PAGE - * - * _POSIX_Semaphore_Is_null - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null ( - POSIX_Semaphore_Control *the_semaphore -) -{ - return !the_semaphore; -} - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/inline/rtems/posix/timer.inl b/c/src/exec/posix/inline/rtems/posix/timer.inl deleted file mode 100644 index 96bd86f677..0000000000 --- a/c/src/exec/posix/inline/rtems/posix/timer.inl +++ /dev/null @@ -1,90 +0,0 @@ -/* timer.inl - * - * This file contains the static inline implementation of the inlined routines - * from the POSIX Timer Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __POSIX_TIMER_inl -#define __POSIX_TIMER_inl - -/*PAGE - * - * _POSIX_Timer_Allocate - * - * DESCRIPTION: - * - * This function allocates a timer control block from - * the inactive chain of free timer control blocks. - */ - -RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) -{ - return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); -} - -/*PAGE - * - * _POSIX_Timer_Free - * - * DESCRIPTION: - * - * This routine frees a timer control block to the - * inactive chain of free timer control blocks. - */ - -RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free ( - POSIX_Timer_Control *the_timer -) -{ - _Objects_Free( &_POSIX_Timer_Information, &the_timer->Object ); -} - -/*PAGE - * - * _POSIX_Timer_Get - * - * DESCRIPTION: - * - * This function maps timer IDs to timer control blocks. - * If ID corresponds to a local timer, then it returns - * the timer control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. Otherwise, location is set - * to OBJECTS_ERROR and the returned value is undefined. - */ - -RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - return (POSIX_Timer_Control *) - _Objects_Get( &_POSIX_Timer_Information, id, location ); -} - -/*PAGE - * - * _POSIX_Timer_Is_null - * - * DESCRIPTION: - * - * This function returns TRUE if the_timer is NULL and FALSE otherwise. - */ - -RTEMS_INLINE_ROUTINE boolean _POSIX_Timer_Is_null ( - Timer_Control *the_timer -) -{ - return (the_timer == NULL); -} - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/macros/.cvsignore b/c/src/exec/posix/macros/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/macros/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/macros/Makefile.am b/c/src/exec/posix/macros/Makefile.am deleted file mode 100644 index dbf40773f8..0000000000 --- a/c/src/exec/posix/macros/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -## -## $Id$ -## - - -include_rtems_posixdir = $(includedir)/rtems/posix - -$(PROJECT_INCLUDE)/rtems/posix: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/%: % - $(INSTALL_DATA) $< $@ - -if MACROS -noinst_HEADERS = rtems/posix/intr.inl -include_rtems_posix_HEADERS = rtems/posix/cond.inl rtems/posix/key.inl \ - rtems/posix/mqueue.inl rtems/posix/mutex.inl \ - rtems/posix/pthread.inl rtems/posix/priority.inl \ - rtems/posix/semaphore.inl rtems/posix/timer.inl - -PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems/posix \ - $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%) -endif - -all-local: $(PREINSTALL_FILES) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/exec/posix/macros/rtems/.cvsignore b/c/src/exec/posix/macros/rtems/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/macros/rtems/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/macros/rtems/posix/.cvsignore b/c/src/exec/posix/macros/rtems/posix/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/posix/macros/rtems/posix/cond.inl b/c/src/exec/posix/macros/rtems/posix/cond.inl deleted file mode 100644 index 96557a36e1..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/cond.inl +++ /dev/null @@ -1,66 +0,0 @@ -/* rtems/posix/cond.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX condition variables. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl -#define __RTEMS_POSIX_CONDITION_VARIABLES_inl - -/*PAGE - * - * _POSIX_Condition_variables_Allocate - */ - -#define _POSIX_Condition_variables_Allocate() \ - (POSIX_Condition_variables_Control *) \ - _Objects_Allocate( &_POSIX_Condition_variables_Information ) - -/*PAGE - * - * _POSIX_Condition_variables_Free - */ - -#define _POSIX_Condition_variables_Free( _the_condition_variable ) \ - _Objects_Free( &_POSIX_Condition_variables_Information, \ - &(_the_condition_variable)->Object) - -/*PAGE - * - * _POSIX_Condition_variables_Get - */ - -/* XXX how to write this as a macro */ -static POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( - Objects_Id *id, - Objects_Locations *location -) -{ -/* XXX should support COND_INITIALIZER */ - if ( id ) - return (POSIX_Condition_variables_Control *) - _Objects_Get( &_POSIX_Condition_variables_Information, *id, location ); - - *location = OBJECTS_ERROR; - return NULL; -} - -/*PAGE - * - * _POSIX_Condition_variables_Is_null - */ - -#define _POSIX_Condition_variables_Is_null( _the_condition_variable ) \ - (!(_the_condition_variable)) - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/macros/rtems/posix/intr.inl b/c/src/exec/posix/macros/rtems/posix/intr.inl deleted file mode 100644 index 3b4ebfbb34..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/intr.inl +++ /dev/null @@ -1,55 +0,0 @@ -/* rtems/posix/intr.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX Interrupt Manager - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_INTERRUPT_inl -#define __RTEMS_POSIX_INTERRUPT_inl - -/*PAGE - * - * _POSIX_Interrupt_Allocate - */ - -#define _POSIX_Interrupt_Allocate() \ - (POSIX_Interrupt_Handler_control *) \ - _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information ) - -/*PAGE - * - * _POSIX_Interrupt_Free - */ - -#define _POSIX_Interrupt_Free( _the_intr ) \ - _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &(_the_intr)->Object ) - -/*PAGE - * - * _POSIX_Interrupt_Get - */ - -#define _POSIX_Interrupt_Get( _id, _location ) \ - (POSIX_Interrupt_Control *) \ - _Objects_Get( &_POSIX_Interrupt_Handlers_Information, (_id), (_location) ) - -/*PAGE - * - * _POSIX_Interrupt_Is_null - */ - -#define _POSIX_Interrupt_Is_null( _the_intr ) \ - (!(_the_intr)) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/key.inl b/c/src/exec/posix/macros/rtems/posix/key.inl deleted file mode 100644 index cad7927125..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/key.inl +++ /dev/null @@ -1,54 +0,0 @@ -/* rtems/posix/key.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX key's. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_KEY_inl -#define __RTEMS_POSIX_KEY_inl - -/*PAGE - * - * _POSIX_Keys_Allocate - */ - -#define _POSIX_Keys_Allocate() \ - (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ) - -/*PAGE - * - * _POSIX_Keys_Free - */ - -#define _POSIX_Keys_Free( _the_key ) \ - _Objects_Free( &_POSIX_Keys_Information, &(_the_key)->Object ); - -/*PAGE - * - * _POSIX_Keys_Get - */ - -#define _POSIX_Keys_Get( _id, _location ) \ - (POSIX_Keys_Control *) \ - _Objects_Get( &_POSIX_Keys_Information, (_id), (_location) ) - -/*PAGE - * - * _POSIX_Keys_Is_null - */ - -#define _POSIX_Keys_Is_null( _the_key ) \ - (!(_the_key)) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/mqueue.inl b/c/src/exec/posix/macros/rtems/posix/mqueue.inl deleted file mode 100644 index d9912a2e11..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/mqueue.inl +++ /dev/null @@ -1,101 +0,0 @@ -/* rtems/posix/mqueue.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX Message Queue. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl -#define __RTEMS_POSIX_MESSAGE_QUEUE_inl - -/* - * _POSIX_Message_queue_Allocate - */ - -#define _POSIX_Message_queue_Allocate() \ - (POSIX_Message_queue_Control *) \ - _Objects_Allocate( &_POSIX_Message_queue_Information ) - -/* - * _POSIX_Message_queue_Allocate_fd - */ - -#define _POSIX_Message_queue_Allocate_fd() \ - (POSIX_Message_queue_Control_fd *) \ - _Objects_Allocate( &_POSIX_Message_queue_Information_fds ) - -/* - * _POSIX_Message_queue_Free - */ - -#define _POSIX_Message_queue_Free( _the_mq ) \ - _Objects_Free( &_POSIX_Message_queue_Information, &(_the_mq)->Object ) - -/* - * _POSIX_Message_queue_Free_fd - */ - -#define _POSIX_Message_queue_Free_fd( _the_mq_fd ) \ - _Objects_Free( &_POSIX_Message_queue_Information_fds, &(_the_mq_fd)->Object ) - -/* - * _POSIX_Message_queue_Namespace_remove - */ - -#define _POSIX_Message_queue_Namespace_remove( _the_mq ) \ - _Objects_Namespace_remove( \ - &_POSIX_Message_queue_Information, &(_the_mq)->Object ) - -/* - * _POSIX_Message_queue_Get - */ - -#define _POSIX_Message_queue_Get( _id, _location ) \ - (POSIX_Message_queue_Control *) \ - _Objects_Get( &_POSIX_Message_queue_Information, (_id), (_location) ) - -/* - * _POSIX_Message_queue_Get_fd - */ - -#define _POSIX_Message_queue_Get_fd( _id, _location ) \ - (POSIX_Message_queue_Control_fd *) \ - _Objects_Get( &_POSIX_Message_queue_Information_fds, (_id), (_location) ) - -/* - * - * _POSIX_Message_queue_Is_null - */ - -#define _POSIX_Message_queue_Is_null( _the_mq ) \ - (!(_the_mq)) - -/* - * - * _POSIX_Message_queue_Priority_to_core - */ - -#define _POSIX_Message_queue_Priority_to_core( _priority ) \ - ((_priority) * -1) - -/* - * _POSIX_Message_queue_Priority_from_core - */ - -/* absolute value without a library dependency */ -#define _POSIX_Message_queue_Priority_from_core( _priority ) \ - ((((CORE_message_queue_Submit_types)(_priority)) >= 0) ? \ - (_priority) : \ - -((CORE_message_queue_Submit_types)(_priority))) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/mutex.inl b/c/src/exec/posix/macros/rtems/posix/mutex.inl deleted file mode 100644 index e38d189ed6..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/mutex.inl +++ /dev/null @@ -1,100 +0,0 @@ -/* rtems/posix/mutex.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX mutex's. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_MUTEX_inl -#define __RTEMS_POSIX_MUTEX_inl - -/*PAGE - * - * _POSIX_Mutex_Allocate - */ - -#define _POSIX_Mutex_Allocate() \ - (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ) - -/*PAGE - * - * _POSIX_Mutex_Free - */ - -#define _POSIX_Mutex_Free( _the_mutex ) \ - _Objects_Free( &_POSIX_Mutex_Information, &(_the_mutex)->Object ) - -/*PAGE - * - * _POSIX_Mutex_Get - * - * NOTE: The support macro makes it possible for both to use exactly - * the same code to check for NULL id pointer and - * PTHREAD_MUTEX_INITIALIZER without adding overhead. - */ - -#define ___POSIX_Mutex_Get_support( _id, _location ) \ - do { \ - int _status; \ - \ - if ( !_id ) { \ - *_location = OBJECTS_ERROR; \ - return (POSIX_Mutex_Control *) 0; \ - } \ - \ - if ( *_id == PTHREAD_MUTEX_INITIALIZER ) { \ - /* \ - * Do an "auto-create" here. \ - */ \ - \ - _status = pthread_mutex_init( _id, 0 ); \ - if ( _status ) { \ - *_location = OBJECTS_ERROR; \ - return (POSIX_Mutex_Control *) 0; \ - } \ - } \ - } while (0) - -static POSIX_Mutex_Control * _POSIX_Mutex_Get( - Objects_Id *id, - Objects_Locations *location -) -{ - ___POSIX_Mutex_Get_support( id, location ); - - return (POSIX_Mutex_Control *) - _Objects_Get( &_POSIX_Mutex_Information, *id, location ); -} - -static POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable( - Objects_Id *id, - Objects_Locations *location, - ISR_Level *level -) -{ - ___POSIX_Mutex_Get_support( id, location ); - - return (POSIX_Mutex_Control *) - _Objects_Get_isr_disable( &_POSIX_Mutex_Information, *id, location, level ); -} - - -/*PAGE - * - * _POSIX_Mutex_Is_null - */ - -#define _POSIX_Mutex_Is_null( _the_mutex ) \ - (!(_the_mutex)) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/priority.inl b/c/src/exec/posix/macros/rtems/posix/priority.inl deleted file mode 100644 index ea1ce82669..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/priority.inl +++ /dev/null @@ -1,25 +0,0 @@ -/* - * $Id$ - */ - -#ifndef __RTEMS_POSIX_PRIORITY_inl -#define __RTEMS_POSIX_PRIORITY_inl - -/* - * 1003.1b-1993,2.2.2.80 definition of priority, p. 19 - * - * "Numericallly higher values represent higher priorities." - * - * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API. - */ - -#define _POSIX_Priority_Is_valid( _priority ) \ - ((boolean) ((_priority) >= 1 && (_priority) <= 254)) - -#define _POSIX_Priority_To_core( _priority ) \ - ((Priority_Control) (255 - (_priority))) - -#define _POSIX_Priority_From_core( _priority ) \ - (255 - (_priority)) - -#endif diff --git a/c/src/exec/posix/macros/rtems/posix/pthread.inl b/c/src/exec/posix/macros/rtems/posix/pthread.inl deleted file mode 100644 index 6f34092314..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/pthread.inl +++ /dev/null @@ -1,54 +0,0 @@ -/* rtems/posix/pthread.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX threads. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_THREADS_inl -#define __RTEMS_POSIX_THREADS_inl - -/*PAGE - * - * _POSIX_Threads_Allocate - */ - -#define _POSIX_Threads_Allocate() \ - (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ) - -/*PAGE - * - * _POSIX_Threads_Free - */ - -#define _POSIX_Threads_Free( _the_pthread ) \ - _Objects_Free( &_POSIX_Threads_Information, &(_the_pthread)->Object ) - -/*PAGE - * - * _POSIX_Threads_Get - */ - -#define _POSIX_Threads_Get( _id, _location ) \ - (Thread_Control *) \ - _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)(_id), (_location) ) - -/*PAGE - * - * _POSIX_Threads_Is_null - */ - -#define _POSIX_Threads_Is_null( _the_pthread ) \ - (!(_the_pthread)) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/semaphore.inl b/c/src/exec/posix/macros/rtems/posix/semaphore.inl deleted file mode 100644 index 8947b56e29..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/semaphore.inl +++ /dev/null @@ -1,64 +0,0 @@ -/* rtems/posix/semaphore.inl - * - * This include file contains the macro implementation of the private - * inlined routines for POSIX Semaphores. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __RTEMS_POSIX_SEMAPHORE_inl -#define __RTEMS_POSIX_SEMAPHORE_inl - -/*PAGE - * - * _POSIX_Semaphore_Allocate - */ - -#define _POSIX_Semaphore_Allocate() \ - (POSIX_Semaphore_Control *) \ - _Objects_Allocate( &_POSIX_Semaphore_Information ); - -/*PAGE - * - * _POSIX_Semaphore_Free - */ - -#define _POSIX_Semaphore_Free( _the_semaphore ) \ - _Objects_Free( &_POSIX_Semaphore_Information, &(_the_semaphore)->Object ) - -/*PAGE - * - * _POSIX_Semaphore_Namespace_remove - */ - -#define _POSIX_Semaphore_Namespace_remove( _the_semaphore ) \ - _Objects_Namespace_remove( \ - &_POSIX_Semaphore_Information, &(_the_semaphore)->Object ) - -/*PAGE - * - * _POSIX_Semaphore_Get - */ - -#define _POSIX_Semaphore_Get( _id, _location ) \ - (POSIX_Semaphore_Control *) \ - _Objects_Get( &_POSIX_Semaphore_Information, *(_id), (_location) ) - -/*PAGE - * - * _POSIX_Semaphore_Is_null - */ - -#define _POSIX_Semaphore_Is_null( _the_semaphore ) \ - (!(_the_semaphore)) - -#endif -/* end of include file */ - diff --git a/c/src/exec/posix/macros/rtems/posix/timer.inl b/c/src/exec/posix/macros/rtems/posix/timer.inl deleted file mode 100644 index d4846971d4..0000000000 --- a/c/src/exec/posix/macros/rtems/posix/timer.inl +++ /dev/null @@ -1,53 +0,0 @@ -/* timer.inl - * - * This file contains the macro implementation of the inlined routines - * from the POSIX Timer Manager. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __POSIX_TIMER_inl -#define __POSIX_TIMER_inl - -/*PAGE - * - * _POSIX_Timer_Allocate - */ - -#define _POSIX_Timer_Allocate() \ - (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ) - -/*PAGE - * - * _POSIX_Timer_Free - */ - -#define _POSIX_Timer_Free( _the_timer ) \ - _Objects_Free( &_POSIX_Timer_Information, &(_the_timer)->Object ); - -/*PAGE - * - * _POSIX_Timer_Get - */ - -#define _POSIX_Timer_Get( _the_timer ) \ - (POSIX_Timer_Control *) \ - _Objects_Get( &_POSIX_Timer_Information, (_id), (_location) ) - -/*PAGE - * - * _POSIX_Timer_Is_null - */ - -#define _POSIX_Timer_Is_null( _the_timer ) \ - (!(_the_timer)) - -#endif -/* end of include file */ diff --git a/c/src/exec/posix/src/.cvsignore b/c/src/exec/posix/src/.cvsignore deleted file mode 100644 index 9188ae45da..0000000000 --- a/c/src/exec/posix/src/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -stamp-h -stamp-h.in -config.h -config.h.in diff --git a/c/src/exec/posix/src/Makefile.am b/c/src/exec/posix/src/Makefile.am deleted file mode 100644 index 5acf82d323..0000000000 --- a/c/src/exec/posix/src/Makefile.am +++ /dev/null @@ -1,116 +0,0 @@ -## -## $Id$ -## - -LIB=$(ARCH)/libposix.a - -INCLUDES = -I. - -# following are semi-implemented and untested -UNUSED_C_FILES = devctl.c intr.c - -# These are really in the stand but not really functional -BUILD_FOR_NOW_C_FILES = aio.c - -ENOSYS_C_FILES = execl.c execle.c execlp.c execv.c execve.c execvp.c fork.c \ - pthreadatfork.c wait.c waitpid.c - -CANCEL_C_FILES = cancel.c cancelrun.c cleanuppop.c cleanuppush.c \ - setcancelstate.c setcanceltype.c testcancel.c - -CONDITION_VARIABLE_C_FILES = cond.c condattrdestroy.c condattrgetpshared.c \ - condattrinit.c condattrsetpshared.c condbroadcast.c \ - conddefaultattributes.c conddestroy.c condinit.c condmp.c condsignal.c \ - condsignalsupp.c condtimedwait.c condwait.c condwaitsupp.c - -ID_C_FILES = getegid.c geteuid.c getgid.c getgroups.c getlogin.c getpgrp.c \ - getpid.c getppid.c getuid.c setpgid.c setsid.c - -KEY_C_FILES = key.c keycreate.c keydelete.c keygetspecific.c \ - keyrundestructors.c keysetspecific.c - -MEMORY_C_FILES = getpagesize.c mprotect.c - -MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ - mqueuedeletesupp.c mqueuegetattr.c mqueuenametoid.c mqueuenotify.c \ - mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ - mqueuesendsupp.c mqueuesetattr.c mqueuetimedreceive.c mqueuetimedsend.c \ - mqueuetranslatereturncode.c mqueueunlink.c - -MUTEX_C_FILES = mutex.c mutexattrdestroy.c mutexattrgetprioceiling.c \ - mutexattrgetprotocol.c mutexattrgetpshared.c mutexattrinit.c \ - mutexattrsetprioceiling.c mutexattrsetprotocol.c mutexattrsetpshared.c \ - mutexdefaultattributes.c mutexdestroy.c mutexfromcorestatus.c \ - mutexgetprioceiling.c mutexinit.c mutexlock.c mutexlocksupp.c mutexmp.c \ - mutexsetprioceiling.c mutextimedlock.c mutextrylock.c mutexunlock.c - -PTHREAD_C_FILES = pthread.c pthreadsetcputime.c pthreadgetcputime.c \ - pthreadgetcpuclockid.c pthreadonce.c pthreadequal.c pthreadself.c \ - pthreadexit.c pthreaddetach.c pthreadjoin.c pthreadcreate.c \ - pthreadattrsetdetachstate.c pthreadattrgetdetachstate.c \ - pthreadattrgetstackaddr.c pthreadattrsetstackaddr.c \ - pthreadattrgetstacksize.c pthreadattrsetstacksize.c pthreadattrinit.c \ - pthreadattrdestroy.c pthreadsetschedparam.c pthreadgetschedparam.c \ - pthreadattrsetschedparam.c pthreadattrgetschedparam.c \ - pthreadattrgetschedpolicy.c pthreadattrsetschedpolicy.c \ - pthreadattrgetinheritsched.c pthreadattrsetinheritsched.c \ - pthreadattrgetscope.c pthreadattrsetscope.c - -PSIGNAL_C_FILES = psignal.c alarm.c kill.c killinfo.c pause.c \ - psignalclearprocesssignals.c psignalsetprocesssignals.c \ - psignalchecksignal.c psignalclearsignals.c psignalunblockthread.c \ - pthreadkill.c pthreadsigmask.c sigaction.c sigaddset.c sigdelset.c \ - sigemptyset.c sigfillset.c sigismember.c sigpending.c sigprocmask.c \ - sigqueue.c sigsuspend.c sigtimedwait.c sigwait.c sigwaitinfo.c \ - signal_2.c - -SEMAPHORE_C_FILES = semaphore.c semaphorecreatesupp.c semaphoredeletesupp.c \ - semaphoremp.c semaphorenametoid.c semaphorewaitsupp.c semclose.c \ - semdestroy.c semgetvalue.c seminit.c semopen.c sempost.c semtimedwait.c \ - semtrywait.c semunlink.c semwait.c - -TIME_C_FILES = time.c posixtimespecsubtract.c posixtimespectointerval.c \ - posixintervaltotimespec.c clockgetcpuclockid.c clockgetenableattr.c \ - clockgetres.c clockgettime.c clocksetenableattr.c clocksettime.c \ - nanosleep.c sleep.c - -# the timer manager needs to be split further but only after its -# dependence on the Classic API Timer Manager is removed. -TIMER_C_FILES = ptimer.c ptimer1.c - -C_FILES = adasupp.c $(CANCEL_C_FILES) $(CONDITION_VARIABLE_C_FILES) \ - $(ID_C_FILES) $(KEY_C_FILES) $(MEMORY_C_FILES) $(MESSAGE_QUEUE_C_FILES) \ - $(MUTEX_C_FILES) $(PTHREAD_C_FILES) $(PSIGNAL_C_FILES) sched.c \ - $(SEMAPHORE_C_FILES) sysconf.c $(TIME_C_FILES) $(TIMER_C_FILES) types.c \ - $(ENOSYS_C_FILES) $(BUILD_FOR_NOW_C_FILES) -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) - -OBJS = $(C_O_FILES) - -include $(top_srcdir)/../automake/multilib.am -include $(top_srcdir)/../automake/compile.am -include $(top_srcdir)/../automake/lib.am - -# -# Add local stuff here using += -# - -AM_CPPFLAGS += -D__RTEMS_INSIDE__ - -all-local: ${ARCH} $(LIB) - -$(LIB): ${OBJS} - $(make-library) - -# temporary so we can see how many things are left to implement -not: - grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL - @echo - @echo - @echo - @echo `grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL | wc -l ` places marked not implemented - @echo `wc -l $(C_FILES) | grep total` lines of C code to test - -EXTRA_DIST = $(C_FILES) $(UNUSED_C_FILES) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/exec/posix/src/README.mqueue b/c/src/exec/posix/src/README.mqueue deleted file mode 100644 index 12c8afc03e..0000000000 --- a/c/src/exec/posix/src/README.mqueue +++ /dev/null @@ -1,38 +0,0 @@ -# -# $Id$ -# - -This program should print out the default attribute settings for a -POSIX message queue. - -#include -#include - -main() -{ - mqd_t mqfd; - struct mq_attr mqstat; - int status; - - /* this should create it */ - mqfd = mq_open("myipc",O_WRONLY|O_CREAT,NULL); - if ( (int)mqfd == -1 ) { - perror( "Unable to open message queue" ); - exit( 1 ); - } - - status = mq_getattr(mqfd, &mqstat); - if ( !status ) { - printf( "mq_maxmsg: %d\n", mqstat.mq_maxmsg ); - printf( "mq_msgsize: %d\n", mqstat.mq_msgsize ); - printf( "mq_curmsgs: %d\n", mqstat.mq_curmsgs ); - } else { - perror( "Unable to get attributes on message queue" ); - exit( 1 ); - } - - /* this should delete it */ - (void) mq_close( mqfd ); - exit( 0 ); -} - diff --git a/c/src/exec/posix/src/adasupp.c b/c/src/exec/posix/src/adasupp.c deleted file mode 100644 index f1caf80023..0000000000 --- a/c/src/exec/posix/src/adasupp.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include - -/*PAGE - * - * _ada_pthread_minimum_stack_size - * - * This routine returns the minimum stack size so the GNAT RTS can - * allocate enough stack for Ada tasks. - */ - -size_t _ada_pthread_minimum_stack_size( void ) -{ - /* - * Eventually this may need to include a per cpu family calculation - * but for now, this will do. - */ - - return PTHREAD_MINIMUM_STACK_SIZE * 2; -} diff --git a/c/src/exec/posix/src/aio.c b/c/src/exec/posix/src/aio.c deleted file mode 100644 index 3218f1dc97..0000000000 --- a/c/src/exec/posix/src/aio.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include - -int POSIX_NOT_IMPLEMENTED(); - -/*PAGE - * - * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154 - */ - -int aio_read( - struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155 - */ - -int aio_write( - struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158 - */ - -int lio_listio( - int mode, - struct aiocb * const list[], - int nent, - struct sigevent *sig -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161 - */ - -int aio_error( - const struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, - * P1003.1b-1993, p. 162 - */ - -int aio_return( - const struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 - */ - -int aio_cancel( - int filedes, - struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164 - */ - -int aio_suspend( - struct aiocb * const list[], - int nent, - const struct timespec *timeout -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166 - */ - -int aio_fsync( - int op, - struct aiocb *aiocbp -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/alarm.c b/c/src/exec/posix/src/alarm.c deleted file mode 100644 index 13c4c40202..0000000000 --- a/c/src/exec/posix/src/alarm.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -/* #include */ - -#include -#include -#include - -unsigned int alarm( - unsigned int seconds -) -{ - unsigned int remaining = 0; - Watchdog_Control *the_timer; - - the_timer = &_POSIX_signals_Alarm_timer; - - switch ( _Watchdog_Remove( the_timer ) ) { - case WATCHDOG_INACTIVE: - case WATCHDOG_BEING_INSERTED: - break; - - case WATCHDOG_ACTIVE: - case WATCHDOG_REMOVE_IT: - /* - * The stop_time and start_time fields are snapshots of ticks since - * boot. Since alarm() is dealing in seconds, we must account for - * this. - */ - - remaining = the_timer->initial - - ((the_timer->stop_time - the_timer->start_time) / _TOD_Ticks_per_second); - break; - } - - _Watchdog_Insert_seconds( the_timer, seconds ); - - return remaining; -} - diff --git a/c/src/exec/posix/src/cancel.c b/c/src/exec/posix/src/cancel.c deleted file mode 100644 index f1310d5ab1..0000000000 --- a/c/src/exec/posix/src/cancel.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181 - */ - -int pthread_cancel( - pthread_t thread -) -{ - Thread_Control *the_thread; - POSIX_API_Control *thread_support; - Objects_Locations location; - - /* - * Don't even think about deleting a resource from an ISR. - */ - - if ( _ISR_Is_in_progress() ) - return EPROTO; - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - return POSIX_MP_NOT_IMPLEMENTED(); - case OBJECTS_LOCAL: - thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - thread_support->cancelation_requested = 1; - - if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS ) { - _POSIX_Threads_cancel_run( the_thread ); - } - - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/cancelrun.c b/c/src/exec/posix/src/cancelrun.c deleted file mode 100644 index 4806e6d378..0000000000 --- a/c/src/exec/posix/src/cancelrun.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Threads_cancel_run - * - */ - -#if !defined(PTHREAD_CANCELED) -#warning "PTHREAD_CANCELED NOT DEFINED -- patch newlib" -#define PTHREAD_CANCELED ((void *) -1) -#endif - -void _POSIX_Threads_cancel_run( - Thread_Control *the_thread -) -{ - POSIX_Cancel_Handler_control *handler; - Chain_Control *handler_stack; - POSIX_API_Control *thread_support; - ISR_Level level; - - thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - handler_stack = &thread_support->Cancellation_Handlers; - - thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; - - while ( !_Chain_Is_empty( handler_stack ) ) { - _ISR_Disable( level ); - handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack ); - _Chain_Extract_unprotected( &handler->Node ); - _ISR_Enable( level ); - - (*handler->routine)( handler->arg ); - - _Workspace_Free( handler ); - } - - /* Now we can delete the thread */ - - the_thread->Wait.return_argument = (unsigned32 *)PTHREAD_CANCELED; - _Thread_Close( - _Objects_Get_information( the_thread->Object.id ), - the_thread - ); - _POSIX_Threads_Free( the_thread ); - -} diff --git a/c/src/exec/posix/src/cleanuppop.c b/c/src/exec/posix/src/cleanuppop.c deleted file mode 100644 index f9706bd408..0000000000 --- a/c/src/exec/posix/src/cleanuppop.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 - */ - -void pthread_cleanup_pop( - int execute -) -{ - POSIX_Cancel_Handler_control *handler; - Chain_Control *handler_stack; - POSIX_API_Control *thread_support; - ISR_Level level; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - handler_stack = &thread_support->Cancellation_Handlers; - - if ( _Chain_Is_empty( handler_stack ) ) - return; - - _ISR_Disable( level ); - handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack ); - _Chain_Extract_unprotected( &handler->Node ); - _ISR_Enable( level ); - - if ( execute ) - (*handler->routine)( handler->arg ); - - _Workspace_Free( handler ); -} diff --git a/c/src/exec/posix/src/cleanuppush.c b/c/src/exec/posix/src/cleanuppush.c deleted file mode 100644 index bf96212d8f..0000000000 --- a/c/src/exec/posix/src/cleanuppush.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 - */ - -void pthread_cleanup_push( - void (*routine)( void * ), - void *arg -) -{ - POSIX_Cancel_Handler_control *handler; - Chain_Control *handler_stack; - POSIX_API_Control *thread_support; - - if ( !routine ) - return; /* XXX what to do really? */ - - handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); - - if ( !handler ) - return; /* XXX what to do really? */ - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - handler_stack = &thread_support->Cancellation_Handlers; - - handler->routine = routine; - handler->arg = arg; - - _Chain_Append( handler_stack, &handler->Node ); -} diff --git a/c/src/exec/posix/src/clockgetcpuclockid.c b/c/src/exec/posix/src/clockgetcpuclockid.c deleted file mode 100644 index 96e554c1f5..0000000000 --- a/c/src/exec/posix/src/clockgetcpuclockid.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 - */ - -int clock_getcpuclockid( - pid_t pid, - clockid_t *clock_id -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/clockgetenableattr.c b/c/src/exec/posix/src/clockgetenableattr.c deleted file mode 100644 index 0d3fbebfb4..0000000000 --- a/c/src/exec/posix/src/clockgetenableattr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58 - */ - -int clock_getenable_attr( - clockid_t clock_id, - int *attr -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/clockgetres.c b/c/src/exec/posix/src/clockgetres.c deleted file mode 100644 index 999e4bcb13..0000000000 --- a/c/src/exec/posix/src/clockgetres.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 14.2.1 Clocks, P1003.1b-1993, p. 263 - */ - -int clock_getres( - clockid_t clock_id, - struct timespec *res -) -{ - if ( !res ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - switch ( clock_id ) { - - /* - * All time in rtems is based on the same clock tick. - */ - - case CLOCK_REALTIME: - case CLOCK_PROCESS_CPUTIME: - case CLOCK_THREAD_CPUTIME: - if ( res ) { - res->tv_sec = _TOD_Microseconds_per_tick / 1000000; - res->tv_nsec = _TOD_Microseconds_per_tick * 1000; - /* _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res ); */ - } - break; - - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} diff --git a/c/src/exec/posix/src/clockgettime.c b/c/src/exec/posix/src/clockgettime.c deleted file mode 100644 index d2b382b54d..0000000000 --- a/c/src/exec/posix/src/clockgettime.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 14.2.1 Clocks, P1003.1b-1993, p. 263 - */ - -int clock_gettime( - clockid_t clock_id, - struct timespec *tp -) -{ - ISR_Level level; - time_t seconds; - long ticks; - - if ( !tp ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - switch ( clock_id ) { - - case CLOCK_REALTIME: - - _ISR_Disable( level ); - seconds = _TOD_Seconds_since_epoch; - ticks = _TOD_Current.ticks; - _ISR_Enable( level ); - - tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988; - tp->tv_nsec = ticks * _TOD_Microseconds_per_tick * - TOD_NANOSECONDS_PER_MICROSECOND; - break; - -#ifdef _POSIX_CPUTIME - case CLOCK_PROCESS_CPUTIME: - /* don't base this on _Watchdog_Ticks_since_boot--duration is too short*/ - return POSIX_NOT_IMPLEMENTED(); - break; -#endif - -#ifdef _POSIX_THREAD_CPUTIME - case CLOCK_THREAD_CPUTIME: - return POSIX_NOT_IMPLEMENTED(); - break; -#endif - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} diff --git a/c/src/exec/posix/src/clocksetenableattr.c b/c/src/exec/posix/src/clocksetenableattr.c deleted file mode 100644 index f5a29920d1..0000000000 --- a/c/src/exec/posix/src/clocksetenableattr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58 - */ - -int clock_setenable_attr( - clockid_t clock_id, - int attr -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/clocksettime.c b/c/src/exec/posix/src/clocksettime.c deleted file mode 100644 index a9993182a8..0000000000 --- a/c/src/exec/posix/src/clocksettime.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 14.2.1 Clocks, P1003.1b-1993, p. 263 - */ - -int clock_settime( - clockid_t clock_id, - const struct timespec *tp -) -{ - struct tm split_time; - TOD_Control tod; - Watchdog_Interval seconds; - - assert( tp ); - - switch ( clock_id ) { - - case CLOCK_REALTIME: - (void) gmtime_r( &tp->tv_sec, &split_time ); - - /* - * Convert the tm structure format to that used by the TOD Handler - * - * NOTE: TOD Handler does not honor leap seconds. - */ - - tod.year = split_time.tm_year + 1900; /* RHS is years since 1900 */ - tod.month = split_time.tm_mon + 1; /* RHS uses 0-11 */ - tod.day = split_time.tm_mday; - tod.hour = split_time.tm_hour; - tod.minute = split_time.tm_min; - tod.second = split_time.tm_sec; /* RHS allows 0-61 for leap seconds */ - - tod.ticks = (tp->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / - _TOD_Microseconds_per_tick; - - if ( !_TOD_Validate( &tod ) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - /* - * We can't use the tp->tv_sec field because it is based on - * a different EPOCH. - */ - - seconds = _TOD_To_seconds( &tod ); - _Thread_Disable_dispatch(); - _TOD_Set( &tod, seconds ); - _Thread_Enable_dispatch(); - break; - -#ifdef _POSIX_CPUTIME - case CLOCK_PROCESS_CPUTIME: - return POSIX_NOT_IMPLEMENTED(); - break; -#endif - -#ifdef _POSIX_THREAD_CPUTIME - case CLOCK_THREAD_CPUTIME: - return POSIX_NOT_IMPLEMENTED(); - break; -#endif - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} diff --git a/c/src/exec/posix/src/cond.c b/c/src/exec/posix/src/cond.c deleted file mode 100644 index f02a62275f..0000000000 --- a/c/src/exec/posix/src/cond.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Condition_variables_Manager_initialization - * - * This routine initializes all condition variable manager related data - * structures. - * - * Input parameters: - * maximum_condition_variables - maximum configured condition_variables - * - * Output parameters: NONE - */ - -void _POSIX_Condition_variables_Manager_initialization( - unsigned32 maximum_condition_variables -) -{ - _Objects_Initialize_information( - &_POSIX_Condition_variables_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_CONDITION_VARIABLES, /* object class */ - maximum_condition_variables, /* maximum objects of this class */ - sizeof( POSIX_Condition_variables_Control ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/posix/src/condattrdestroy.c b/c/src/exec/posix/src/condattrdestroy.c deleted file mode 100644 index 14ab750706..0000000000 --- a/c/src/exec/posix/src/condattrdestroy.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.1 Condition Variable Initialization Attributes, - * P1003.1c/Draft 10, p. 96 - */ - -int pthread_condattr_destroy( - pthread_condattr_t *attr -) -{ - if ( !attr || attr->is_initialized == FALSE ) - return EINVAL; - - attr->is_initialized = FALSE; - return 0; -} diff --git a/c/src/exec/posix/src/condattrgetpshared.c b/c/src/exec/posix/src/condattrgetpshared.c deleted file mode 100644 index e1d7094764..0000000000 --- a/c/src/exec/posix/src/condattrgetpshared.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.1 Condition Variable Initialization Attributes, - * P1003.1c/Draft 10, p. 96 - */ - -int pthread_condattr_getpshared( - const pthread_condattr_t *attr, - int *pshared -) -{ - if ( !attr ) - return EINVAL; - - *pshared = attr->process_shared; - return 0; -} diff --git a/c/src/exec/posix/src/condattrinit.c b/c/src/exec/posix/src/condattrinit.c deleted file mode 100644 index 54f4c8bbd7..0000000000 --- a/c/src/exec/posix/src/condattrinit.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.1 Condition Variable Initialization Attributes, - * P1003.1c/Draft 10, p. 96 - */ - -int pthread_condattr_init( - pthread_condattr_t *attr -) -{ - if ( !attr ) - return EINVAL; - - *attr = _POSIX_Condition_variables_Default_attributes; - return 0; -} diff --git a/c/src/exec/posix/src/condattrsetpshared.c b/c/src/exec/posix/src/condattrsetpshared.c deleted file mode 100644 index 976091f722..0000000000 --- a/c/src/exec/posix/src/condattrsetpshared.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.1 Condition Variable Initialization Attributes, - * P1003.1c/Draft 10, p. 96 - */ - -int pthread_condattr_setpshared( - pthread_condattr_t *attr, - int pshared -) -{ - if ( !attr ) - return EINVAL; - - switch ( pshared ) { - case PTHREAD_PROCESS_SHARED: - case PTHREAD_PROCESS_PRIVATE: - attr->process_shared = pshared; - return 0; - - default: - return EINVAL; - } -} diff --git a/c/src/exec/posix/src/condbroadcast.c b/c/src/exec/posix/src/condbroadcast.c deleted file mode 100644 index bba153fbc7..0000000000 --- a/c/src/exec/posix/src/condbroadcast.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 - */ - -int pthread_cond_broadcast( - pthread_cond_t *cond -) -{ - return _POSIX_Condition_variables_Signal_support( cond, TRUE ); -} diff --git a/c/src/exec/posix/src/conddefaultattributes.c b/c/src/exec/posix/src/conddefaultattributes.c deleted file mode 100644 index 2dc5ef7fcc..0000000000 --- a/c/src/exec/posix/src/conddefaultattributes.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * The default condition variable attributes structure. - */ - -const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = { - TRUE, /* is_initialized */ - PTHREAD_PROCESS_PRIVATE /* process_shared */ -}; diff --git a/c/src/exec/posix/src/conddestroy.c b/c/src/exec/posix/src/conddestroy.c deleted file mode 100644 index 012a48148d..0000000000 --- a/c/src/exec/posix/src/conddestroy.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.2 Initializing and Destroying a Condition Variable, - * P1003.1c/Draft 10, p. 87 - */ - -int pthread_cond_destroy( - pthread_cond_t *cond -) -{ - register POSIX_Condition_variables_Control *the_cond; - Objects_Locations location; - - the_cond = _POSIX_Condition_variables_Get( cond, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - return EINVAL; -#endif - - case OBJECTS_ERROR: - return EINVAL; - - - case OBJECTS_LOCAL: - - if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { - _Thread_Enable_dispatch(); - return EBUSY; - } - - _Objects_Close( - &_POSIX_Condition_variables_Information, - &the_cond->Object - ); - - _POSIX_Condition_variables_Free( the_cond ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) { - - _Objects_MP_Close( - &_POSIX_Condition_variables_Information, - the_cond->Object.id - ); - - _POSIX_Condition_variables_MP_Send_process_packet( - POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE, - the_cond->Object.id, - 0, /* Not used */ - 0 /* Not used */ - ); - } -#endif - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/condinit.c b/c/src/exec/posix/src/condinit.c deleted file mode 100644 index cab76e4ab1..0000000000 --- a/c/src/exec/posix/src/condinit.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.2 Initializing and Destroying a Condition Variable, - * P1003.1c/Draft 10, p. 87 - */ - -int pthread_cond_init( - pthread_cond_t *cond, - const pthread_condattr_t *attr -) -{ - POSIX_Condition_variables_Control *the_cond; - const pthread_condattr_t *the_attr; - - if ( attr ) the_attr = attr; - else the_attr = &_POSIX_Condition_variables_Default_attributes; - - /* - * XXX: Be careful about attributes when global!!! - */ - - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) - return POSIX_MP_NOT_IMPLEMENTED(); - - if ( !the_attr->is_initialized ) - return EINVAL; - - _Thread_Disable_dispatch(); - - the_cond = _POSIX_Condition_variables_Allocate(); - - if ( !the_cond ) { - _Thread_Enable_dispatch(); - return ENOMEM; - } - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && - !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information, - 0, the_cond->Object.id, FALSE ) ) ) { - _POSIX_Condition_variables_Free( the_cond ); - _Thread_Enable_dispatch(); - return EAGAIN; - } -#endif - - the_cond->process_shared = the_attr->process_shared; - - the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; - -/* XXX some more initialization might need to go here */ - _Thread_queue_Initialize( - &the_cond->Wait_queue, - THREAD_QUEUE_DISCIPLINE_FIFO, - STATES_WAITING_FOR_CONDITION_VARIABLE, - ETIMEDOUT - ); - - _Objects_Open( - &_POSIX_Condition_variables_Information, - &the_cond->Object, - 0 - ); - - *cond = the_cond->Object.id; - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) - _POSIX_Condition_variables_MP_Send_process_packet( - POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE, - the_cond->Object.id, - 0, /* Name not used */ - 0 /* Not used */ - ); -#endif - - _Thread_Enable_dispatch(); - - return 0; -} diff --git a/c/src/exec/posix/src/condmp.c b/c/src/exec/posix/src/condmp.c deleted file mode 100644 index d5f60271fc..0000000000 --- a/c/src/exec/posix/src/condmp.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/* - * TEMPORARY - */ - -#if defined(RTEMS_MULTIPROCESSING) -void _POSIX_Condition_variables_MP_Send_process_packet ( - POSIX_Condition_variables_MP_Remote_operations operation, - Objects_Id condition_variables_id, - Objects_Name name, - Objects_Id proxy_id -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); -} - -void _POSIX_Condition_variables_MP_Send_extract_proxy( - Thread_Control *the_thread -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); -} -#endif - -/* - * END OF TEMPORARY - */ - diff --git a/c/src/exec/posix/src/condsignal.c b/c/src/exec/posix/src/condsignal.c deleted file mode 100644 index 73489a8abe..0000000000 --- a/c/src/exec/posix/src/condsignal.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 - */ - -int pthread_cond_signal( - pthread_cond_t *cond -) -{ - return _POSIX_Condition_variables_Signal_support( cond, FALSE ); -} diff --git a/c/src/exec/posix/src/condsignalsupp.c b/c/src/exec/posix/src/condsignalsupp.c deleted file mode 100644 index 45df6c6056..0000000000 --- a/c/src/exec/posix/src/condsignalsupp.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Condition_variables_Signal_support - * - * A support routine which implements guts of the broadcast and single task - * wake up version of the "signal" operation. - */ - -int _POSIX_Condition_variables_Signal_support( - pthread_cond_t *cond, - boolean is_broadcast -) -{ - register POSIX_Condition_variables_Control *the_cond; - Objects_Locations location; - Thread_Control *the_thread; - - the_cond = _POSIX_Condition_variables_Get( cond, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - return EINVAL; -#endif - - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - - do { - the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); - if ( !the_thread ) - the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; - } while ( is_broadcast && the_thread ); - - _Thread_Enable_dispatch(); - - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/condtimedwait.c b/c/src/exec/posix/src/condtimedwait.c deleted file mode 100644 index 6828393a89..0000000000 --- a/c/src/exec/posix/src/condtimedwait.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 - */ - -int pthread_cond_timedwait( - pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime -) -{ - Watchdog_Interval timeout; - struct timespec current_time; - struct timespec difference; - boolean already_timedout = FALSE; - - if ( !abstime ) - return EINVAL; - - /* - * The abstime is a walltime. We turn it into an interval. - */ - - (void) clock_gettime( CLOCK_REALTIME, ¤t_time ); - - /* XXX probably some error checking should go here */ - - _POSIX_Timespec_subtract( ¤t_time, abstime, &difference ); - - if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) && - ( difference.tv_nsec < 0 ) ) ) - already_timedout = TRUE; - - timeout = _POSIX_Timespec_to_interval( &difference ); - - return _POSIX_Condition_variables_Wait_support( - cond, - mutex, - timeout, - already_timedout - ); -} diff --git a/c/src/exec/posix/src/condwait.c b/c/src/exec/posix/src/condwait.c deleted file mode 100644 index 24af0603a7..0000000000 --- a/c/src/exec/posix/src/condwait.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 - */ - -int pthread_cond_wait( - pthread_cond_t *cond, - pthread_mutex_t *mutex -) -{ - return _POSIX_Condition_variables_Wait_support( - cond, - mutex, - THREAD_QUEUE_WAIT_FOREVER, - FALSE - ); -} diff --git a/c/src/exec/posix/src/condwaitsupp.c b/c/src/exec/posix/src/condwaitsupp.c deleted file mode 100644 index 29995dd629..0000000000 --- a/c/src/exec/posix/src/condwaitsupp.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Condition_variables_Wait_support - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of condition variable wait routines. - */ - -int _POSIX_Condition_variables_Wait_support( - pthread_cond_t *cond, - pthread_mutex_t *mutex, - Watchdog_Interval timeout, - boolean already_timedout -) -{ - register POSIX_Condition_variables_Control *the_cond; - Objects_Locations location; - int status; - int mutex_status; - - if ( !_POSIX_Mutex_Get( mutex, &location ) ) { - return EINVAL; - } - - _Thread_Unnest_dispatch(); - - the_cond = _POSIX_Condition_variables_Get( cond, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - return EINVAL; -#endif - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - - if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { - _Thread_Enable_dispatch(); - return EINVAL; - } - - (void) pthread_mutex_unlock( mutex ); -/* XXX ignore this for now since behavior is undefined - if ( mutex_status ) { - _Thread_Enable_dispatch(); - return EINVAL; - } -*/ - - if ( !already_timedout ) { - the_cond->Mutex = *mutex; - - _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); - _Thread_Executing->Wait.return_code = 0; - _Thread_Executing->Wait.queue = &the_cond->Wait_queue; - _Thread_Executing->Wait.id = *cond; - - _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); - - _Thread_Enable_dispatch(); - - /* - * Switch ourself out because we blocked as a result of the - * _Thread_queue_Enqueue. - */ - - status = _Thread_Executing->Wait.return_code; - if ( status && status != ETIMEDOUT ) - return status; - - } else { - _Thread_Enable_dispatch(); - status = ETIMEDOUT; - } - - /* - * When we get here the dispatch disable level is 0. - */ - - mutex_status = pthread_mutex_lock( mutex ); - if ( mutex_status ) - return EINVAL; - - return status; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/devctl.c b/c/src/exec/posix/src/devctl.c deleted file mode 100644 index 9800a109eb..0000000000 --- a/c/src/exec/posix/src/devctl.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include - -/*PAGE - * - * 21.2.1 Control a Device, P1003.4b/D8, p. 65 - */ - -int devctl( - int filedes, - void *dev_data_ptr, - size_t nbyte, - int *dev_info_ptr -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/execl.c b/c/src/exec/posix/src/execl.c deleted file mode 100644 index c3cba9833b..0000000000 --- a/c/src/exec/posix/src/execl.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * execl() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execl( - const char *path, - const char *arg, - ... -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/execle.c b/c/src/exec/posix/src/execle.c deleted file mode 100644 index f2cd1765d2..0000000000 --- a/c/src/exec/posix/src/execle.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * execle() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execle( - const char *path, - char const *arg, - ... -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/execlp.c b/c/src/exec/posix/src/execlp.c deleted file mode 100644 index 2b2afc05a6..0000000000 --- a/c/src/exec/posix/src/execlp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * execlp() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execlp( - const char *file, - const char *arg, - ... -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/execv.c b/c/src/exec/posix/src/execv.c deleted file mode 100644 index 857999333c..0000000000 --- a/c/src/exec/posix/src/execv.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * execv() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execv( - const char *file, - char *const argv[] -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/execve.c b/c/src/exec/posix/src/execve.c deleted file mode 100644 index e7c345b4fb..0000000000 --- a/c/src/exec/posix/src/execve.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * execve() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execve( - const char *path, - char *const argv[], - char *const envp[] -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/execvp.c b/c/src/exec/posix/src/execvp.c deleted file mode 100644 index fd3c481237..0000000000 --- a/c/src/exec/posix/src/execvp.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * execvp() - POSIX 1003.1b 3.1.2 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -int execvp( - const char *path, - char *const argv[] -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/fork.c b/c/src/exec/posix/src/fork.c deleted file mode 100644 index 1d67da7694..0000000000 --- a/c/src/exec/posix/src/fork.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * fork() - POSIX 1003.1b 3.1.1 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int fork( void ) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/getegid.c b/c/src/exec/posix/src/getegid.c deleted file mode 100644 index 09bb75aeef..0000000000 --- a/c/src/exec/posix/src/getegid.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -/* - * MACRO in userenv.h -gid_t _POSIX_types_Egid = 0; -*/ - -/*PAGE - * - * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, - * P1003.1b-1993, p. 84 - */ - -gid_t getegid( void ) -{ - return _POSIX_types_Egid; -} - diff --git a/c/src/exec/posix/src/geteuid.c b/c/src/exec/posix/src/geteuid.c deleted file mode 100644 index 9374999683..0000000000 --- a/c/src/exec/posix/src/geteuid.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -#include - -/* - * MACRO in userenv.h -uid_t _POSIX_types_Euid = 0; -*/ - -/*PAGE - * - * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, - * P1003.1b-1993, p. 84 - */ - -uid_t geteuid( void ) -{ - return _POSIX_types_Euid; -} diff --git a/c/src/exec/posix/src/getgid.c b/c/src/exec/posix/src/getgid.c deleted file mode 100644 index f104a6a039..0000000000 --- a/c/src/exec/posix/src/getgid.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -#include - -/* - * MACRO in userenv.h - * -gid_t _POSIX_types_Gid = 0; -*/ - -/*PAGE - * - * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, - * P1003.1b-1993, p. 84 - */ - -gid_t getgid( void ) -{ - return _POSIX_types_Gid; -} - -/*PAGE - * - * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84 - */ - -int setgid( - gid_t gid -) -{ - _POSIX_types_Gid = gid; - return 0; -} diff --git a/c/src/exec/posix/src/getgroups.c b/c/src/exec/posix/src/getgroups.c deleted file mode 100644 index b46cc6163a..0000000000 --- a/c/src/exec/posix/src/getgroups.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/*PAGE - * - * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86 - */ - -int getgroups( - int gidsetsize, - gid_t grouplist[] -) -{ - return 0; /* no supplemental group ids */ -} - diff --git a/c/src/exec/posix/src/getlogin.c b/c/src/exec/posix/src/getlogin.c deleted file mode 100644 index 64ee0b6d02..0000000000 --- a/c/src/exec/posix/src/getlogin.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 4.2.4 Get User Name, P1003.1b-1993, p. 87 - * - * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). - */ - -/* - * MACRO in userenv.h - * -static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ]; -*/ - -char *getlogin( void ) -{ - (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX ); - return _POSIX_types_Getlogin_buffer; -} - -/*PAGE - * - * 4.2.4 Get User Name, P1003.1b-1993, p. 87 - * - * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). - */ - -int getlogin_r( - char *name, - size_t namesize -) -{ - struct passwd *pw; - if ( namesize < LOGIN_NAME_MAX ) - return ERANGE; - - pw=getpwuid(getuid()); - if (!pw) { - strcpy(name,""); - } else { - strncpy(name,pw->pw_name,LOGIN_NAME_MAX); - }; - return 0; -} diff --git a/c/src/exec/posix/src/getpagesize.c b/c/src/exec/posix/src/getpagesize.c deleted file mode 100644 index 806c500a9b..0000000000 --- a/c/src/exec/posix/src/getpagesize.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -/*PAGE - * - * Get System Page Size (from SVR4 and 4.2+ BSD) - * - * This is not a functional version but the SPARC backend for at least - * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and - * return a reasonable value. - */ - -size_t getpagesize(void) -{ - return 4096; -} diff --git a/c/src/exec/posix/src/getpgrp.c b/c/src/exec/posix/src/getpgrp.c deleted file mode 100644 index 0904d23883..0000000000 --- a/c/src/exec/posix/src/getpgrp.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/*PAGE - * - * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89 - */ - -pid_t getpgrp( void ) -{ - /* - * This always succeeds and returns the process group id. For rtems, - * this will always be the local node; - */ - - return _Objects_Local_node; -} diff --git a/c/src/exec/posix/src/getpid.c b/c/src/exec/posix/src/getpid.c deleted file mode 100644 index 5442b6468d..0000000000 --- a/c/src/exec/posix/src/getpid.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/*PAGE - * - * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 - */ - -pid_t getpid( void ) -{ - return _Objects_Local_node; -} - -/* - * _getpid_r - * - * This is the Newlib dependent reentrant version of getpid(). - */ - -#if defined(RTEMS_NEWLIB) - -#include - -pid_t _getpid_r( - struct _reent *ptr -) -{ - return getpid(); -} -#endif - diff --git a/c/src/exec/posix/src/getppid.c b/c/src/exec/posix/src/getppid.c deleted file mode 100644 index f8a2f7bbf1..0000000000 --- a/c/src/exec/posix/src/getppid.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -pid_t _POSIX_types_Ppid = 0; - -/*PAGE - * - * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 - */ - -pid_t getppid( void ) -{ - return _POSIX_types_Ppid; -} - diff --git a/c/src/exec/posix/src/getuid.c b/c/src/exec/posix/src/getuid.c deleted file mode 100644 index 09cc25e7c1..0000000000 --- a/c/src/exec/posix/src/getuid.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -#include - -/* - * MACRO in userenv.h - * -uid_t _POSIX_types_Uid = 0; -*/ - -/*PAGE - * - * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, - * P1003.1b-1993, p. 84 - */ - -uid_t getuid( void ) -{ - return _POSIX_types_Uid; -} - -/*PAGE - * - * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84 - */ - -int setuid( - uid_t uid -) -{ - _POSIX_types_Uid = uid; - return 0; -} diff --git a/c/src/exec/posix/src/intr.c b/c/src/exec/posix/src/intr.c deleted file mode 100644 index 7688142ddf..0000000000 --- a/c/src/exec/posix/src/intr.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * NOTE: Each task has an interrupt semaphore associated with it. - * No matter which interrupt occurs that it has registered, - * the same semaphore is used. - * - * This whole interrupt scheme may have been eliminated in a later draft. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * _POSIX_Interrupt_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Interrupt_Manager_initialization( - unsigned32 maximum_interrupt_handlers -) -{ - unsigned32 index; - POSIX_Interrupt_Control *the_vector; - - _Objects_Initialize_information( - &_POSIX_Interrupt_Handlers_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_INTERRUPTS, /* object class */ - maximum_interrupt_handlers, /* maximum objects of this class */ - sizeof( POSIX_Interrupt_Handler_control ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); - - for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) { - the_vector = &_POSIX_Interrupt_Information[ index ]; - - the_vector->number_installed = 0; - the_vector->lock_count = 0; - the_vector->deferred_count = 0; - _Chain_Initialize_empty( &the_vector->Handlers ); - } -} - -/*PAGE - * - * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 - */ - -int intr_capture( - intr_t intr, - int (*intr_handler)( void *area ), - volatile void *area, - size_t areasize -) -{ - POSIX_Interrupt_Handler_control *the_intr; - POSIX_Interrupt_Control *the_vector; - POSIX_API_Thread_Support_Control *thread_support; - proc_ptr old_handler; - - if ( !_ISR_Is_vector_number_valid( intr ) || - !_ISR_Is_valid_user_handler( intr_handler ) ) - return EINVAL; - - _Thread_Disable_dispatch(); - - the_intr = _POSIX_Interrupt_Allocate(); - - if ( !the_intr ) { - _Thread_Enable_dispatch(); - return ENOMEM; - } - - the_vector = &_POSIX_Interrupt_Information[ intr ]; - - the_intr->vector = intr; - the_intr->handler = intr_handler; - the_intr->user_data_area = area; - the_intr->server = _Thread_Executing; - the_intr->is_active = TRUE; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - thread_support->interrupts_installed++; - -/* XXX should we malloc the semaphore on the fly??? if so we probably need to - release it when the thread has released all interrupts and keep - a count of how many it has installed. CURRENTLY NO.. ALLOCATED w/TCB -*/ - - /* - * This is sufficient to have the handlers invoked in the opposite - * order of installation. The loop invoking them can then go from - * the front of the list to the end. - */ - - _Chain_Prepend( &the_vector->Handlers, &the_intr->Object.Node ); - - if ( !the_vector->number_installed++ ) - _ISR_Install_vector( - intr, - (proc_ptr) _POSIX_Interrupt_Handler, - &old_handler - ); - - _Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 ); - - /* - * Normally, an Id would be returned here. - */ - - _Thread_Enable_dispatch(); - - return 0; -} - -/*PAGE - * - * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 - */ - -int intr_release( - intr_t intr, - int (*intr_handler)( void *area ) -) -{ - boolean found; - POSIX_Interrupt_Handler_control *the_intr; - POSIX_Interrupt_Control *the_vector; - POSIX_API_Thread_Support_Control *thread_support; - Chain_Node *the_node; - - if ( !_ISR_Is_valid_user_handler( intr_handler ) ) - return EINVAL; - - _Thread_Disable_dispatch(); - - /* - * Since interrupt handlers do not have a user visible id, there is - * no choice but to search the entire set of active interrupt handlers - * to find this one. - */ - - found = FALSE; - - the_vector = &_POSIX_Interrupt_Information[ intr ]; - - the_node = _Chain_Head( &the_vector->Handlers ); - - for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) { - the_intr = (POSIX_Interrupt_Handler_control *) the_node; - - if ( the_intr->handler == intr_handler ) { - found = TRUE; - break; - } - the_node = the_node->next; - } - - if ( !found ) { - _Thread_Enable_dispatch(); - return EINVAL; - } - - if ( !_Thread_Is_executing( the_intr->server ) ) { - _Thread_Enable_dispatch(); - return EINVAL; /* XXX should be ENOISR; */ - } - - /* - * OK now we have found the interrupt handler and can do some work. - */ - - _Chain_Extract( &the_intr->Object.Node ); - - the_intr->is_active = FALSE; - - the_vector->number_installed -= 1; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - thread_support->interrupts_installed--; - - /* - * It is unnecessary to flush the semaphore since the handler can only - * be "removed" by the thread which installed it. Thus it cannot be - * blocked on the semaphore or it would not be executing this routine. - */ - - _Objects_Close( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object ); - - _POSIX_Interrupt_Free( the_intr ); - - _Thread_Enable_dispatch(); - - return 0; -} - -/*PAGE - * - * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 - */ - -int intr_lock( - intr_t intr -) -{ - POSIX_Interrupt_Control *the_vector; - - _Thread_Disable_dispatch(); - - the_vector = &_POSIX_Interrupt_Information[ intr ]; - - the_vector->lock_count++; - - _Thread_Enable_dispatch(); - - return 0; -} - -/*PAGE - * - * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 - */ - -int intr_unlock( - intr_t intr -) -{ - POSIX_Interrupt_Control *the_vector; - - _Thread_Disable_dispatch(); - - the_vector = &_POSIX_Interrupt_Information[ intr ]; - - if ( !--the_vector->lock_count ) { - while ( --the_vector->deferred_count ) { - _POSIX_Interrupt_Handler( intr ); - } - } - - _Thread_Enable_dispatch(); - - return 0; -} - -/* - * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 - */ - -int intr_timed_wait( - int flags, - const struct timespec *timeout -) -{ - Watchdog_Interval ticks; - POSIX_API_Thread_Support_Control *thread_support; - - ticks = _POSIX_Timespec_to_interval( timeout ); - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - _Thread_Disable_dispatch(); - - _CORE_semaphore_Seize( - &thread_support->Interrupt_Semaphore, - 0, /* XXX does id=0 hurt in this case? */ - TRUE, - ticks - ); - _Thread_Enable_dispatch(); - - return _Thread_Executing->Wait.return_code; /* XXX should be POSIX */ -} - -/*PAGE - * - * _POSIX_Interrupt_Handler - * - */ - -void _POSIX_Interrupt_Handler( - ISR_Vector_number vector -) -{ - POSIX_Interrupt_Handler_control *the_intr; - POSIX_Interrupt_Control *the_vector; - POSIX_API_Thread_Support_Control *thread_support; - Chain_Node *the_node; - int status; - - the_vector = &_POSIX_Interrupt_Information[ vector ]; - - the_node = _Chain_Head( &the_vector->Handlers ); - - for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) { - the_intr = (POSIX_Interrupt_Handler_control *) the_node; - - status = (*the_intr->handler)( (void *) the_intr->user_data_area ); - - switch ( status ) { - case INTR_HANDLED_NOTIFY: - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - _CORE_semaphore_Surrender( - &thread_support->Interrupt_Semaphore, - 0, /* XXX is id=0 a problem */ - 0 /* XXX is this a problem (mp support)*/ - ); - return; - - case INTR_HANDLED_DO_NOT_NOTIFY: - return; - - case INTR_NOT_HANDLED: - default: /* this should not happen */ - break; - } - the_node = the_node->next; - } - - /* XXX - * - * This is an unhandled interrupt!!! - */ -} diff --git a/c/src/exec/posix/src/key.c b/c/src/exec/posix/src/key.c deleted file mode 100644 index 54f7213424..0000000000 --- a/c/src/exec/posix/src/key.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * _POSIX_Key_Manager_initialization - * - * DESCRIPTION: - * - * This routine performs the initialization necessary for this manager. - */ - -void _POSIX_Key_Manager_initialization( - unsigned32 maximum_keys -) -{ - _Objects_Initialize_information( - &_POSIX_Keys_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_KEYS, /* object class */ - maximum_keys, /* maximum objects of this class */ - sizeof( POSIX_Keys_Control ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/posix/src/keycreate.c b/c/src/exec/posix/src/keycreate.c deleted file mode 100644 index bcb881e756..0000000000 --- a/c/src/exec/posix/src/keycreate.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/*PAGE - * - * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 - */ - -int pthread_key_create( - pthread_key_t *key, - void (*destructor)( void * ) -) -{ - POSIX_Keys_Control *the_key; - void *table; - unsigned32 the_api; - unsigned32 bytes_to_allocate; - - - _Thread_Disable_dispatch(); - - the_key = _POSIX_Keys_Allocate(); - - if ( !the_key ) { - _Thread_Enable_dispatch(); - return EAGAIN; - } - - the_key->destructor = destructor; - - /* - * This is a bit more complex than one might initially expect because - * APIs are optional. Thus there may be no ITRON tasks to have keys - * for. [NOTE: Currently RTEMS Classic API tasks are not always enabled.] - */ - - for ( the_api = 1; - the_api <= OBJECTS_APIS_LAST; - the_api++ ) { - - if ( _Objects_Information_table[ the_api ] && - _Objects_Information_table[ the_api ][ 1 ] ) { - bytes_to_allocate = sizeof( void * ) * - (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); - table = _Workspace_Allocate( bytes_to_allocate ); - if ( !table ) { - for ( --the_api; - the_api >= 1; - the_api-- ) - _Workspace_Free( the_key->Values[ the_api ] ); - - _POSIX_Keys_Free( the_key ); - _Thread_Enable_dispatch(); - return ENOMEM; - } - - the_key->Values[ the_api ] = table; - memset( table, '\0', bytes_to_allocate ); - } else { - the_key->Values[ the_api ] = NULL; - } - - - } - - the_key->is_active = TRUE; - - _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 ); - - *key = the_key->Object.id; - - _Thread_Enable_dispatch(); - - return 0; -} diff --git a/c/src/exec/posix/src/keydelete.c b/c/src/exec/posix/src/keydelete.c deleted file mode 100644 index 1d595f2b8e..0000000000 --- a/c/src/exec/posix/src/keydelete.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/*PAGE - * - * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 - */ - -int pthread_key_delete( - pthread_key_t key -) -{ - register POSIX_Keys_Control *the_key; - Objects_Locations location; - unsigned32 the_api; - - the_key = _POSIX_Keys_Get( key, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: /* should never happen */ - return EINVAL; - case OBJECTS_LOCAL: - _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); - - the_key->is_active = FALSE; - - for ( the_api = 1; - the_api <= OBJECTS_APIS_LAST; - the_api++ ) - if ( the_key->Values[ the_api ] ) - _Workspace_Free( the_key->Values[ the_api ] ); - - /* - * NOTE: The destructor is not called and it is the responsibility - * of the application to free the memory. - */ - - _POSIX_Keys_Free( the_key ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/keygetspecific.c b/c/src/exec/posix/src/keygetspecific.c deleted file mode 100644 index b0529bd96e..0000000000 --- a/c/src/exec/posix/src/keygetspecific.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/*PAGE - * - * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 - */ - -void *pthread_getspecific( - pthread_key_t key -) -{ - register POSIX_Keys_Control *the_key; - unsigned32 index; - unsigned32 class; - Objects_Locations location; - void *key_data; - - the_key = _POSIX_Keys_Get( key, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: /* should never happen */ - return NULL; - case OBJECTS_LOCAL: - index = _Objects_Get_index( _Thread_Executing->Object.id ); - class = _Objects_Get_class( _Thread_Executing->Object.id ); - key_data = (void *) the_key->Values[ class ][ index ]; - _Thread_Enable_dispatch(); - return key_data; - } - return (void *) POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/keyrundestructors.c b/c/src/exec/posix/src/keyrundestructors.c deleted file mode 100644 index f07e9fe548..0000000000 --- a/c/src/exec/posix/src/keyrundestructors.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Keys_Run_destructors - * - * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 - * - * NOTE: This is the routine executed when a thread exits to - * run through all the keys and do the destructor action. - */ - -void _POSIX_Keys_Run_destructors( - Thread_Control *thread -) -{ - unsigned32 index; - unsigned32 pthread_index; - unsigned32 pthread_class; - unsigned32 iterations; - boolean are_all_null; - POSIX_Keys_Control *the_key; - void *value; - - pthread_index = _Objects_Get_index( thread->Object.id ); - pthread_class = _Objects_Get_class( thread->Object.id ); - - iterations = 0; - - for ( ; ; ) { - - are_all_null = TRUE; - - for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { - - the_key = (POSIX_Keys_Control *) - _POSIX_Keys_Information.local_table[ index ]; - - if ( the_key && the_key->is_active && the_key->destructor ) { - value = the_key->Values[ pthread_class ][ pthread_index ]; - if ( value ) { - (*the_key->destructor)( value ); - if ( the_key->Values[ pthread_class ][ pthread_index ] ) - are_all_null = FALSE; - } - } - } - - if ( are_all_null == TRUE ) - return; - - iterations++; - - /* - * The standard allows one to not do this and thus go into an infinite - * loop. It seems rude to unnecessarily lock up a system. - * - * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. - */ - - if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS ) - return; - } -} diff --git a/c/src/exec/posix/src/keysetspecific.c b/c/src/exec/posix/src/keysetspecific.c deleted file mode 100644 index 0f51f08d6b..0000000000 --- a/c/src/exec/posix/src/keysetspecific.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include - -/*PAGE - * - * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 - */ - -int pthread_setspecific( - pthread_key_t key, - const void *value -) -{ - register POSIX_Keys_Control *the_key; - unsigned32 index; - unsigned32 class; - Objects_Locations location; - - the_key = _POSIX_Keys_Get( key, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: /* should never happen */ - return EINVAL; - case OBJECTS_LOCAL: - index = _Objects_Get_index( _Thread_Executing->Object.id ); - class = _Objects_Get_class( _Thread_Executing->Object.id ); - the_key->Values[ class ][ index ] = (void *) value; - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/kill.c b/c/src/exec/posix/src/kill.c deleted file mode 100644 index d045939432..0000000000 --- a/c/src/exec/posix/src/kill.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int kill( - pid_t pid, - int sig -) -{ - return killinfo( pid, sig, NULL ); -} - -/* - * _kill_r - * - * This is the Newlib dependent reentrant version of kill(). - */ - -#if defined(RTEMS_NEWLIB) - -#include - -int _kill_r( - struct _reent *ptr, - pid_t pid, - int sig -) -{ - return kill( pid, sig ); -} -#endif - diff --git a/c/src/exec/posix/src/killinfo.c b/c/src/exec/posix/src/killinfo.c deleted file mode 100644 index 0d72a6ee9a..0000000000 --- a/c/src/exec/posix/src/killinfo.c +++ /dev/null @@ -1,336 +0,0 @@ -/* - * kill() support routine - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 - * - * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS. - */ - -#define _POSIX_signals_Is_interested( _api, _mask ) \ - ( ~(_api)->signals_blocked & (_mask) ) - -int killinfo( - pid_t pid, - int sig, - const union sigval *value -) -{ - sigset_t mask; - POSIX_API_Control *api; - unsigned32 the_api; - unsigned32 index; - unsigned32 maximum; - Objects_Information *the_info; - Objects_Control **object_table; - Thread_Control *the_thread; - Thread_Control *interested_thread; - Priority_Control interested_priority; - Chain_Control *the_chain; - Chain_Node *the_node; - siginfo_t siginfo_struct; - siginfo_t *siginfo; - POSIX_signals_Siginfo_node *psiginfo; - - /* - * Only supported for the "calling process" (i.e. this node). - */ - - if ( pid != getpid() ) - rtems_set_errno_and_return_minus_one( ESRCH ); - - /* - * Validate the signal passed if not 0. - */ - - if ( sig && !is_valid_signo(sig) ) { - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* - * If the signal is being ignored, then we are out of here. - */ - - if ( !sig || _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { - return 0; - } - - /* - * P1003.1c/Draft 10, p. 33 says that certain signals should always - * be directed to the executing thread such as those caused by hardware - * faults. - */ - - switch ( sig ) { - case SIGFPE: - case SIGILL: - case SIGSEGV: - return pthread_kill( pthread_self(), sig ); - default: - break; - } - - mask = signo_to_mask( sig ); - - /* - * Build up a siginfo structure - */ - - siginfo = &siginfo_struct; - siginfo->si_signo = sig; - siginfo->si_code = SI_USER; - if ( !value ) { - siginfo->si_value.sival_int = 0; - } else { - siginfo->si_value = *value; - } - - _Thread_Disable_dispatch(); - - /* - * Is the currently executing thread interested? If so then it will - * get it an execute it as soon as the dispatcher executes. - */ - - the_thread = _Thread_Executing; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - if ( _POSIX_signals_Is_interested( api, mask ) ) { - goto process_it; - } - - /* - * Is an interested thread waiting for this signal (sigwait())? - */ - - /* XXX violation of visibility -- need to define thread queue support */ - - for( index=0 ; - index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; - index++ ) { - - the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ]; - - for ( the_node = the_chain->first ; - !_Chain_Is_tail( the_chain, the_node ) ; - the_node = the_node->next ) { - - the_thread = (Thread_Control *)the_node; - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - if ((the_thread->Wait.option & mask) || (~api->signals_blocked & mask)) { - goto process_it; - } - - } - } - - /* - * Is any other thread interested? The highest priority interested - * thread is selected. In the event of a tie, then the following - * additional criteria is used: - * - * + ready thread over blocked - * + blocked on call interruptible by signal (can return EINTR) - * + blocked on call not interruptible by signal - * - * This looks at every thread in the system regardless of the creating API. - * - * NOTES: - * - * + rtems internal threads do not receive signals. - */ - - interested_thread = NULL; - interested_priority = PRIORITY_MAXIMUM + 1; - - for ( the_api = 2; - the_api <= OBJECTS_APIS_LAST; - the_api++ ) { - - if ( the_api == OBJECTS_INTERNAL_THREADS ) - continue; - - if ( !_Objects_Information_table[ the_api ] ) /* API not installed */ - continue; - - the_info = _Objects_Information_table[ the_api ][ 1 ]; - - if ( !the_info ) /* manager not installed */ - continue; - - maximum = the_info->maximum; - object_table = the_info->local_table; - - assert( object_table ); /* always at least 1 entry */ - - for ( index = 1 ; index <= maximum ; index++ ) { - the_thread = (Thread_Control *) object_table[ index ]; - - if ( !the_thread ) - continue; - - /* - * If this thread is of lower priority than the interested thread, - * go on to the next thread. - */ - - if ( the_thread->current_priority > interested_priority ) - continue; - - /* - * If this thread is not interested, then go on to the next thread. - */ - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - if ( !api || !_POSIX_signals_Is_interested( api, mask ) ) - continue; - - /* - * Now we know the thread under connsideration is interested. - * If the thread under consideration is of higher priority, then - * it becomes the interested thread. - */ - - if ( the_thread->current_priority < interested_priority ) { - interested_thread = the_thread; - interested_priority = the_thread->current_priority; - continue; - } - - /* - * Now the thread and the interested thread have the same priority. - * If the interested thread is ready, then we don't need to send it - * to a blocked thread. - */ - - if ( _States_Is_ready( interested_thread->current_state ) ) - continue; - - /* - * Now the interested thread is blocked. - * If the thread we are considering is not, the it becomes the - * interested thread. - */ - - if ( _States_Is_ready( the_thread->current_state ) ) { - interested_thread = the_thread; - interested_priority = the_thread->current_priority; - continue; - } - - /* - * Now we know both threads are blocked. - * If the interested thread is interruptible, then just use it. - */ - - /* XXX need a new states macro */ - if ( interested_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) - continue; - - /* - * Now both threads are blocked and the interested thread is not - * interruptible. - * If the thread under consideration is interruptible by a signal, - * then it becomes the interested thread. - */ - - /* XXX need a new states macro */ - if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { - interested_thread = the_thread; - interested_priority = the_thread->current_priority; - } - } - } - - if ( interested_thread ) { - the_thread = interested_thread; - goto process_it; - } - - /* - * OK so no threads were interested right now. It will be left on the - * global pending until a thread receives it. The global set of threads - * can change interest in this signal in one of the following ways: - * - * + a thread is created with the signal unblocked, - * + pthread_sigmask() unblocks the signal, - * + sigprocmask() unblocks the signal, OR - * + sigaction() which changes the handler to SIG_IGN. - */ - - the_thread = NULL; - goto post_process_signal; - - /* - * We found a thread which was interested, so now we mark that this - * thread needs to do the post context switch extension so it can - * evaluate the signals pending. - */ - -process_it: - - the_thread->do_post_task_switch_extension = TRUE; - - /* - * Returns TRUE if the signal was synchronously given to a thread - * blocked waiting for the signal. - */ - - if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { - _Thread_Enable_dispatch(); - return 0; - } - -post_process_signal: - - /* - * We may have woken up a thread but we definitely need to post the - * signal to the process wide information set. - */ - - _POSIX_signals_Set_process_signals( mask ); - - if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { - - psiginfo = (POSIX_signals_Siginfo_node *) - _Chain_Get( &_POSIX_signals_Inactive_siginfo ); - if ( !psiginfo ) { - rtems_set_errno_and_return_minus_one( EAGAIN ); - } - - psiginfo->Info = *siginfo; - - _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); - } - - _Thread_Enable_dispatch(); - return 0; -} diff --git a/c/src/exec/posix/src/mprotect.c b/c/src/exec/posix/src/mprotect.c deleted file mode 100644 index 60740615b5..0000000000 --- a/c/src/exec/posix/src/mprotect.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -/*PAGE - * - * 12.2.3 Change Memory Protection, P1003.1b-1996, p. 277. - * - * This is not a functional version but the SPARC backend for at least - * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and - * return 0. - */ - -int mprotect(const void *addr, size_t len, int prot) -{ - return 0; -} diff --git a/c/src/exec/posix/src/mqueue.c b/c/src/exec/posix/src/mqueue.c deleted file mode 100644 index 28003b8eee..0000000000 --- a/c/src/exec/posix/src/mqueue.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Manager_initialization - * - * This routine initializes all message_queue manager related data structures. - * - * Input parameters: - * maximum_message_queues - maximum configured message_queues - * - * Output parameters: NONE - */ - -void _POSIX_Message_queue_Manager_initialization( - unsigned32 maximum_message_queues -) -{ - _Objects_Initialize_information( - &_POSIX_Message_queue_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_MESSAGE_QUEUES, /* object class */ - maximum_message_queues, /* maximum objects of this class */ - sizeof( POSIX_Message_queue_Control ), - /* size of this object's control block */ - TRUE, /* TRUE if names for this object are strings */ - _POSIX_PATH_MAX /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); - _Objects_Initialize_information( - &_POSIX_Message_queue_Information_fds, - OBJECTS_POSIX_API, - OBJECTS_POSIX_MESSAGE_QUEUE_FDS, - maximum_message_queues, - sizeof( POSIX_Message_queue_Control_fd ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/posix/src/mqueueclose.c b/c/src/exec/posix/src/mqueueclose.c deleted file mode 100644 index e809eac3ec..0000000000 --- a/c/src/exec/posix/src/mqueueclose.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * - * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275 - */ - -int mq_close( - mqd_t mqdes -) -{ - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - /* - * First update the actual message queue to reflect this descriptor - * being disassociated. This may result in the queue being really - * deleted. - */ - - the_mq = the_mq_fd->Queue; - the_mq->open_count -= 1; - _POSIX_Message_queue_Delete( the_mq ); - - /* - * Now close this file descriptor. - */ - - _Objects_Close( - &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); - _POSIX_Message_queue_Free_fd( the_mq_fd ); - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mqueuecreatesupp.c b/c/src/exec/posix/src/mqueuecreatesupp.c deleted file mode 100644 index e71e0c6092..0000000000 --- a/c/src/exec/posix/src/mqueuecreatesupp.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Create_support - * - * This routine does the actual creation and initialization of - * a poxix message queue. - */ - -int _POSIX_Message_queue_Create_support( - const char *_name, - int pshared, - struct mq_attr *attr_ptr, - POSIX_Message_queue_Control **message_queue -) -{ - POSIX_Message_queue_Control *the_mq; - CORE_message_queue_Attributes *the_mq_attr; - struct mq_attr attr; - char *name; - - _Thread_Disable_dispatch(); - - /* - * There is no real basis for the default values. They will work - * but were not compared against any existing implementation for - * compatibility. See README.mqueue for an example program we - * think will print out the defaults. Report anything you find with it. - */ - - if ( attr_ptr == NULL ) { - attr.mq_maxmsg = 10; - attr.mq_msgsize = 16; - } else { - if ( attr_ptr->mq_maxmsg < 0 ){ - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - if ( attr_ptr->mq_msgsize < 0 ){ - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - attr = *attr_ptr; - } - -#if 0 && defined(RTEMS_MULTIPROCESSING) - if ( pshared == PTHREAD_PROCESS_SHARED && - !( _Objects_MP_Allocate_and_open( &_POSIX_Message_queue_Information, 0, - the_mq->Object.id, FALSE ) ) ) { - _POSIX_Message_queue_Free( the_mq ); - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENFILE ); - } -#endif - - the_mq = _POSIX_Message_queue_Allocate(); - if ( !the_mq ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENFILE ); - } - - the_mq->process_shared = pshared; - the_mq->named = TRUE; - the_mq->open_count = 1; - the_mq->linked = TRUE; - - - /* XXX - * - * Note that thread blocking discipline should be based on the - * current scheduling policy. - */ - - the_mq_attr = &the_mq->Message_queue.Attributes; - the_mq_attr->discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; - - if ( ! _CORE_message_queue_Initialize( - &the_mq->Message_queue, - the_mq_attr, - attr.mq_maxmsg, - attr.mq_msgsize - ) ) { - -#if 0 && defined(RTEMS_MULTIPROCESSING) - if ( pshared == PTHREAD_PROCESS_SHARED ) - _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id ); -#endif - - _POSIX_Message_queue_Free( the_mq ); - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENOSPC ); - } - - name = malloc(256); - strcpy( name, _name ); - _Objects_Open( - &_POSIX_Message_queue_Information, - &the_mq->Object, - (char *) name - ); - - *message_queue = the_mq; - -#if 0 && defined(RTEMS_MULTIPROCESSING) - if ( pshared == PTHREAD_PROCESS_SHARED ) - _POSIX_Message_queue_MP_Send_process_packet( - POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE, - the_mq->Object.id, - (char *) name, - 0 /* Not used */ - ); -#endif - - _Thread_Enable_dispatch(); - return 0; -} - - - - - diff --git a/c/src/exec/posix/src/mqueuedeletesupp.c b/c/src/exec/posix/src/mqueuedeletesupp.c deleted file mode 100644 index dfafbb578f..0000000000 --- a/c/src/exec/posix/src/mqueuedeletesupp.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Delete - */ - -void _POSIX_Message_queue_Delete( - POSIX_Message_queue_Control *the_mq -) -{ - if ( !the_mq->linked && !the_mq->open_count ) { - _Objects_Close( &_POSIX_Message_queue_Information, &the_mq->Object ); - - _CORE_message_queue_Close( - &the_mq->Message_queue, - NULL, /* no MP support */ - CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED - ); - - _POSIX_Message_queue_Free( the_mq ); - -#if 0 && defined(RTEMS_MULTIPROCESSING) - if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { - - _Objects_MP_Close( - &_POSIX_Message_queue_Information, - the_mq->Object.id - ); - - _POSIX_Message_queue_MP_Send_process_packet( - POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE, - the_mq->Object.id, - 0, /* Not used */ - 0 /* Not used */ - ); - } -#endif - - } -} - diff --git a/c/src/exec/posix/src/mqueuegetattr.c b/c/src/exec/posix/src/mqueuegetattr.c deleted file mode 100644 index 80be6335c7..0000000000 --- a/c/src/exec/posix/src/mqueuegetattr.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283 - */ - -int mq_getattr( - mqd_t mqdes, - struct mq_attr *mqstat -) -{ - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - CORE_message_queue_Attributes *the_mq_attr; - - if ( !mqstat ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - the_mq = the_mq_fd->Queue; - - /* - * Return the old values. - */ - - the_mq_attr = &the_mq->Message_queue.Attributes; - - mqstat->mq_flags = the_mq_fd->oflag; - mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size; - mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages; - mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages; - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/mqueuenametoid.c b/c/src/exec/posix/src/mqueuenametoid.c deleted file mode 100644 index 914b84351f..0000000000 --- a/c/src/exec/posix/src/mqueuenametoid.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Name_to_id - * - * Look up the specified name and attempt to locate the id - * for the associated message queue. - */ - -int _POSIX_Message_queue_Name_to_id( - const char *name, - Objects_Id *id -) -{ - Objects_Name_to_id_errors status; - - if ( !name ) - return EINVAL; - - if ( !name[0] ) - return EINVAL; - - if( strlen(name) > PATH_MAX ) - return ENAMETOOLONG; - - status = _Objects_Name_to_id( - &_POSIX_Message_queue_Information, (char *)name, 0, id ); - - if ( status == OBJECTS_SUCCESSFUL ) - return 0; - - return ENOENT; -} diff --git a/c/src/exec/posix/src/mqueuenotify.c b/c/src/exec/posix/src/mqueuenotify.c deleted file mode 100644 index 93e24ac71f..0000000000 --- a/c/src/exec/posix/src/mqueuenotify.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Notify_handler - * - */ - -void _POSIX_Message_queue_Notify_handler( - void *user_data -) -{ - POSIX_Message_queue_Control *the_mq; - - the_mq = user_data; - - kill( getpid(), the_mq->notification.sigev_signo ); - - _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); -} - -/*PAGE - * - * 15.2.6 Notify Process that a Message is Available on a Queue, - * P1003.1b-1993, p. 280 - */ - -int mq_notify( - mqd_t mqdes, - const struct sigevent *notification -) -{ - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - the_mq = the_mq_fd->Queue; - - if ( notification ) { - if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EBUSY ); - } - - _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); - - the_mq->notification = *notification; - - _CORE_message_queue_Set_notify( - &the_mq->Message_queue, - _POSIX_Message_queue_Notify_handler, - the_mq - ); - } else { - - _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); - - } - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/mqueueopen.c b/c/src/exec/posix/src/mqueueopen.c deleted file mode 100644 index f0dfc34f7c..0000000000 --- a/c/src/exec/posix/src/mqueueopen.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272 - */ - -mqd_t mq_open( - const char *name, - int oflag, - ... - /* mode_t mode, */ - /* struct mq_attr attr */ -) -{ - va_list arg; - mode_t mode; - struct mq_attr *attr = NULL; - int status; - Objects_Id the_mq_id; - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - - _Thread_Disable_dispatch(); - - if ( oflag & O_CREAT ) { - va_start(arg, oflag); - mode = (mode_t) va_arg( arg, unsigned int ); - attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); - va_end(arg); - } - - the_mq_fd = _POSIX_Message_queue_Allocate_fd(); - if ( !the_mq_fd ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENFILE ); - } - the_mq_fd->oflag = oflag; - - status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); - - /* - * If the name to id translation worked, then the message queue exists - * and we can just return a pointer to the id. Otherwise we may - * need to check to see if this is a "message queue does not exist" - * or some other miscellaneous error on the name. - */ - - if ( status ) { - - /* - * Unless provided a valid name that did not already exist - * and we are willing to create then it is an error. - */ - - if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { - _POSIX_Message_queue_Free_fd( the_mq_fd ); - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); - } - - } else { /* name -> ID translation succeeded */ - - /* - * Check for existence with creation. - */ - - if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { - _POSIX_Message_queue_Free_fd( the_mq_fd ); - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); - } - - /* - * In this case we need to do an ID->pointer conversion to - * check the mode. - */ - - the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); - the_mq->open_count += 1; - the_mq_fd->Queue = the_mq; - _Thread_Enable_dispatch(); - _Thread_Enable_dispatch(); - return (mqd_t)the_mq_fd->Object.id; - - } - - /* - * At this point, the message queue does not exist and everything has been - * checked. We should go ahead and create a message queue. - */ - - status = _POSIX_Message_queue_Create_support( - name, - TRUE, /* shared across processes */ - attr, - &the_mq - ); - - /* - * errno was set by Create_support, so don't set it again. - */ - - if ( status == -1 ) { - _Thread_Enable_dispatch(); - _POSIX_Message_queue_Free_fd( the_mq_fd ); - return (mqd_t) -1; - } - - the_mq_fd->Queue = the_mq; - _Objects_Open( - &_POSIX_Message_queue_Information_fds, - &the_mq_fd->Object, - NULL - ); - - _Thread_Enable_dispatch(); - - return (mqd_t) the_mq_fd->Object.id; -} - - - - - diff --git a/c/src/exec/posix/src/mqueuereceive.c b/c/src/exec/posix/src/mqueuereceive.c deleted file mode 100644 index 817876bc81..0000000000 --- a/c/src/exec/posix/src/mqueuereceive.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). - */ - -ssize_t mq_receive( - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio -) -{ - return _POSIX_Message_queue_Receive_support( - mqdes, - msg_ptr, - msg_len, - msg_prio, - THREAD_QUEUE_WAIT_FOREVER - ); -} - diff --git a/c/src/exec/posix/src/mqueuerecvsupp.c b/c/src/exec/posix/src/mqueuerecvsupp.c deleted file mode 100644 index 11d8fbc50c..0000000000 --- a/c/src/exec/posix/src/mqueuerecvsupp.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Message_queue_Receive_support - * - * NOTE: XXX Document how size, priority, length, and the buffer go - * through the layers. - */ - -ssize_t _POSIX_Message_queue_Receive_support( - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio, - Watchdog_Interval timeout -) -{ - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - unsigned32 length_out; - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EBADF ); - } - - the_mq = the_mq_fd->Queue; - - if ( msg_len < the_mq->Message_queue.maximum_message_size ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EMSGSIZE ); - } - - /* - * Now if something goes wrong, we return a "length" of -1 - * to indicate an error. - */ - - length_out = -1; - - _CORE_message_queue_Seize( - &the_mq->Message_queue, - mqdes, - msg_ptr, - &length_out, - (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, - timeout - ); - - _Thread_Enable_dispatch(); - *msg_prio = - _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); - - if ( !_Thread_Executing->Wait.return_code ) - return length_out; - - rtems_set_errno_and_return_minus_one( - _POSIX_Message_queue_Translate_core_message_queue_return_code( - _Thread_Executing->Wait.return_code - ) - ); - } - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/mqueuesend.c b/c/src/exec/posix/src/mqueuesend.c deleted file mode 100644 index c1dc8b18f8..0000000000 --- a/c/src/exec/posix/src/mqueuesend.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend(). - */ - -int mq_send( - mqd_t mqdes, - const char *msg_ptr, - size_t msg_len, - unsigned int msg_prio -) -{ - return _POSIX_Message_queue_Send_support( - mqdes, - msg_ptr, - msg_len, - msg_prio, - THREAD_QUEUE_WAIT_FOREVER - ); -} - diff --git a/c/src/exec/posix/src/mqueuesendsupp.c b/c/src/exec/posix/src/mqueuesendsupp.c deleted file mode 100644 index b3f249638c..0000000000 --- a/c/src/exec/posix/src/mqueuesendsupp.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -/*PAGE - * - * _POSIX_Message_queue_Send_support - */ - -int _POSIX_Message_queue_Send_support( - mqd_t mqdes, - const char *msg_ptr, - unsigned32 msg_len, - unsigned32 msg_prio, - Watchdog_Interval timeout -) -{ - POSIX_Message_queue_Control *the_mq; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - CORE_message_queue_Status msg_status; - - /* - * Validate the priority. - * XXX - Do not validate msg_prio is not less than 0. - */ - - if ( msg_prio > MQ_PRIO_MAX ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - - case OBJECTS_LOCAL: - if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EBADF ); - } - - the_mq = the_mq_fd->Queue; - - msg_status = _CORE_message_queue_Submit( - &the_mq->Message_queue, - (void *) msg_ptr, - msg_len, - mqdes, /* mqd_t is an object id */ -#if defined(RTEMS_MULTIPROCESSING) - NULL, /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/ -#else - NULL, -#endif - _POSIX_Message_queue_Priority_to_core( msg_prio ), - (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, - timeout /* no timeout */ - ); - - _Thread_Enable_dispatch(); - - /* - * If we had to block, then this is where the task returns - * after it wakes up. The returned status is correct for - * non-blocking operations but if we blocked, then we need - * to look at the status in our TCB. - */ - - if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) - msg_status = _Thread_Executing->Wait.return_code; - - if ( !msg_status ) - return msg_status; - - rtems_set_errno_and_return_minus_one( - _POSIX_Message_queue_Translate_core_message_queue_return_code( - msg_status - ) - ); - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mqueuesetattr.c b/c/src/exec/posix/src/mqueuesetattr.c deleted file mode 100644 index 623bf32744..0000000000 --- a/c/src/exec/posix/src/mqueuesetattr.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281 - */ - -int mq_setattr( - mqd_t mqdes, - const struct mq_attr *mqstat, - struct mq_attr *omqstat -) -{ - POSIX_Message_queue_Control_fd *the_mq_fd; - CORE_message_queue_Control *the_core_mq; - Objects_Locations location; - - if ( !mqstat ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EBADF ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - - the_core_mq = &the_mq_fd->Queue->Message_queue; - - /* - * Return the old values. - */ - - if ( omqstat ) { - omqstat->mq_flags = the_mq_fd->oflag; - omqstat->mq_msgsize = the_core_mq->maximum_message_size; - omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages; - omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; - } - - the_mq_fd->oflag = mqstat->mq_flags; - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/mqueuetimedreceive.c b/c/src/exec/posix/src/mqueuetimedreceive.c deleted file mode 100644 index 57af696e81..0000000000 --- a/c/src/exec/posix/src/mqueuetimedreceive.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). - */ - -int mq_timedreceive( /* XXX: should this be ssize_t */ - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio, - const struct timespec *timeout -) -{ - return _POSIX_Message_queue_Receive_support( - mqdes, - msg_ptr, - msg_len, - msg_prio, - _POSIX_Timespec_to_interval( timeout ) - ); -} - diff --git a/c/src/exec/posix/src/mqueuetimedsend.c b/c/src/exec/posix/src/mqueuetimedsend.c deleted file mode 100644 index 3893921947..0000000000 --- a/c/src/exec/posix/src/mqueuetimedsend.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend(). - */ - -int mq_timedsend( - mqd_t mqdes, - const char *msg_ptr, - size_t msg_len, - unsigned int msg_prio, - const struct timespec *timeout -) -{ - return _POSIX_Message_queue_Send_support( - mqdes, - msg_ptr, - msg_len, - msg_prio, - _POSIX_Timespec_to_interval( timeout ) - ); -} - diff --git a/c/src/exec/posix/src/mqueuetranslatereturncode.c b/c/src/exec/posix/src/mqueuetranslatereturncode.c deleted file mode 100644 index 6618f59dd0..0000000000 --- a/c/src/exec/posix/src/mqueuetranslatereturncode.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * POSIX Message Queue Error Translation - * - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -/*PAGE - * - * _POSIX_Message_queue_Translate_core_message_queue_return_code - * - * Input parameters: - * the_message_queue_status - message_queue status code to translate - * - * Output parameters: - * rtems status code - translated POSIX status code - * - */ - -int _POSIX_Message_queue_Translate_core_message_queue_return_code( - unsigned32 the_message_queue_status -) -{ - switch ( the_message_queue_status ) { - case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL: - return 0; - - /* - * Bad message size - */ - case CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE: - return EMSGSIZE; - - /* - * Queue is full of pending messages. - */ - case CORE_MESSAGE_QUEUE_STATUS_TOO_MANY: - return EAGAIN; - - /* - * Out of message buffers to queue pending message - */ - case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED: - return ENOMEM; - - /* - * No message available on receive poll - */ - case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT: - return EAGAIN; - - /* - * Queue was deleted while thread blocked on it. - */ - case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED: - return EBADF; - - /* - * POSIX Real-Time Extensions add timeouts to send and receive. - */ - case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT: - return ETIMEDOUT; - - /* - * RTEMS POSIX API implementation does not support multiprocessing. - */ - case THREAD_STATUS_PROXY_BLOCKING: - return ENOSYS; - } - _Internal_error_Occurred( - INTERNAL_ERROR_POSIX_API, - TRUE, - the_message_queue_status - ); - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mqueueunlink.c b/c/src/exec/posix/src/mqueueunlink.c deleted file mode 100644 index 5d3f54db8d..0000000000 --- a/c/src/exec/posix/src/mqueueunlink.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276 - */ - -int mq_unlink( - const char *name -) -{ - int status; - register POSIX_Message_queue_Control *the_mq; - Objects_Id the_mq_id; - - _Thread_Disable_dispatch(); - - status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); - if ( status != 0 ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( status ); - } - - /* - * Don't support unlinking a remote message queue. - */ - - if ( !_Objects_Is_local_id(the_mq_id) ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENOSYS ); - } - - the_mq = (POSIX_Message_queue_Control *) _Objects_Get_local_object( - &_POSIX_Message_queue_Information, - _Objects_Get_index( the_mq_id ) - ); - -#if 0 && defined(RTEMS_MULTIPROCESSING) - if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { - _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq_id ); - } -#endif - - - the_mq->linked = FALSE; - _POSIX_Message_queue_Namespace_remove( the_mq ); - _POSIX_Message_queue_Delete( the_mq ); - - _Thread_Enable_dispatch(); - return 0; -} - diff --git a/c/src/exec/posix/src/mutex.c b/c/src/exec/posix/src/mutex.c deleted file mode 100644 index 89f9040814..0000000000 --- a/c/src/exec/posix/src/mutex.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * _POSIX_Mutex_Manager_initialization - * - * This routine initializes all mutex manager related data structures. - * - * Input parameters: - * maximum_mutexes - maximum configured mutexes - * - * Output parameters: NONE - */ - -void _POSIX_Mutex_Manager_initialization( - unsigned32 maximum_mutexes -) -{ - _Objects_Initialize_information( - &_POSIX_Mutex_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_MUTEXES, /* object class */ - maximum_mutexes, /* maximum objects of this class */ - sizeof( POSIX_Mutex_Control ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/posix/src/mutexattrdestroy.c b/c/src/exec/posix/src/mutexattrdestroy.c deleted file mode 100644 index 32937636e5..0000000000 --- a/c/src/exec/posix/src/mutexattrdestroy.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 - */ - -int pthread_mutexattr_destroy( - pthread_mutexattr_t *attr -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - attr->is_initialized = FALSE; - return 0; -} - diff --git a/c/src/exec/posix/src/mutexattrgetprioceiling.c b/c/src/exec/posix/src/mutexattrgetprioceiling.c deleted file mode 100644 index 5c2d7ef576..0000000000 --- a/c/src/exec/posix/src/mutexattrgetprioceiling.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 - */ - -int pthread_mutexattr_getprioceiling( - const pthread_mutexattr_t *attr, - int *prioceiling -) -{ - if ( !attr || !attr->is_initialized || !prioceiling ) - return EINVAL; - - *prioceiling = attr->prio_ceiling; - return 0; -} diff --git a/c/src/exec/posix/src/mutexattrgetprotocol.c b/c/src/exec/posix/src/mutexattrgetprotocol.c deleted file mode 100644 index 2e6d1e36fb..0000000000 --- a/c/src/exec/posix/src/mutexattrgetprotocol.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 - */ - -int pthread_mutexattr_getprotocol( - const pthread_mutexattr_t *attr, - int *protocol -) -{ - if ( !attr || !attr->is_initialized || !protocol ) - return EINVAL; - - *protocol = attr->protocol; - return 0; -} diff --git a/c/src/exec/posix/src/mutexattrgetpshared.c b/c/src/exec/posix/src/mutexattrgetpshared.c deleted file mode 100644 index 3374b250ba..0000000000 --- a/c/src/exec/posix/src/mutexattrgetpshared.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 - */ - -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t *attr, - int *pshared -) -{ - if ( !attr || !attr->is_initialized || !pshared ) - return EINVAL; - - *pshared = attr->process_shared; - return 0; -} diff --git a/c/src/exec/posix/src/mutexattrinit.c b/c/src/exec/posix/src/mutexattrinit.c deleted file mode 100644 index 0cd6783ce8..0000000000 --- a/c/src/exec/posix/src/mutexattrinit.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 - */ - -int pthread_mutexattr_init( - pthread_mutexattr_t *attr -) -{ - if ( !attr ) - return EINVAL; - - *attr = _POSIX_Mutex_Default_attributes; - return 0; -} diff --git a/c/src/exec/posix/src/mutexattrsetprioceiling.c b/c/src/exec/posix/src/mutexattrsetprioceiling.c deleted file mode 100644 index dc2e8d08e6..0000000000 --- a/c/src/exec/posix/src/mutexattrsetprioceiling.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 - */ - -int pthread_mutexattr_setprioceiling( - pthread_mutexattr_t *attr, - int prioceiling -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - if ( !_POSIX_Priority_Is_valid( prioceiling ) ) - return EINVAL; - - attr->prio_ceiling = prioceiling; - return 0; -} diff --git a/c/src/exec/posix/src/mutexattrsetprotocol.c b/c/src/exec/posix/src/mutexattrsetprotocol.c deleted file mode 100644 index e92bdefe55..0000000000 --- a/c/src/exec/posix/src/mutexattrsetprotocol.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 - */ - -int pthread_mutexattr_setprotocol( - pthread_mutexattr_t *attr, - int protocol -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( protocol ) { - case PTHREAD_PRIO_NONE: - case PTHREAD_PRIO_INHERIT: - case PTHREAD_PRIO_PROTECT: - attr->protocol = protocol; - return 0; - - default: - return EINVAL; - } -} diff --git a/c/src/exec/posix/src/mutexattrsetpshared.c b/c/src/exec/posix/src/mutexattrsetpshared.c deleted file mode 100644 index bcc493b3b6..0000000000 --- a/c/src/exec/posix/src/mutexattrsetpshared.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 - */ - -int pthread_mutexattr_setpshared( - pthread_mutexattr_t *attr, - int pshared -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( pshared ) { - case PTHREAD_PROCESS_SHARED: - case PTHREAD_PROCESS_PRIVATE: - attr->process_shared = pshared; - return 0; - - default: - return EINVAL; - } -} - diff --git a/c/src/exec/posix/src/mutexdefaultattributes.c b/c/src/exec/posix/src/mutexdefaultattributes.c deleted file mode 100644 index 3324a727f9..0000000000 --- a/c/src/exec/posix/src/mutexdefaultattributes.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * The default mutex attributes structure. - */ - -const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = { - TRUE, /* is_initialized */ - PTHREAD_PROCESS_PRIVATE, /* process_shared */ - POSIX_SCHEDULER_MAXIMUM_PRIORITY, /* prio_ceiling */ - PTHREAD_PRIO_NONE, /* protocol */ - FALSE /* recursive */ -}; diff --git a/c/src/exec/posix/src/mutexdestroy.c b/c/src/exec/posix/src/mutexdestroy.c deleted file mode 100644 index 51507b5b28..0000000000 --- a/c/src/exec/posix/src/mutexdestroy.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 - */ - -int pthread_mutex_destroy( - pthread_mutex_t *mutex -) -{ - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - - the_mutex = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - return EINVAL; -#endif - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - /* - * XXX: There is an error for the mutex being locked - * or being in use by a condition variable. - */ - - if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) { - _Thread_Enable_dispatch(); - return EBUSY; - } - - _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); - - _CORE_mutex_Flush( - &the_mutex->Mutex, -#if defined(RTEMS_MULTIPROCESSING) - _POSIX_Mutex_MP_Send_object_was_deleted, -#else - NULL, -#endif - EINVAL - ); - - _POSIX_Mutex_Free( the_mutex ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) { - - _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id ); - - _POSIX_Mutex_MP_Send_process_packet( - POSIX_MUTEX_MP_ANNOUNCE_DELETE, - the_mutex->Object.id, - 0, /* Not used */ - 0 /* Not used */ - ); - } -#endif - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mutexfromcorestatus.c b/c/src/exec/posix/src/mutexfromcorestatus.c deleted file mode 100644 index 3c6f617861..0000000000 --- a/c/src/exec/posix/src/mutexfromcorestatus.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * _POSIX_Mutex_From_core_mutex_status - */ - -int _POSIX_Mutex_From_core_mutex_status( - CORE_mutex_Status status -) -{ - switch ( status ) { - case CORE_MUTEX_STATUS_SUCCESSFUL: - return 0; - case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT: - return EBUSY; - case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED: - return EDEADLK; - case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE: - return EPERM; - case CORE_MUTEX_WAS_DELETED: - return EINVAL; - case CORE_MUTEX_TIMEOUT: - return EAGAIN; - case CORE_MUTEX_STATUS_CEILING_VIOLATED: - return EINVAL; - default: - break; - } - assert( 0 ); - return 0; -} diff --git a/c/src/exec/posix/src/mutexgetprioceiling.c b/c/src/exec/posix/src/mutexgetprioceiling.c deleted file mode 100644 index 4e43325560..0000000000 --- a/c/src/exec/posix/src/mutexgetprioceiling.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 - */ - -int pthread_mutex_getprioceiling( - pthread_mutex_t *mutex, - int *prioceiling -) -{ - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - - if ( !prioceiling ) - return EINVAL; - - the_mutex = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */ -#endif - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - *prioceiling = _POSIX_Priority_From_core( - the_mutex->Mutex.Attributes.priority_ceiling - ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mutexinit.c b/c/src/exec/posix/src/mutexinit.c deleted file mode 100644 index 97882040f9..0000000000 --- a/c/src/exec/posix/src/mutexinit.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 - * - * NOTE: XXX Could be optimized so all the attribute error checking - * is not performed when attr is NULL. - */ - -int pthread_mutex_init( - pthread_mutex_t *mutex, - const pthread_mutexattr_t *attr -) -{ - POSIX_Mutex_Control *the_mutex; - CORE_mutex_Attributes *the_mutex_attr; - const pthread_mutexattr_t *the_attr; - CORE_mutex_Disciplines the_discipline; -#if 0 - register POSIX_Mutex_Control *mutex_in_use; - Objects_Locations location; -#endif - - if ( attr ) the_attr = attr; - else the_attr = &_POSIX_Mutex_Default_attributes; - - /* Check for NULL mutex */ - - if ( !mutex ) - return EINVAL; - - /* - * This code should eventually be removed. - * - * Although the POSIX specification says: - * - * "Attempting to initialize an already initialized mutex results - * in undefined behavior." - * - * Trying to keep the caller from doing the create when *mutex - * is actually a valid ID causes grief. All it takes is the wrong - * value in an uninitialized variable to make this fail. As best - * I can tell, RTEMS was the only pthread implementation to choose - * this option for "undefined behavior" and doing so has created - * portability problems. In particular, Rosimildo DaSilva - * saw seemingly random failures in the - * RTEMS port of omniORB2 when this code was enabled. - * - * Joel Sherrill 14 May 1999 - */ - - -#if 0 - /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */ - - if ( *mutex != PTHREAD_MUTEX_INITIALIZER ) { - - /* EBUSY if *mutex is a valid id */ - - mutex_in_use = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_REMOTE: - case OBJECTS_ERROR: - break; - case OBJECTS_LOCAL: - _Thread_Enable_dispatch(); - return EBUSY; - } - } -#endif - - if ( !the_attr->is_initialized ) - return EINVAL; - - /* - * XXX: Be careful about attributes when global!!! - */ - - assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) - return POSIX_MP_NOT_IMPLEMENTED(); -#endif - - /* - * Determine the discipline of the mutex - */ - - switch ( the_attr->protocol ) { - case PTHREAD_PRIO_NONE: - the_discipline = CORE_MUTEX_DISCIPLINES_FIFO; - break; - case PTHREAD_PRIO_INHERIT: - the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; - break; - case PTHREAD_PRIO_PROTECT: - the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; - break; - default: - return EINVAL; - } - - if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) - return EINVAL; - - _Thread_Disable_dispatch(); - - the_mutex = _POSIX_Mutex_Allocate(); - - if ( !the_mutex ) { - _Thread_Enable_dispatch(); - return EAGAIN; - } - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && - !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0, - the_mutex->Object.id, FALSE ) ) ) { - _POSIX_Mutex_Free( the_mutex ); - _Thread_Enable_dispatch(); - return EAGAIN; - } -#endif - - the_mutex->process_shared = the_attr->process_shared; - - the_mutex_attr = &the_mutex->Mutex.Attributes; - - if ( the_attr->recursive ) - the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; - else - the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; - the_mutex_attr->only_owner_release = TRUE; - the_mutex_attr->priority_ceiling = - _POSIX_Priority_To_core( the_attr->prio_ceiling ); - the_mutex_attr->discipline = the_discipline; - - /* - * Must be initialized to unlocked. - */ - - _CORE_mutex_Initialize( - &the_mutex->Mutex, - the_mutex_attr, - CORE_MUTEX_UNLOCKED - ); - - _Objects_Open( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); - - *mutex = the_mutex->Object.id; - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) - _POSIX_Mutex_MP_Send_process_packet( - POSIX_MUTEX_MP_ANNOUNCE_CREATE, - the_mutex->Object.id, - 0, /* Name not used */ - 0 /* Not used */ - ); -#endif - - _Thread_Enable_dispatch(); - return 0; -} diff --git a/c/src/exec/posix/src/mutexlock.c b/c/src/exec/posix/src/mutexlock.c deleted file mode 100644 index ce09506090..0000000000 --- a/c/src/exec/posix/src/mutexlock.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 - */ - -int pthread_mutex_lock( - pthread_mutex_t *mutex -) -{ - return _POSIX_Mutex_Lock_support( mutex, TRUE, THREAD_QUEUE_WAIT_FOREVER ); -} diff --git a/c/src/exec/posix/src/mutexlocksupp.c b/c/src/exec/posix/src/mutexlocksupp.c deleted file mode 100644 index 6db15c172f..0000000000 --- a/c/src/exec/posix/src/mutexlocksupp.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * _POSIX_Mutex_Lock_support - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of mutex lock. - */ - -int _POSIX_Mutex_Lock_support( - pthread_mutex_t *mutex, - boolean blocking, - Watchdog_Interval timeout -) -{ - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - ISR_Level level; - - the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - return _POSIX_Mutex_MP_Send_request_packet( - POSIX_MUTEX_MP_OBTAIN_REQUEST, - *mutex, - 0, /* must define the option set */ - WATCHDOG_NO_TIMEOUT - ); -#endif - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - _CORE_mutex_Seize( - &the_mutex->Mutex, - the_mutex->Object.id, - blocking, - timeout, - level - ); - return _POSIX_Mutex_From_core_mutex_status( - (CORE_mutex_Status) _Thread_Executing->Wait.return_code - ); - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mutexmp.c b/c/src/exec/posix/src/mutexmp.c deleted file mode 100644 index 75db779ce4..0000000000 --- a/c/src/exec/posix/src/mutexmp.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/* - * TEMPORARY - */ - -#if defined(RTEMS_MULTIPROCESSING) -void _POSIX_Mutex_MP_Send_process_packet ( - POSIX_Mutex_MP_Remote_operations operation, - Objects_Id mutex_id, - Objects_Name name, - Objects_Id proxy_id -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); -} - -void _POSIX_Mutex_MP_Send_object_was_deleted ( - Thread_Control *the_proxy -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); -} - -int _POSIX_Mutex_MP_Send_request_packet ( - POSIX_Mutex_MP_Remote_operations operation, - Objects_Id mutex_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -) -{ - return POSIX_MP_NOT_IMPLEMENTED(); -} - -void _POSIX_Threads_mutex_MP_support( - Thread_Control *the_thread, - Objects_Id id -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */ -} -#endif - -/* - * END OF TEMPORARY - */ diff --git a/c/src/exec/posix/src/mutexsetprioceiling.c b/c/src/exec/posix/src/mutexsetprioceiling.c deleted file mode 100644 index b1cd4c48d8..0000000000 --- a/c/src/exec/posix/src/mutexsetprioceiling.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 - */ - -int pthread_mutex_setprioceiling( - pthread_mutex_t *mutex, - int prioceiling, - int *old_ceiling -) -{ - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - Priority_Control the_priority; - int status; - - if ( !old_ceiling ) - return EINVAL; - - if ( !_POSIX_Priority_Is_valid( prioceiling ) ) - return EINVAL; - - the_priority = _POSIX_Priority_To_core( prioceiling ); - - /* - * Must acquire the mutex before we can change it's ceiling - */ - - status = pthread_mutex_lock( mutex ); - if ( status ) - return status; - - the_mutex = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - /* XXX It feels questionable to set the ceiling on a remote mutex. */ - return EINVAL; -#endif - case OBJECTS_ERROR: - return EINVAL; /* impossible to get here */ - case OBJECTS_LOCAL: - *old_ceiling = _POSIX_Priority_From_core( - the_mutex->Mutex.Attributes.priority_ceiling - ); - the_mutex->Mutex.Attributes.priority_ceiling = the_priority; - _CORE_mutex_Surrender( - &the_mutex->Mutex, - the_mutex->Object.id, -#if defined(RTEMS_MULTIPROCESSING) - _POSIX_Threads_mutex_MP_support -#else - NULL -#endif - ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/mutextimedlock.c b/c/src/exec/posix/src/mutextimedlock.c deleted file mode 100644 index 2a0bbbfbb2..0000000000 --- a/c/src/exec/posix/src/mutextimedlock.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 - */ - -int pthread_mutex_timedlock( - pthread_mutex_t *mutex, - const struct timespec *timeout -) -{ - return _POSIX_Mutex_Lock_support( - mutex, - TRUE, - _POSIX_Timespec_to_interval( timeout ) - ); -} diff --git a/c/src/exec/posix/src/mutextrylock.c b/c/src/exec/posix/src/mutextrylock.c deleted file mode 100644 index 87d6a47790..0000000000 --- a/c/src/exec/posix/src/mutextrylock.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 - */ - -int pthread_mutex_trylock( - pthread_mutex_t *mutex -) -{ - return _POSIX_Mutex_Lock_support( mutex, FALSE, THREAD_QUEUE_WAIT_FOREVER ); -} diff --git a/c/src/exec/posix/src/mutexunlock.c b/c/src/exec/posix/src/mutexunlock.c deleted file mode 100644 index 7169c7a2b1..0000000000 --- a/c/src/exec/posix/src/mutexunlock.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#endif -#include -#include -#include - -/*PAGE - * - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 - */ - -int pthread_mutex_unlock( - pthread_mutex_t *mutex -) -{ - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - CORE_mutex_Status status; - - the_mutex = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_REMOTE: -#if defined(RTEMS_MULTIPROCESSING) - return _POSIX_Mutex_MP_Send_request_packet( - POSIX_MUTEX_MP_RELEASE_REQUEST, - *mutex, - 0, /* Not used */ - MPCI_DEFAULT_TIMEOUT - ); -#endif - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_LOCAL: - status = _CORE_mutex_Surrender( - &the_mutex->Mutex, - the_mutex->Object.id, -#if defined(RTEMS_MULTIPROCESSING) - _POSIX_Threads_mutex_MP_support -#else - NULL -#endif - ); - _Thread_Enable_dispatch(); - return _POSIX_Mutex_From_core_mutex_status( status ); - break; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/nanosleep.c b/c/src/exec/posix/src/nanosleep.c deleted file mode 100644 index 24f9dd6969..0000000000 --- a/c/src/exec/posix/src/nanosleep.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 14.2.5 High Resolution Sleep, P1003.1b-1993, p. 269 - */ - -int nanosleep( - const struct timespec *rqtp, - struct timespec *rmtp -) -{ - Watchdog_Interval ticks; - struct timespec *the_rqtp; - - if ( !rqtp ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - the_rqtp = (struct timespec *)rqtp; - - /* - * Return EAGAIN if the delay interval is negative. - * - * NOTE: This behavior is beyond the POSIX specification. - * FSU pthreads shares this behavior. - */ - - if ( the_rqtp->tv_sec < 0 ) - the_rqtp->tv_sec = 0; - - if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 ) - rtems_set_errno_and_return_minus_one( EAGAIN ); - - if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - ticks = _POSIX_Timespec_to_interval( the_rqtp ); - - /* - * This behavior is also beyond the POSIX specification but is - * consistent with the RTEMS api and yields desirable behavior. - */ - - if ( !ticks ) { - _Thread_Disable_dispatch(); - _Thread_Yield_processor(); - _Thread_Enable_dispatch(); - if ( rmtp ) { - rmtp->tv_sec = 0; - rmtp->tv_nsec = 0; - } - return 0; - } - - _Thread_Disable_dispatch(); - _Thread_Set_state( - _Thread_Executing, - STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL - ); - _Watchdog_Initialize( - &_Thread_Executing->Timer, - _Thread_Delay_ended, - _Thread_Executing->Object.id, - NULL - ); - _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); - _Thread_Enable_dispatch(); - - /* calculate time remaining */ - - if ( rmtp ) { - ticks -= - _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; - - _POSIX_Interval_to_timespec( ticks, rmtp ); - - /* - * If there is time remaining, then we were interrupted by a signal. - */ - - if ( ticks ) - rtems_set_errno_and_return_minus_one( EINTR ); - } - - return 0; -} diff --git a/c/src/exec/posix/src/pause.c b/c/src/exec/posix/src/pause.c deleted file mode 100644 index 5b0ceb9efc..0000000000 --- a/c/src/exec/posix/src/pause.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -/* - * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 - */ - -int pause( void ) -{ - sigset_t all_signals; - int status; - - (void) sigfillset( &all_signals ); - - status = sigtimedwait( &all_signals, NULL, NULL ); - - return status; -} - diff --git a/c/src/exec/posix/src/posixintervaltotimespec.c b/c/src/exec/posix/src/posixintervaltotimespec.c deleted file mode 100644 index 4443f4d308..0000000000 --- a/c/src/exec/posix/src/posixintervaltotimespec.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * _POSIX_Interval_to_timespec - */ - -void _POSIX_Interval_to_timespec( - Watchdog_Interval ticks, - struct timespec *time -) -{ - unsigned32 usecs; - - usecs = ticks * _TOD_Microseconds_per_tick; - - time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND; - time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) * - TOD_NANOSECONDS_PER_MICROSECOND; -} diff --git a/c/src/exec/posix/src/posixtimespecsubtract.c b/c/src/exec/posix/src/posixtimespecsubtract.c deleted file mode 100644 index 1b6cc75902..0000000000 --- a/c/src/exec/posix/src/posixtimespecsubtract.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * _POSIX_Timespec_subtract - */ - -void _POSIX_Timespec_subtract( - const struct timespec *the_start, - const struct timespec *end, - struct timespec *result -) -{ - struct timespec start_struct = *the_start; - struct timespec *start = &start_struct; - unsigned int nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND; - - if (end->tv_nsec < start->tv_nsec) { - int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1; - start->tv_nsec -= nsecs_per_sec * seconds; - start->tv_sec += seconds; - } - - if (end->tv_nsec - start->tv_nsec > nsecs_per_sec) { - int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec; - start->tv_nsec += nsecs_per_sec * seconds; - start->tv_sec -= seconds; - } - - result->tv_sec = end->tv_sec - start->tv_sec; - result->tv_nsec = end->tv_nsec - start->tv_nsec; -} diff --git a/c/src/exec/posix/src/posixtimespectointerval.c b/c/src/exec/posix/src/posixtimespectointerval.c deleted file mode 100644 index 5aa5f0c56f..0000000000 --- a/c/src/exec/posix/src/posixtimespectointerval.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * _POSIX_Timespec_to_interval - */ - -Watchdog_Interval _POSIX_Timespec_to_interval( - const struct timespec *time -) -{ - Watchdog_Interval ticks; - - ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) / - _TOD_Microseconds_per_tick; - - ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / - _TOD_Microseconds_per_tick; - - if (ticks) - return ticks; - - return 1; -} diff --git a/c/src/exec/posix/src/psignal.c b/c/src/exec/posix/src/psignal.c deleted file mode 100644 index f93b6cc7c1..0000000000 --- a/c/src/exec/posix/src/psignal.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include /* memcpy */ -#include /* exit */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * Currently 32 signals numbered 1-32 are defined - */ - -#define SIGNAL_EMPTY_MASK 0x00000000 -#define SIGNAL_ALL_MASK 0xffffffff - -#define signo_to_mask( _sig ) (1 << ((_sig) - 1)) - -#define is_valid_signo( _sig ) \ - ((_sig) >= 1 && (_sig) <= 32 ) - -/*** PROCESS WIDE STUFF ****/ - -sigset_t _POSIX_signals_Pending; - -void _POSIX_signals_Abnormal_termination_handler( int signo ) -{ - exit( 1 ); -} - -#define SIG_ARRAY_MAX (SIGRTMAX + 1) -struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = { - /* NO SIGNAL 0 */ SIGACTION_IGNORE, - /* SIGHUP 1 */ SIGACTION_TERMINATE, - /* SIGINT 2 */ SIGACTION_TERMINATE, - /* SIGQUIT 3 */ SIGACTION_TERMINATE, - /* SIGILL 4 */ SIGACTION_TERMINATE, - /* SIGTRAP 5 */ SIGACTION_TERMINATE, - /* SIGIOT 6 */ SIGACTION_TERMINATE, - /* SIGABRT 6 SIGACTION_TERMINATE, -- alias for SIGIOT */ - /* SIGEMT 7 */ SIGACTION_TERMINATE, - /* SIGFPE 8 */ SIGACTION_TERMINATE, - /* SIGKILL 9 */ SIGACTION_TERMINATE, - /* SIGBUS 10 */ SIGACTION_TERMINATE, - /* SIGSEGV 11 */ SIGACTION_TERMINATE, - /* SIGSYS 12 */ SIGACTION_TERMINATE, - /* SIGPIPE 13 */ SIGACTION_TERMINATE, - /* SIGALRM 14 */ SIGACTION_TERMINATE, - /* SIGTERM 15 */ SIGACTION_TERMINATE, - /* SIGUSR1 16 */ SIGACTION_TERMINATE, - /* SIGUSR2 17 */ SIGACTION_TERMINATE, - /* SIGRTMIN 18 */ SIGACTION_TERMINATE, - /* SIGRT 19 */ SIGACTION_TERMINATE, - /* SIGRT 20 */ SIGACTION_TERMINATE, - /* SIGRT 21 */ SIGACTION_TERMINATE, - /* SIGRT 22 */ SIGACTION_TERMINATE, - /* SIGRT 23 */ SIGACTION_TERMINATE, - /* SIGRT 24 */ SIGACTION_TERMINATE, - /* SIGRT 25 */ SIGACTION_TERMINATE, - /* SIGRT 26 */ SIGACTION_TERMINATE, - /* SIGRT 27 */ SIGACTION_TERMINATE, - /* SIGRT 28 */ SIGACTION_TERMINATE, - /* SIGRT 29 */ SIGACTION_TERMINATE, - /* SIGRT 30 */ SIGACTION_TERMINATE, - /* SIGRT 31 */ SIGACTION_TERMINATE, - /* SIGRTMAX 32 */ SIGACTION_TERMINATE -}; - -struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; - -Watchdog_Control _POSIX_signals_Alarm_timer; - -Thread_queue_Control _POSIX_signals_Wait_queue; - -Chain_Control _POSIX_signals_Inactive_siginfo; -Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; - -/*PAGE - * - * XXX - move these - */ - -#define _States_Is_interruptible_signal( _states ) \ - ( ((_states) & \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ - (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) - -/* - * _POSIX_signals_Post_switch_extension - */ - -void _POSIX_signals_Post_switch_extension( - Thread_Control *the_thread -) -{ - POSIX_API_Control *api; - int signo; - ISR_Level level; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - /* - * If we invoke any user code, there is the possibility that - * a new signal has been posted that we should process so we - * restart the loop if a signal handler was invoked. - * - * The first thing done is to check there are any signals to be - * processed at all. No point in doing this loop otherwise. - */ - -restart: - _ISR_Disable( level ); - if ( !(~api->signals_blocked & - (api->signals_pending | _POSIX_signals_Pending)) ) { - _ISR_Enable( level ); - return; - } - _ISR_Enable( level ); - - for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { - - if ( _POSIX_signals_Check_signal( api, signo, FALSE ) ) - goto restart; - - if ( _POSIX_signals_Check_signal( api, signo, TRUE ) ) - goto restart; - - } - -/* XXX - add __SIGFIRSTNOTRT or something like that to newlib signal .h */ - - for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { - - if ( _POSIX_signals_Check_signal( api, signo, FALSE ) ) - goto restart; - - if ( _POSIX_signals_Check_signal( api, signo, TRUE ) ) - goto restart; - - } - -} - -/*PAGE - * - * _POSIX_signals_Alarm_TSR - */ - -void _POSIX_signals_Alarm_TSR( - Objects_Id id, - void *argument -) -{ - int status; - - status = kill( getpid(), SIGALRM ); - /* XXX can't print from an ISR, should this be fatal? */ - assert( !status ); -} - -/*PAGE - * - * _POSIX_signals_Manager_Initialization - */ - -void _POSIX_signals_Manager_Initialization( - int maximum_queued_signals -) -{ - unsigned32 signo; - - /* - * Insure we have the same number of vectors and default vector entries - */ - - assert( - sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors) - ); - - memcpy( - _POSIX_signals_Vectors, - _POSIX_signals_Default_vectors, - sizeof( _POSIX_signals_Vectors ) - ); - - /* - * Initialize the set of pending signals for the entire process - */ - - sigemptyset( &_POSIX_signals_Pending ); - - /* - * Initialize the timer used to implement alarm(). - */ - - _Watchdog_Initialize( - &_POSIX_signals_Alarm_timer, - _POSIX_signals_Alarm_TSR, - 0, - NULL - ); - - /* - * Initialize the queue we use to block for signals - */ - - _Thread_queue_Initialize( - &_POSIX_signals_Wait_queue, - THREAD_QUEUE_DISCIPLINE_PRIORITY, - STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL, - EAGAIN - ); - - /* XXX status codes */ - - /* - * Allocate the siginfo pools. - */ - - for ( signo=1 ; signo<= SIGRTMAX ; signo++ ) - _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] ); - - _Chain_Initialize( - &_POSIX_signals_Inactive_siginfo, - _Workspace_Allocate_or_fatal_error( - maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node ) - ), - maximum_queued_signals, - sizeof( POSIX_signals_Siginfo_node ) - ); -} diff --git a/c/src/exec/posix/src/psignalchecksignal.c b/c/src/exec/posix/src/psignalchecksignal.c deleted file mode 100644 index 74ee70b906..0000000000 --- a/c/src/exec/posix/src/psignalchecksignal.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/*PAGE - * - * _POSIX_signals_Check_signal - */ - -boolean _POSIX_signals_Check_signal( - POSIX_API_Control *api, - int signo, - boolean is_global -) -{ - siginfo_t siginfo_struct; - sigset_t saved_signals_blocked; - - if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, - is_global, TRUE ) ) - return FALSE; - - /* - * Since we made a union of these, only one test is necessary but this is - * safer. - */ - - assert( _POSIX_signals_Vectors[ signo ].sa_handler || - _POSIX_signals_Vectors[ signo ].sa_sigaction ); - - /* - * Just to prevent sending a signal which is currently being ignored. - */ - - if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) - return FALSE; - - /* - * Block the signals requested in sa_mask - */ - - saved_signals_blocked = api->signals_blocked; - api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; - - /* Here, the signal handler function executes */ - - switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { - case SA_SIGINFO: -/* - * - * assert( is_global ); - */ - (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( - signo, - &siginfo_struct, - NULL /* context is undefined per 1003.1b-1993, p. 66 */ - ); - break; - default: - (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); - break; - } - - /* - * Restore the previous set of blocked signals - */ - - api->signals_blocked = saved_signals_blocked; - - return TRUE; -} - diff --git a/c/src/exec/posix/src/psignalclearprocesssignals.c b/c/src/exec/posix/src/psignalclearprocesssignals.c deleted file mode 100644 index 1ff39534d3..0000000000 --- a/c/src/exec/posix/src/psignalclearprocesssignals.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_signals_Clear_process_signals - */ - -void _POSIX_signals_Clear_process_signals( - sigset_t mask -) -{ - ISR_Level level; - - _ISR_Disable( level ); - _POSIX_signals_Pending &= ~mask; - if ( !_POSIX_signals_Pending ) - _Thread_Do_post_task_switch_extension--; - _ISR_Enable( level ); -} diff --git a/c/src/exec/posix/src/psignalclearsignals.c b/c/src/exec/posix/src/psignalclearsignals.c deleted file mode 100644 index 69517f5dc5..0000000000 --- a/c/src/exec/posix/src/psignalclearsignals.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_signals_Clear_signals - */ - -boolean _POSIX_signals_Clear_signals( - POSIX_API_Control *api, - int signo, - siginfo_t *info, - boolean is_global, - boolean check_blocked -) -{ - sigset_t mask; - sigset_t signals_blocked; - ISR_Level level; - boolean do_callout; - POSIX_signals_Siginfo_node *psiginfo; - - mask = signo_to_mask( signo ); - - do_callout = FALSE; - - /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK - * insures that no signals are blocked and all are checked. - */ - - if ( check_blocked ) - signals_blocked = ~api->signals_blocked; - else - signals_blocked = SIGNAL_ALL_MASK; - - /* XXX this is not right for siginfo type signals yet */ - /* XXX since they can't be cleared the same way */ - - _ISR_Disable( level ); - if ( is_global ) { - if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { - if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { - psiginfo = (POSIX_signals_Siginfo_node *) - _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); - if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) - _POSIX_signals_Clear_process_signals( mask ); - if ( psiginfo ) { - *info = psiginfo->Info; - _Chain_Append_unprotected( - &_POSIX_signals_Inactive_siginfo, - &psiginfo->Node - ); - } else - do_callout = FALSE; - } else - _POSIX_signals_Clear_process_signals( mask ); - do_callout = TRUE; - } - } else { - if ( mask & (api->signals_pending & signals_blocked) ) { - api->signals_pending &= ~mask; - do_callout = TRUE; - } - } - _ISR_Enable( level ); - return do_callout; -} diff --git a/c/src/exec/posix/src/psignalsetprocesssignals.c b/c/src/exec/posix/src/psignalsetprocesssignals.c deleted file mode 100644 index b2f6599b4d..0000000000 --- a/c/src/exec/posix/src/psignalsetprocesssignals.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_signals_Set_process_signals - */ - -void _POSIX_signals_Set_process_signals( - sigset_t mask -) -{ - ISR_Level level; - - _ISR_Disable( level ); - if ( !_POSIX_signals_Pending ) - _Thread_Do_post_task_switch_extension++; - _POSIX_signals_Pending |= mask; - _ISR_Enable( level ); -} diff --git a/c/src/exec/posix/src/psignalunblockthread.c b/c/src/exec/posix/src/psignalunblockthread.c deleted file mode 100644 index 3141c840c4..0000000000 --- a/c/src/exec/posix/src/psignalunblockthread.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/*PAGE - * - * _POSIX_signals_Unblock_thread - */ - -/* XXX this routine could probably be cleaned up */ -boolean _POSIX_signals_Unblock_thread( - Thread_Control *the_thread, - int signo, - siginfo_t *info -) -{ - POSIX_API_Control *api; - sigset_t mask; - siginfo_t *the_info = NULL; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - mask = signo_to_mask( signo ); - - /* - * Is the thread is specifically waiting for a signal? - */ - - if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { - - if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { - the_thread->Wait.return_code = EINTR; - - the_info = (siginfo_t *) the_thread->Wait.return_argument; - - if ( !info ) { - the_info->si_signo = signo; - the_info->si_code = SI_USER; - the_info->si_value.sival_int = 0; - } else { - *the_info = *info; - } - - _Thread_queue_Extract_with_proxy( the_thread ); - return TRUE; - } - - /* - * This should only be reached via pthread_kill(). - */ - - return FALSE; - } - - if ( ~api->signals_blocked & mask ) { - the_thread->do_post_task_switch_extension = TRUE; - - if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { - the_thread->Wait.return_code = EINTR; - if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) - _Thread_queue_Extract_with_proxy( the_thread ); - else if ( _States_Is_delaying(the_thread->current_state)){ - if ( _Watchdog_Is_active( &the_thread->Timer ) ) - (void) _Watchdog_Remove( &the_thread->Timer ); - _Thread_Unblock( the_thread ); - } - } - } - return FALSE; - -} diff --git a/c/src/exec/posix/src/pthread.c b/c/src/exec/posix/src/pthread.c deleted file mode 100644 index e91bcd4708..0000000000 --- a/c/src/exec/posix/src/pthread.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * The default pthreads attributes structure. - * - * NOTE: Be careful .. if the default attribute set changes, - * _POSIX_Threads_Initialize_user_threads will need to be examined. - * - */ - -const pthread_attr_t _POSIX_Threads_Default_attributes = { - TRUE, /* is_initialized */ - NULL, /* stackaddr */ - PTHREAD_MINIMUM_STACK_SIZE, /* stacksize */ - PTHREAD_SCOPE_PROCESS, /* contentionscope */ - PTHREAD_INHERIT_SCHED, /* inheritsched */ - SCHED_FIFO, /* schedpolicy */ - { /* schedparam */ - 2, /* sched_priority */ - 0, /* ss_low_priority */ - { 0L, 0 }, /* ss_replenish_period */ - { 0L, 0 } /* ss_initial_budget */ - }, - PTHREAD_CREATE_JOINABLE, /* detachstate */ - 1 /* cputime_clock_allowed */ -}; - -/*PAGE - * - * _POSIX_Threads_Sporadic_budget_TSR - */ - -void _POSIX_Threads_Sporadic_budget_TSR( - Objects_Id id, - void *argument -) -{ - unsigned32 ticks; - unsigned32 new_priority; - Thread_Control *the_thread; - POSIX_API_Control *api; - - the_thread = argument; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget ); - - if ( !ticks ) - ticks = 1; - - the_thread->cpu_time_budget = ticks; - - new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); - the_thread->real_priority = new_priority; - - if ( the_thread->resource_count == 0 || - the_thread->current_priority > new_priority ) - _Thread_Change_priority( the_thread, new_priority, TRUE ); - - ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period ); - - if ( !ticks ) - ticks = 1; - - _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); -} - -/*PAGE - * - * _POSIX_Threads_Sporadic_budget_callout - */ - -void _POSIX_Threads_Sporadic_budget_callout( - Thread_Control *the_thread -) -{ - POSIX_API_Control *api; - unsigned32 new_priority; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - /* - * This will prevent the thread from consuming its entire "budget" - * while at low priority. - */ - - - the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ - - new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority ); - the_thread->real_priority = new_priority; - - if ( the_thread->resource_count == 0 || - the_thread->current_priority > new_priority ) - _Thread_Change_priority( the_thread, new_priority, TRUE ); -} - -/*PAGE - * - * _POSIX_Threads_Create_extension - * - * XXX - */ - -boolean _POSIX_Threads_Create_extension( - Thread_Control *executing, - Thread_Control *created -) -{ - POSIX_API_Control *api; - POSIX_API_Control *executing_api; - - api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); - - if ( !api ) - return FALSE; - - created->API_Extensions[ THREAD_API_POSIX ] = api; - - /* XXX check all fields are touched */ - api->Attributes = _POSIX_Threads_Default_attributes; - api->detachstate = _POSIX_Threads_Default_attributes.detachstate; - api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; - api->schedparam = _POSIX_Threads_Default_attributes.schedparam; - api->schedparam.sched_priority = - _POSIX_Priority_From_core( created->current_priority ); - - /* - * POSIX 1003.1 1996, 18.2.2.2 - */ - api->cancelation_requested = 0; - api->cancelability_state = PTHREAD_CANCEL_ENABLE; - api->cancelability_type = PTHREAD_CANCEL_DEFERRED; - _Chain_Initialize_empty (&api->Cancellation_Handlers); - - /* - * If the thread is not a posix thread, then all posix signals are blocked - * by default. - */ - - /* XXX use signal constants */ - api->signals_pending = 0; - if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API && - _Objects_Get_class( created->Object.id ) == 1 ) { - executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - api->signals_blocked = api->signals_blocked; - } else - api->signals_blocked = 0xffffffff; - - _Thread_queue_Initialize( - &api->Join_List, - THREAD_QUEUE_DISCIPLINE_FIFO, - STATES_WAITING_FOR_JOIN_AT_EXIT, - 0 - ); - - _Watchdog_Initialize( - &api->Sporadic_timer, - _POSIX_Threads_Sporadic_budget_TSR, - created->Object.id, - created - ); - - return TRUE; -} - -/*PAGE - * - * _POSIX_Threads_Delete_extension - */ - -User_extensions_routine _POSIX_Threads_Delete_extension( - Thread_Control *executing, - Thread_Control *deleted -) -{ - Thread_Control *the_thread; - POSIX_API_Control *api; - void **value_ptr; - - api = deleted->API_Extensions[ THREAD_API_POSIX ]; - - /* - * Run the POSIX cancellation handlers - */ - - _POSIX_Keys_Run_destructors( deleted ); - - /* - * Wakeup all the tasks which joined with this one - */ - - value_ptr = (void **) deleted->Wait.return_argument; - - while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) - *(void **)the_thread->Wait.return_argument = value_ptr; - - if ( api->schedpolicy == SCHED_SPORADIC ) - (void) _Watchdog_Remove( &api->Sporadic_timer ); - - deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; - - (void) _Workspace_Free( api ); -} - -/* - * - * _POSIX_Threads_Exitted_extension - */ - -User_extensions_routine _POSIX_Threads_Exitted_extension( - Thread_Control *executing -) -{ - pthread_exit( executing->Wait.return_argument ); -} - -/*PAGE - * - * _POSIX_Threads_Initialize_user_threads - * - * This routine creates and starts all configured user - * initialzation threads. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - -void _POSIX_Threads_Initialize_user_threads( void ) -{ - int status; - unsigned32 index; - unsigned32 maximum; - posix_initialization_threads_table *user_threads; - pthread_t thread_id; - pthread_attr_t attr; - - user_threads = _POSIX_Threads_User_initialization_threads; - maximum = _POSIX_Threads_Number_of_initialization_threads; - - if ( !user_threads || maximum == 0 ) - return; - - /* - * Be careful .. if the default attribute set changes, this may need to. - * - * Setting the attributes explicitly is critical, since we don't want - * to inherit the idle tasks attributes. - */ - - for ( index=0 ; index < maximum ; index++ ) { - status = pthread_attr_init( &attr ); - assert( !status ); - - status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); - assert( !status ); - - status = pthread_attr_setstacksize( &attr, user_threads[ index ].stack_size); - assert( !status ); - - status = pthread_create( - &thread_id, - &attr, - user_threads[ index ].thread_entry, - NULL - ); - assert( !status ); - } -} - -/*PAGE - * - * API Extension control structures - */ - -API_extensions_Control _POSIX_Threads_API_extensions = { - { NULL, NULL }, - NULL, /* predriver */ - _POSIX_Threads_Initialize_user_threads, /* postdriver */ - _POSIX_signals_Post_switch_extension, /* post switch */ -}; - -User_extensions_Control _POSIX_Threads_User_extensions = { - { NULL, NULL }, - { { NULL, NULL }, NULL }, - { _POSIX_Threads_Create_extension, /* create */ - NULL, /* start */ - NULL, /* restart */ - _POSIX_Threads_Delete_extension, /* delete */ - NULL, /* switch */ - NULL, /* begin */ - _POSIX_Threads_Exitted_extension, /* exitted */ - NULL /* fatal */ - } -}; - -/*PAGE - * - * _POSIX_Threads_Manager_initialization - * - * This routine initializes all threads manager related data structures. - * - * Input parameters: - * maximum_pthreads - maximum configured pthreads - * - * Output parameters: NONE - */ - -void _POSIX_Threads_Manager_initialization( - unsigned32 maximum_pthreads, - unsigned32 number_of_initialization_threads, - posix_initialization_threads_table *user_threads - -) -{ - _POSIX_Threads_Number_of_initialization_threads = - number_of_initialization_threads; - _POSIX_Threads_User_initialization_threads = user_threads; - - /* - * There may not be any POSIX initialization threads configured. - */ - -#if 0 - if ( user_threads == NULL || number_of_initialization_threads == 0 ) - _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, TRUE, EINVAL ); -#endif - - _Objects_Initialize_information( - &_POSIX_Threads_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_THREADS, /* object class */ - maximum_pthreads, /* maximum objects of this class */ - sizeof( Thread_Control ), - /* size of this object's control block */ - FALSE, /* TRUE if names for this object are strings */ - 0 /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); - - /* - * Add all the extensions for this API - */ - - _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions ); - - _API_extensions_Add( &_POSIX_Threads_API_extensions ); - - - /* - * If we supported MP, then here we would ... - * Register the MP Process Packet routine. - */ - -} diff --git a/c/src/exec/posix/src/pthreadatfork.c b/c/src/exec/posix/src/pthreadatfork.c deleted file mode 100644 index f8eaf6da90..0000000000 --- a/c/src/exec/posix/src/pthreadatfork.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * pthread_atfork() - POSIX 1003.1b 3.1.3 - * - * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27 - * - * RTEMS does not support processes, so we fall under this and do not - * provide this routine: - * - * "Either the implementation shall support the pthread_atfork() function - * as described above or the pthread_atfork() funciton shall not be - * provided." - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_atfork( - void (*prepare)(void), - void (*parent)(void), - void (*child)(void) -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/pthreadattrdestroy.c b/c/src/exec/posix/src/pthreadattrdestroy.c deleted file mode 100644 index 0512a51dc1..0000000000 --- a/c/src/exec/posix/src/pthreadattrdestroy.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - -int pthread_attr_destroy( - pthread_attr_t *attr -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - attr->is_initialized = FALSE; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrgetdetachstate.c b/c/src/exec/posix/src/pthreadattrgetdetachstate.c deleted file mode 100644 index 98752472a8..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetdetachstate.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getdetachstate( - const pthread_attr_t *attr, - int *detachstate -) -{ - if ( !attr || !attr->is_initialized || !detachstate ) - return EINVAL; - - *detachstate = attr->detachstate; - return 0; -} - diff --git a/c/src/exec/posix/src/pthreadattrgetinheritsched.c b/c/src/exec/posix/src/pthreadattrgetinheritsched.c deleted file mode 100644 index 12daea381e..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetinheritsched.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getinheritsched( - const pthread_attr_t *attr, - int *inheritsched -) -{ - if ( !attr || !attr->is_initialized || !inheritsched ) - return EINVAL; - - *inheritsched = attr->inheritsched; - return 0; -} - diff --git a/c/src/exec/posix/src/pthreadattrgetschedparam.c b/c/src/exec/posix/src/pthreadattrgetschedparam.c deleted file mode 100644 index 913af08171..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetschedparam.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getschedparam( - const pthread_attr_t *attr, - struct sched_param *param -) -{ - if ( !attr || !attr->is_initialized || !param ) - return EINVAL; - - *param = attr->schedparam; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrgetschedpolicy.c b/c/src/exec/posix/src/pthreadattrgetschedpolicy.c deleted file mode 100644 index b8d2c2a26b..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetschedpolicy.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getschedpolicy( - const pthread_attr_t *attr, - int *policy -) -{ - if ( !attr || !attr->is_initialized || !policy ) - return EINVAL; - - *policy = attr->schedpolicy; - return 0; -} - diff --git a/c/src/exec/posix/src/pthreadattrgetscope.c b/c/src/exec/posix/src/pthreadattrgetscope.c deleted file mode 100644 index 2488e4dd59..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetscope.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getscope( - const pthread_attr_t *attr, - int *contentionscope -) -{ - if ( !attr || !attr->is_initialized || !contentionscope ) - return EINVAL; - - *contentionscope = attr->contentionscope; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrgetstackaddr.c b/c/src/exec/posix/src/pthreadattrgetstackaddr.c deleted file mode 100644 index d39fad1ca9..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetstackaddr.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getstackaddr( - const pthread_attr_t *attr, - void **stackaddr -) -{ - if ( !attr || !attr->is_initialized || !stackaddr ) - return EINVAL; - - *stackaddr = attr->stackaddr; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrgetstacksize.c b/c/src/exec/posix/src/pthreadattrgetstacksize.c deleted file mode 100644 index d5e8d6cfd8..0000000000 --- a/c/src/exec/posix/src/pthreadattrgetstacksize.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getstacksize( - const pthread_attr_t *attr, - size_t *stacksize -) -{ - if ( !attr || !attr->is_initialized || !stacksize ) - return EINVAL; - - *stacksize = attr->stacksize; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrinit.c b/c/src/exec/posix/src/pthreadattrinit.c deleted file mode 100644 index 661a107ed8..0000000000 --- a/c/src/exec/posix/src/pthreadattrinit.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -int pthread_attr_init( - pthread_attr_t *attr -) -{ - if ( !attr ) - return EINVAL; - - *attr = _POSIX_Threads_Default_attributes; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrsetdetachstate.c b/c/src/exec/posix/src/pthreadattrsetdetachstate.c deleted file mode 100644 index 7c543286f4..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetdetachstate.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_setdetachstate( - pthread_attr_t *attr, - int detachstate -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( detachstate ) { - case PTHREAD_CREATE_DETACHED: - case PTHREAD_CREATE_JOINABLE: - attr->detachstate = detachstate; - return 0; - - default: - return EINVAL; - } -} diff --git a/c/src/exec/posix/src/pthreadattrsetinheritsched.c b/c/src/exec/posix/src/pthreadattrsetinheritsched.c deleted file mode 100644 index 63dbd60b23..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetinheritsched.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -int pthread_attr_setinheritsched( - pthread_attr_t *attr, - int inheritsched -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( inheritsched ) { - case PTHREAD_INHERIT_SCHED: - case PTHREAD_EXPLICIT_SCHED: - attr->inheritsched = inheritsched; - return 0; - - default: - return ENOTSUP; - } -} diff --git a/c/src/exec/posix/src/pthreadattrsetschedparam.c b/c/src/exec/posix/src/pthreadattrsetschedparam.c deleted file mode 100644 index 6cd341264f..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetschedparam.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_setschedparam( - pthread_attr_t *attr, - const struct sched_param *param -) -{ - if ( !attr || !attr->is_initialized || !param ) - return EINVAL; - - attr->schedparam = *param; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrsetschedpolicy.c b/c/src/exec/posix/src/pthreadattrsetschedpolicy.c deleted file mode 100644 index fddcb9033c..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetschedpolicy.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -int pthread_attr_setschedpolicy( - pthread_attr_t *attr, - int policy -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( policy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - case SCHED_SPORADIC: - attr->schedpolicy = policy; - return 0; - - default: - return ENOTSUP; - } -} diff --git a/c/src/exec/posix/src/pthreadattrsetscope.c b/c/src/exec/posix/src/pthreadattrsetscope.c deleted file mode 100644 index d9051e8d2c..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetscope.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -int pthread_attr_setscope( - pthread_attr_t *attr, - int contentionscope -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( contentionscope ) { - case PTHREAD_SCOPE_PROCESS: - attr->contentionscope = contentionscope; - return 0; - - case PTHREAD_SCOPE_SYSTEM: - return ENOTSUP; - - default: - return EINVAL; - } -} diff --git a/c/src/exec/posix/src/pthreadattrsetstackaddr.c b/c/src/exec/posix/src/pthreadattrsetstackaddr.c deleted file mode 100644 index 0278074d3a..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetstackaddr.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_setstackaddr( - pthread_attr_t *attr, - void *stackaddr -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - attr->stackaddr = stackaddr; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadattrsetstacksize.c b/c/src/exec/posix/src/pthreadattrsetstacksize.c deleted file mode 100644 index 5fb3849b0f..0000000000 --- a/c/src/exec/posix/src/pthreadattrsetstacksize.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -int pthread_attr_setstacksize( - pthread_attr_t *attr, - size_t stacksize -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - if (stacksize < PTHREAD_MINIMUM_STACK_SIZE) - attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE; - else - attr->stacksize = stacksize; - return 0; -} diff --git a/c/src/exec/posix/src/pthreadcreate.c b/c/src/exec/posix/src/pthreadcreate.c deleted file mode 100644 index 7c6e7db132..0000000000 --- a/c/src/exec/posix/src/pthreadcreate.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include - -int pthread_create( - pthread_t *thread, - const pthread_attr_t *attr, - void *(*start_routine)( void * ), - void *arg -) -{ - const pthread_attr_t *the_attr; - Priority_Control core_priority; - Thread_CPU_budget_algorithms budget_algorithm; - Thread_CPU_budget_algorithm_callout budget_callout; - boolean is_fp; - boolean status; - Thread_Control *the_thread; - POSIX_API_Control *api; - int schedpolicy = SCHED_RR; - struct sched_param schedparam; - - the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; - - if ( !the_attr->is_initialized ) - return EINVAL; - - /* - * Core Thread Initialize insures we get the minimum amount of - * stack space if it is allowed to allocate it itself. - */ - - if ( the_attr->stackaddr && !_Stack_Is_enough( the_attr->stacksize ) ) - return EINVAL; - -#if 0 - int cputime_clock_allowed; /* see time.h */ - POSIX_NOT_IMPLEMENTED(); -#endif - - /* - * P1003.1c/Draft 10, p. 121. - * - * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread - * inherits scheduling attributes from the creating thread. If it is - * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the - * attributes structure. - */ - - switch ( the_attr->inheritsched ) { - case PTHREAD_INHERIT_SCHED: - api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - schedpolicy = api->schedpolicy; - schedparam = api->schedparam; - break; - - case PTHREAD_EXPLICIT_SCHED: - schedpolicy = the_attr->schedpolicy; - schedparam = the_attr->schedparam; - break; - - default: - return EINVAL; - } - - /* - * Check the contentionscope since rtems only supports PROCESS wide - * contention (i.e. no system wide contention). - */ - - if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) - return ENOTSUP; - - /* - * Interpret the scheduling parameters. - */ - - if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) - return EINVAL; - - core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); - - /* - * Set the core scheduling policy information. - */ - - budget_callout = NULL; - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; - - switch ( schedpolicy ) { - case SCHED_OTHER: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; - break; - - case SCHED_FIFO: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; - break; - - case SCHED_RR: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; - break; - - case SCHED_SPORADIC: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; - budget_callout = _POSIX_Threads_Sporadic_budget_callout; - - if ( _POSIX_Timespec_to_interval( &schedparam.ss_replenish_period ) < - _POSIX_Timespec_to_interval( &schedparam.ss_initial_budget ) ) - return EINVAL; - - if ( !_POSIX_Priority_Is_valid( schedparam.ss_low_priority ) ) - return EINVAL; - - break; - - default: - return EINVAL; - } - - /* - * Currently all POSIX threads are floating point if the hardware - * supports it. - */ - - -#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) - is_fp = TRUE; -#else - is_fp = FALSE; -#endif - - /* - * Disable dispatch for protection - */ - - _Thread_Disable_dispatch(); - - /* - * Allocate the thread control block. - * - * NOTE: Global threads are not currently supported. - */ - - the_thread = _POSIX_Threads_Allocate(); - - if ( !the_thread ) { - _Thread_Enable_dispatch(); - return EAGAIN; - } - - /* - * Initialize the core thread for this task. - */ - - status = _Thread_Initialize( - &_POSIX_Threads_Information, - the_thread, - the_attr->stackaddr, - the_attr->stacksize, - is_fp, - core_priority, - TRUE, /* preemptible */ - budget_algorithm, - budget_callout, - 0, /* isr level */ - NULL /* posix threads don't have a name */ - ); - - if ( !status ) { - _POSIX_Threads_Free( the_thread ); - _Thread_Enable_dispatch(); - return EAGAIN; - } - - /* - * finish initializing the per API structure - */ - - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - api->Attributes = *the_attr; - api->detachstate = the_attr->detachstate; - api->schedpolicy = schedpolicy; - api->schedparam = schedparam; - - /* - * This insures we evaluate the process-wide signals pending when we - * first run. - * - * NOTE: Since the thread starts with all unblocked, this is necessary. - */ - - the_thread->do_post_task_switch_extension = TRUE; - - /* - * POSIX threads are allocated and started in one operation. - */ - - status = _Thread_Start( - the_thread, - THREAD_START_POINTER, - start_routine, - arg, - 0 /* unused */ - ); - - if ( schedpolicy == SCHED_SPORADIC ) { - _Watchdog_Insert_ticks( - &api->Sporadic_timer, - _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period ) - ); - } - - /* - * _Thread_Start only fails if the thread was in the incorrect state - */ - - if ( !status ) { - _POSIX_Threads_Free( the_thread ); - _Thread_Enable_dispatch(); - return EINVAL; - } - - /* - * Return the id and indicate we successfully created the thread - */ - - *thread = the_thread->Object.id; - - _Thread_Enable_dispatch(); - - return 0; -} - diff --git a/c/src/exec/posix/src/pthreaddetach.c b/c/src/exec/posix/src/pthreaddetach.c deleted file mode 100644 index 91679c9807..0000000000 --- a/c/src/exec/posix/src/pthreaddetach.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int pthread_detach( - pthread_t thread -) -{ - register Thread_Control *the_thread; - POSIX_API_Control *api; - Objects_Locations location; - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - return ESRCH; - case OBJECTS_LOCAL: - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - api->detachstate = PTHREAD_CREATE_DETACHED; - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/pthreadequal.c b/c/src/exec/posix/src/pthreadequal.c deleted file mode 100644 index c405762291..0000000000 --- a/c/src/exec/posix/src/pthreadequal.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153 - * - * NOTE: POSIX does not define the behavior when either thread id is invalid. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int pthread_equal( - pthread_t t1, - pthread_t t2 -) -{ - /* - * If the system is configured for debug, then we will do everything we - * can to insure that both ids are valid. Otherwise, we will do the - * cheapest possible thing to determine if they are equal. - */ - -#ifndef RTEMS_DEBUG - return _Objects_Are_ids_equal( t1, t2 ); -#else - int status; - Objects_Locations location; - - /* - * By default this is not a match. - */ - - status = 0; - - /* - * Validate the first id and return 0 if it is not valid - */ - - (void) _POSIX_Threads_Get( t1, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - break; - - case OBJECTS_LOCAL: - - /* - * Validate the second id and return 0 if it is not valid - */ - - (void) _POSIX_Threads_Get( t2, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - break; - case OBJECTS_LOCAL: - status = _Objects_Are_ids_equal( t1, t2 ); - break; - } - _Thread_Unnest_dispatch(); - break; - } - - _Thread_Enable_dispatch(); - return status; -#endif -} - diff --git a/c/src/exec/posix/src/pthreadexit.c b/c/src/exec/posix/src/pthreadexit.c deleted file mode 100644 index 82217964b0..0000000000 --- a/c/src/exec/posix/src/pthreadexit.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150 - * - * NOTE: Key destructors are executed in the POSIX api delete extension. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -void pthread_exit( - void *value_ptr -) -{ - Objects_Information *the_information; - - the_information = _Objects_Get_information( _Thread_Executing->Object.id ); - - /* This should never happen if _Thread_Get() works right */ - assert( the_information ); - - _Thread_Disable_dispatch(); - - _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr; - - _Thread_Close( the_information, _Thread_Executing ); - - _POSIX_Threads_Free( _Thread_Executing ); - - _Thread_Enable_dispatch(); -} - diff --git a/c/src/exec/posix/src/pthreadgetcpuclockid.c b/c/src/exec/posix/src/pthreadgetcpuclockid.c deleted file mode 100644 index 9757b6b86d..0000000000 --- a/c/src/exec/posix/src/pthreadgetcpuclockid.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - -int pthread_getcpuclockid( - pthread_t pid, - clockid_t *clock_id -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - diff --git a/c/src/exec/posix/src/pthreadgetcputime.c b/c/src/exec/posix/src/pthreadgetcputime.c deleted file mode 100644 index 4018a6f655..0000000000 --- a/c/src/exec/posix/src/pthreadgetcputime.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_getcputime( - pthread_attr_t *attr, - int *clock_allowed -) -{ - if ( !attr || !attr->is_initialized || !clock_allowed ) - return EINVAL; - - *clock_allowed = attr->cputime_clock_allowed; - return 0; -} - diff --git a/c/src/exec/posix/src/pthreadgetschedparam.c b/c/src/exec/posix/src/pthreadgetschedparam.c deleted file mode 100644 index 6266891582..0000000000 --- a/c/src/exec/posix/src/pthreadgetschedparam.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 13.5.2 Dynamic Thread Scheduling Parameters Access, - * P1003.1c/Draft 10, p. 124 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int pthread_getschedparam( - pthread_t thread, - int *policy, - struct sched_param *param -) -{ - Objects_Locations location; - POSIX_API_Control *api; - register Thread_Control *the_thread; - - if ( !policy || !param ) - return EINVAL; - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - return ESRCH; - case OBJECTS_LOCAL: - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - if ( policy ) - *policy = api->schedpolicy; - if ( param ) { - *param = api->schedparam; - param->sched_priority = - _POSIX_Priority_From_core( the_thread->current_priority ); - } - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); - -} diff --git a/c/src/exec/posix/src/pthreadjoin.c b/c/src/exec/posix/src/pthreadjoin.c deleted file mode 100644 index 2769245e8c..0000000000 --- a/c/src/exec/posix/src/pthreadjoin.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int pthread_join( - pthread_t thread, - void **value_ptr -) -{ - register Thread_Control *the_thread; - POSIX_API_Control *api; - Objects_Locations location; - void *return_pointer; - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - return ESRCH; - case OBJECTS_LOCAL: - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - if ( api->detachstate == PTHREAD_CREATE_DETACHED ) { - _Thread_Enable_dispatch(); - return EINVAL; - } - - if ( _Thread_Is_executing( the_thread ) ) { - _Thread_Enable_dispatch(); - return EDEADLK; - } - - /* - * Put ourself on the threads join list - */ - - _Thread_Executing->Wait.return_argument = (unsigned32 *) &return_pointer; - - _Thread_queue_Enter_critical_section( &api->Join_List ); - - _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT ); - - _Thread_Enable_dispatch(); - - if ( value_ptr ) - *value_ptr = return_pointer; - return 0; - } - - return POSIX_BOTTOM_REACHED(); -} - diff --git a/c/src/exec/posix/src/pthreadkill.c b/c/src/exec/posix/src/pthreadkill.c deleted file mode 100644 index fbc282b970..0000000000 --- a/c/src/exec/posix/src/pthreadkill.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 3.3.10 Send a Signal to a Thread, P1003.1c/D10, p. 43 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include - -int pthread_kill( - pthread_t thread, - int sig -) -{ - POSIX_API_Control *api; - Thread_Control *the_thread; - Objects_Locations location; - - if ( sig && !is_valid_signo(sig) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - -/* commented out when posix timers added - if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) - rtems_set_errno_and_return_minus_one( ENOSYS ); -*/ - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - rtems_set_errno_and_return_minus_one( ESRCH ); - case OBJECTS_LOCAL: - /* - * If sig == 0 then just validate arguments - */ - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - if ( sig ) { - - if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { - _Thread_Enable_dispatch(); - return 0; - } - - /* XXX critical section */ - - api->signals_pending |= signo_to_mask( sig ); - - (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); - - the_thread->do_post_task_switch_extension = TRUE; - - if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) - _ISR_Signals_to_thread_executing = TRUE; - } - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/pthreadonce.c b/c/src/exec/posix/src/pthreadonce.c deleted file mode 100644 index 94cbb005da..0000000000 --- a/c/src/exec/posix/src/pthreadonce.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int pthread_once( - pthread_once_t *once_control, - void (*init_routine)(void) -) -{ - if ( !once_control || !init_routine ) - return EINVAL; - - if ( !once_control->init_executed ) { - rtems_mode saveMode; - rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); - if ( !once_control->init_executed ) { - once_control->is_initialized = TRUE; - once_control->init_executed = TRUE; - (*init_routine)(); - } - rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); - } - return 0; -} - diff --git a/c/src/exec/posix/src/pthreadself.c b/c/src/exec/posix/src/pthreadself.c deleted file mode 100644 index cfa23844a4..0000000000 --- a/c/src/exec/posix/src/pthreadself.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -pthread_t pthread_self( void ) -{ - return _Thread_Executing->Object.id; -} diff --git a/c/src/exec/posix/src/pthreadsetcputime.c b/c/src/exec/posix/src/pthreadsetcputime.c deleted file mode 100644 index cb3003e667..0000000000 --- a/c/src/exec/posix/src/pthreadsetcputime.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -int pthread_attr_setcputime( - pthread_attr_t *attr, - int clock_allowed -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - switch ( clock_allowed ) { - case CLOCK_ENABLED: - case CLOCK_DISABLED: - attr->cputime_clock_allowed = clock_allowed; - return 0; - - default: - return EINVAL; - } -} - diff --git a/c/src/exec/posix/src/pthreadsetschedparam.c b/c/src/exec/posix/src/pthreadsetschedparam.c deleted file mode 100644 index 44c5e2ec36..0000000000 --- a/c/src/exec/posix/src/pthreadsetschedparam.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 13.5.2 Dynamic Thread Scheduling Parameters Access, - * P1003.1c/Draft 10, p. 124 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int pthread_setschedparam( - pthread_t thread, - int policy, - struct sched_param *param -) -{ - register Thread_Control *the_thread; - POSIX_API_Control *api; - Thread_CPU_budget_algorithms budget_algorithm; - Thread_CPU_budget_algorithm_callout budget_callout; - Objects_Locations location; - - /* - * Check all the parameters - */ - - if ( !param ) - return EINVAL; - - if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) - return EINVAL; - - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; - budget_callout = NULL; - - switch ( policy ) { - case SCHED_OTHER: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; - break; - - case SCHED_FIFO: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; - break; - - case SCHED_RR: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; - break; - - case SCHED_SPORADIC: - budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; - budget_callout = _POSIX_Threads_Sporadic_budget_callout; - - if ( _POSIX_Timespec_to_interval( ¶m->ss_replenish_period ) < - _POSIX_Timespec_to_interval( ¶m->ss_initial_budget ) ) - return EINVAL; - - if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) - return EINVAL; - - break; - - default: - return EINVAL; - } - - /* - * Actually change the scheduling policy and parameters - */ - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - return ESRCH; - case OBJECTS_LOCAL: - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - if ( api->schedpolicy == SCHED_SPORADIC ) - (void) _Watchdog_Remove( &api->Sporadic_timer ); - - api->schedpolicy = policy; - api->schedparam = *param; - the_thread->budget_algorithm = budget_algorithm; - the_thread->budget_callout = budget_callout; - - switch ( api->schedpolicy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; - - the_thread->real_priority = - _POSIX_Priority_To_core( api->schedparam.sched_priority ); - - _Thread_Change_priority( - the_thread, - the_thread->real_priority, - TRUE - ); - break; - - case SCHED_SPORADIC: - api->ss_high_priority = api->schedparam.sched_priority; - _Watchdog_Remove( &api->Sporadic_timer ); - _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); - break; - } - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/pthreadsigmask.c b/c/src/exec/posix/src/pthreadsigmask.c deleted file mode 100644 index e24f301ab1..0000000000 --- a/c/src/exec/posix/src/pthreadsigmask.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 - * - * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -int pthread_sigmask( - int how, - const sigset_t *set, - sigset_t *oset -) -{ - POSIX_API_Control *api; - - if ( !set && !oset ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - if ( oset ) - *oset = api->signals_blocked; - - if ( !set ) - return 0; - - switch ( how ) { - case SIG_BLOCK: - api->signals_blocked |= *set; - break; - case SIG_UNBLOCK: - api->signals_blocked &= ~*set; - break; - case SIG_SETMASK: - api->signals_blocked = *set; - break; - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* XXX are there critical section problems here? */ - - /* XXX evaluate the new set */ - - if ( ~api->signals_blocked & - (api->signals_pending | _POSIX_signals_Pending) ) { - _Thread_Executing->do_post_task_switch_extension = TRUE; - _Thread_Dispatch(); - } - - return 0; -} diff --git a/c/src/exec/posix/src/ptimer.c b/c/src/exec/posix/src/ptimer.c deleted file mode 100644 index 40688916f0..0000000000 --- a/c/src/exec/posix/src/ptimer.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * ptimer.c,v 1.1 1996/06/03 16:29:58 joel Exp - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include - -/************************************/ -/* These includes are now necessary */ -/************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*****************************/ -/* End of necessary includes */ -/*****************************/ - -#include - -/* *************************************************************************** - * TIMER_INITIALIZE_S - * - * Description: Initialize the data of a timer - * ***************************************************************************/ - -void TIMER_INITIALIZE_S ( int timer_pos ) -{ - - /* - * Indicates that the position in the table is free - */ - - timer_struct[timer_pos].state = STATE_FREE_C; - - /* - * The initial data of timing are set with null value - */ - - timer_struct[timer_pos].timer_data.it_value.tv_sec = 0; - timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0; - timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0; - timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0; - - /* - * The count of expirations is 0 - */ - - timer_struct[timer_pos].overrun = 0; - -} - -/* *************************************************************************** - * _POSIX_Timer_Manager_initialization - * - * Description: Initialize the internal structure in which the data of all - * the timers are stored - * ***************************************************************************/ - -int timer_max; -POSIX_Timer_Control *timer_struct; - - -void _POSIX_Timer_Manager_initialization ( int max_timers ) -{ - int index; - - timer_struct = _Workspace_Allocate_or_fatal_error( - max_timers * sizeof(POSIX_Timer_Control) ); - - /* - * Initialize all the timers - */ - - timer_max = max_timers; - - for (index=0; index -#include -#include - -#include -#include -#include -#include - -#include - -/************************************/ -/* These includes are now necessary */ -/************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/*****************************/ -/* End of necessary includes */ -/*****************************/ - -/* ************ - * Constants - * ************/ - -/* -#define DEBUG_MESSAGES - */ - -/* - * Data for the signals - */ - -/*********************************** - * Definition of Internal Functions - ***********************************/ - -/* *************************************************************************** - * TIMER_INITIALIZE_S - * - * Description: Initialize the data of a timer - * ***************************************************************************/ - -extern void TIMER_INITIALIZE_S ( int timer_pos ); - -/* *************************************************************************** - * _POSIX_Timer_Manager_initialization - * - * Description: Initialize the internal structure in which the data of all - * the timers are stored - * ***************************************************************************/ - -/* split to reduce minimum size */ - -/* *************************************************************************** - * FIRST_FREE_POSITION_F - * - * Description: Returns the first free position in the table of timers. - * If there is not a free position, it returns NO_MORE_TIMERS_C - * ***************************************************************************/ - -int FIRST_FREE_POSITION_F () -{ - int index; - - for (index=0; indexit_value.tv_sec = source->it_value.tv_sec; - target->it_value.tv_nsec = source->it_value.tv_nsec; - target->it_interval.tv_sec = source->it_interval.tv_sec; - target->it_interval.tv_nsec = source->it_interval.tv_nsec; - -} - -/* *************************************************************************** - * ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S - * - * Description: This function converts the data of a structure itimerspec - * into structure rtems_time_of_day - * ***************************************************************************/ - -void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S - ( const struct itimerspec *itimer, rtems_time_of_day *rtems_time ) -{ - unsigned long int seconds; - - /* The leap years and the months with 28, 29 or 31 days have not been - * considerated. It will be made in the future */ - - seconds = itimer->it_value.tv_sec; - - rtems_time->year = seconds / SECONDS_PER_YEAR_C; - seconds = seconds % SECONDS_PER_YEAR_C; - - rtems_time->month = seconds / SECONDS_PER_MONTH_C; - seconds = seconds % SECONDS_PER_MONTH_C; - - rtems_time->day = seconds / SECONDS_PER_DAY_C; - seconds = seconds % SECONDS_PER_DAY_C; - - rtems_time->hour = seconds / SECONDS_PER_HOUR_C; - seconds = seconds % SECONDS_PER_HOUR_C; - - rtems_time->minute = seconds / SECONDS_PER_MINUTE_C; - seconds = seconds % SECONDS_PER_MINUTE_C; - - rtems_time->second = seconds; - - rtems_time->ticks = ( itimer->it_value.tv_nsec * SEC_TO_TICKS_C ) / - NSEC_PER_SEC_C; - -} - - -/* *************************************************************************** - * FIRE_TIMER_S - * - * Description: This is the operation that is ran when a timer expires - * ***************************************************************************/ - - -rtems_timer_service_routine FIRE_TIMER_S (rtems_id timer, void *data) -{ - int timer_pos; /* Position in the table of the timer that - * has expirated */ - rtems_status_code return_v; /* Return value of rtems_timer_fire_after */ - int sig_number; /* Number of the signal to send */ - - - /* The position of the table of timers that contains the data of the - * expired timer will be stored in "timer_pos". In theory a timer can not - * expire if it has not been created or has been deleted */ - - timer_pos = TIMER_POSITION_F(timer); - - /* Increases the number of expiration of the timer in one unit. */ - timer_struct[timer_pos].overrun = timer_struct[timer_pos].overrun + 1; - - - if ( ( timer_struct[timer_pos].timer_data.it_interval.tv_sec != 0 ) || - ( timer_struct[timer_pos].timer_data.it_interval.tv_nsec != 0 ) ) { - - /* The timer must be reprogrammed */ - - return_v = rtems_timer_fire_after ( timer, - timer_struct[timer_pos].ticks, - FIRE_TIMER_S, - NULL ); - - /* Stores the time when the timer was started again */ - - timer_struct[timer_pos].time = _TOD_Current; - - /* The state has not to be actualized, because nothing modifies it */ - - timer_struct[timer_pos].state = STATE_CREATE_RUN_C; - - } else { - /* Indicates that the timer is stopped */ - - timer_struct[timer_pos].state = STATE_CREATE_STOP_C; - - } - - /* - * The sending of the signal to the process running the handling function - * specified for that signal is simulated - */ - - sig_number = timer_struct[timer_pos].inf.sigev_signo; - - if( pthread_kill ( timer_struct[timer_pos].thread_id , - timer_struct[timer_pos].inf.sigev_signo ) ) { - /* XXX error handling */ - } - - /* - * After the signal handler returns, the count of expirations of the - * timer must be set to 0. - */ - - timer_struct[timer_pos].overrun = 0; - -} - -/* ********************************************************************* - * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 - * ********************************************************************/ - -/* ************** - * timer_create - * **************/ - -int timer_create( - clockid_t clock_id, - struct sigevent *evp, - timer_t *timerid -) -{ - - rtems_status_code return_v; /* return value of the operation */ - rtems_id timer_id; /* created timer identifier */ - int timer_pos; /* Position in the table of timers */ - - /* - * The data of the structure evp are checked in order to verify if they - * are coherent. - */ - - if (evp != NULL) { - /* The structure has data */ - if ( ( evp->sigev_notify != SIGEV_NONE ) && - ( evp->sigev_notify != SIGEV_SIGNAL ) ) { - /* The value of the field sigev_notify is not valid */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - } - - /* - * A timer is created using the primitive rtems_timer_create - */ - - return_v = rtems_timer_create ( clock_id, &timer_id ); - - switch (return_v) { - case RTEMS_SUCCESSFUL : - - /* - * The timer has been created properly - */ - - /* Obtains the first free position in the table of timers */ - - timer_pos = FIRST_FREE_POSITION_F(); - - if ( timer_pos == NO_MORE_TIMERS_C ) { - /* There is not position for another timers in spite of RTEMS - * supports it. It will necessaty to increase the structure used */ - - rtems_set_errno_and_return_minus_one( EAGAIN ); - } - - /* Exit parameter */ - - *timerid = timer_id; - - /* The data of the created timer are stored to use them later */ - - timer_struct[timer_pos].state = STATE_CREATE_NEW_C; - - /* NEW VERSION*/ - timer_struct[timer_pos].thread_id = pthread_self (); - - if ( evp != NULL ) { - timer_struct[timer_pos].inf.sigev_notify = evp->sigev_notify; - timer_struct[timer_pos].inf.sigev_signo = evp->sigev_signo; - timer_struct[timer_pos].inf.sigev_value = evp->sigev_value; - } - - timer_struct[timer_pos].timer_id = timer_id; - timer_struct[timer_pos].overrun = 0; - - timer_struct[timer_pos].timer_data.it_value.tv_sec = 0; - timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0; - timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0; - timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0; - - return 0; - - case RTEMS_INVALID_NAME : /* The assigned name is not valid */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - - case RTEMS_TOO_MANY : - - /* There has been created too much timers for the same process */ - rtems_set_errno_and_return_minus_one( EAGAIN ); - - default : - - /* - * Does nothing. It only returns the error without assigning a value - * to errno. In theory, it can not happen because the call to - * rtems_timer_create can not return other different value. - */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* - * The next sentence is used to avoid singular situations - */ - - rtems_set_errno_and_return_minus_one( EINVAL ); -} - -/* - * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 - */ - -int timer_delete( - timer_t timerid -) -{ - - /* - * IDEA: This function must probably stop the timer first and then delete it - * - * It will have to do a call to rtems_timer_cancel and then another - * call to rtems_timer_delete. - * The call to rtems_timer_delete will be probably unnecessary, - * because rtems_timer_delete stops the timer before deleting it. - */ - - int timer_pos; - rtems_status_code status; - - - /* First the position in the table of timers is obtained */ - - timer_pos = TIMER_POSITION_F ( timerid ); - - if ( timer_pos == BAD_TIMER_C ) { - /* The timer identifier is erroneus */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* The timer is deleted */ - - status = rtems_timer_delete ( timerid ); - - if ( status == RTEMS_INVALID_ID ) { - /* The timer identifier is erroneus */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* Initializes the data of the timer */ - - TIMER_INITIALIZE_S ( timer_pos ); - return 0; -} - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -/* ************** - * timer_settime - * **************/ - - -int timer_settime( - timer_t timerid, - int flags, - const struct itimerspec *value, - struct itimerspec *ovalue -) -{ - - rtems_status_code return_v; /* Return of the calls to RTEMS */ - int timer_pos; /* Position of the timer in the table */ - rtems_time_of_day rtems_time; /* Time in RTEMS */ - - - /* First the position in the table of timers is obtained */ - - timer_pos = TIMER_POSITION_F ( timerid ); - - if ( timer_pos == BAD_TIMER_C ) { - /* The timer identifier is erroneus */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - if ( value == NULL ) { - /* The stucture of times of the timer is free, and then returns an - error but the variable errno is not actualized */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* If the function reaches this point, then it will be necessary to do - * something with the structure of times of the timer: to stop, start - * or start it again */ - - /* First, it verifies if the timer must be stopped */ - - if ( value->it_value.tv_sec == 0 && value->it_value.tv_nsec == 0 ) { - /* The timer is stopped */ - - return_v = rtems_timer_cancel ( timerid ); - - /* The old data of the timer are returned */ - - if ( ovalue ) - *ovalue = timer_struct[timer_pos].timer_data; - - /* The new data are set */ - - timer_struct[timer_pos].timer_data = *value; - - /* Indicates that the timer is created and stopped */ - - timer_struct[timer_pos].state = STATE_CREATE_STOP_C; - - /* Returns with success */ - - return 0; - } - - /* - * If the function reaches this point, then the timer will have to be - * initialized with new values: to start it or start it again - */ - - /* First, it verifies if the structure "value" is correct */ - - if ( ( value->it_value.tv_nsec > MAX_NSEC_C ) || - ( value->it_value.tv_nsec < MIN_NSEC_C ) ) { - /* The number of nanoseconds is not correct */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* Then, "value" must be converted from seconds and nanoseconds to clock - * ticks, to use it in the calls to RTEMS */ - - /* It is also necessary to take in account if the time is absolute - * or relative */ - - switch (flags) { - case TIMER_ABSTIME: - - /* The fire time is absolute: - * It has to use "rtems_time_fire_when" */ - - /* First, it converts from struct itimerspec to rtems_time_of_day */ - - ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S ( value, &rtems_time ); - - return_v = rtems_timer_fire_when ( timerid, &rtems_time, FIRE_TIMER_S, NULL); - - switch ( return_v ) { - case RTEMS_SUCCESSFUL: - - /* The timer has been started and is running */ - - /* Actualizes the data of the structure and - * returns the old ones in "ovalue" */ - - if ( ovalue ) - *ovalue = timer_struct[timer_pos].timer_data; - - timer_struct[timer_pos].timer_data = *value; - - /* It indicates that the time is running */ - - timer_struct[timer_pos].state = STATE_CREATE_RUN_C; - - /* Stores the time in which the timer was started again */ - - timer_struct[timer_pos].time = _TOD_Current; - return 0; - - break; - - case RTEMS_INVALID_ID: - - /* XXX error handling */ - break; - - case RTEMS_NOT_DEFINED: - - /* XXX error handling */ - break; - - case RTEMS_INVALID_CLOCK: - - /* XXX error handling */ - break; - - default: break; - - - } - - break; - - case TIMER_RELATIVE_C: - - /* The fire time is relative: - * It has to use "rtems_time_fire_after" */ - - /* First, it converts from seconds and nanoseconds to ticks */ - - /* The form in which this operation is done can produce a lost - * of precision of 1 second */ - -/* This is the process to convert from nanoseconds to ticks - * - * There is a tick every 10 miliseconds, then the nanoseconds are - * divided between 10**7. The result of this operation will be the - * number of ticks - */ - - timer_struct[timer_pos].ticks = - ( SEC_TO_TICKS_C * value->it_value.tv_sec ) + - ( value->it_value.tv_nsec / ( 1000 * 1000 * 10 ) ); - - return_v = rtems_timer_fire_after ( timerid, - timer_struct[timer_pos].ticks, - FIRE_TIMER_S, - NULL ); - - switch (return_v) { - case RTEMS_SUCCESSFUL: - - /* The timer has been started and is running */ - - /* Actualizes the data of the structure and - * returns the old ones in "ovalue" */ - - if ( ovalue ) - *ovalue = timer_struct[timer_pos].timer_data; - - timer_struct[timer_pos].timer_data = *value; - - /* It indicates that the time is running */ - - timer_struct[timer_pos].state = STATE_CREATE_RUN_C; - - /* Stores the time in which the timer was started again */ - - timer_struct[timer_pos].time = _TOD_Current; - - return 0; - - break; - - case RTEMS_INVALID_ID: - - /* The timer identifier is not correct. In theory, this - * situation can not occur, but the solution is easy */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - - break; - - case RTEMS_INVALID_NUMBER: - - /* In this case, RTEMS fails because the values of timing - * are incorrect */ - - /* - * I do not know if errno must be actualized - * - * errno = EINVAL; - */ - - rtems_set_errno_and_return_minus_one( EINVAL ); - break; - - default: break; - } - - break; - - default: break; - - /* It does nothing, although it will be probably necessary to - * return an error */ - } - - /* To avoid problems */ - return 0; -} - - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -/* ************** - * timer_gettime - * **************/ - -int timer_gettime( - timer_t timerid, - struct itimerspec *value -) -{ - - /* - * IDEA: This function does not use functions of RTEMS to the handle - * of timers. It uses some functions for managing the time. - * - * A possible form to do this is the following: - * - * - When a timer is initialized, the value of the time in - * that moment is stored. - * - When this function is called, it returns the difference - * between the current time and the initialization time. - */ - - rtems_time_of_day current_time; - int timer_pos; - unsigned32 hours; - unsigned32 minutes; - unsigned32 seconds; - unsigned32 ticks; - unsigned32 nanosec; - - - /* Reads the current time */ - - current_time = _TOD_Current; - - timer_pos = TIMER_POSITION_F ( timerid ); - - if ( timer_pos == BAD_TIMER_C ) { - /* The timer identifier is erroneus */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* Calculates the difference between the start time of the timer and - * the current one */ - - hours = current_time.hour - timer_struct[timer_pos].time.hour; - - if ( current_time.minute < timer_struct[timer_pos].time.minute ) { - minutes = 60 - timer_struct[timer_pos].time.minute + current_time.minute; - hours--; - } else { - minutes = current_time.minute - timer_struct[timer_pos].time.minute; - } - - if ( current_time.second < timer_struct[timer_pos].time.second ) { - seconds = 60 - timer_struct[timer_pos].time.second + current_time.second; - minutes--; - } else { - seconds = current_time.second - timer_struct[timer_pos].time.second; - } - - if ( current_time.ticks < timer_struct[timer_pos].time.ticks ) { - ticks = 100 - timer_struct[timer_pos].time.ticks + current_time.ticks; - seconds--; - } else { - ticks = current_time.ticks - timer_struct[timer_pos].time.ticks; - } - - /* The time that the timer is running is calculated */ - seconds = hours * 60 * 60 + - minutes * 60 + - seconds; - - nanosec = ticks * 10 * /* msec */ - 1000 * /* microsec */ - 1000; /* nanosec */ - - - /* Calculates the time left before the timer finishes */ - - value->it_value.tv_sec = - timer_struct[timer_pos].timer_data.it_value.tv_sec - seconds; - - value->it_value.tv_nsec = - timer_struct[timer_pos].timer_data.it_value.tv_nsec - nanosec; - - - value->it_interval.tv_sec = - timer_struct[timer_pos].timer_data.it_interval.tv_sec; - value->it_interval.tv_nsec = - timer_struct[timer_pos].timer_data.it_interval.tv_nsec; - - - return 0; - -} - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -/* ***************** - * timer_getoverrun - * *****************/ - -int timer_getoverrun( - timer_t timerid -) -{ - - /* - * IDEA: This function must count the times the timer expires. - * - * The expiration of a timer must increase by one a counter. - * After the signal handler associated to the timer finishs - * its execution, FIRE_TIMER_S will have to set this counter to 0. - */ - - int timer_pos; /* Position of the timer in the structure */ - int overrun; /* Overflow count */ - - - timer_pos = TIMER_POSITION_F ( timerid ); - - if ( timer_pos == BAD_TIMER_C ) { - /* The timer identifier is erroneus */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* The overflow count of the timer is stored in "overrun" */ - - overrun = timer_struct[timer_pos].overrun; - - /* It is set to 0 */ - - timer_struct[timer_pos].overrun = 0; - - return overrun; - -} diff --git a/c/src/exec/posix/src/sched.c b/c/src/exec/posix/src/sched.c deleted file mode 100644 index a0eb62acdd..0000000000 --- a/c/src/exec/posix/src/sched.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 - * - */ - -int sched_setparam( - pid_t pid, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 - */ - -int sched_getparam( - pid_t pid, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.3 Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-1993, p. 254 - */ - -int sched_setscheduler( - pid_t pid, - int policy, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 - */ - -int sched_getscheduler( - pid_t pid -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_get_priority_max( - int policy -) -{ - switch ( policy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - case SCHED_SPORADIC: - break; - - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - return POSIX_SCHEDULER_MAXIMUM_PRIORITY; -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_get_priority_min( - int policy -) -{ - switch ( policy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - case SCHED_SPORADIC: - break; - - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - return POSIX_SCHEDULER_MINIMUM_PRIORITY; -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_rr_get_interval( - pid_t pid, - struct timespec *interval -) -{ - /* XXX do we need to support different time quantums per thread */ - - /* - * Only supported for the "calling process" (i.e. this node). - */ - - if ( pid && pid != getpid() ) - rtems_set_errno_and_return_minus_one( ESRCH ); - - if ( !interval ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - _POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval ); - return 0; -} - -/*PAGE - * - * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 - */ - -int sched_yield( void ) -{ - _Thread_Disable_dispatch(); - _Thread_Yield_processor(); - _Thread_Enable_dispatch(); - return 0; -} diff --git a/c/src/exec/posix/src/semaphore.c b/c/src/exec/posix/src/semaphore.c deleted file mode 100644 index 1fdca2d4ab..0000000000 --- a/c/src/exec/posix/src/semaphore.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Semaphore_Manager_initialization - * - * This routine initializes all semaphore manager related data structures. - * - * Input parameters: - * maximum_semaphores - maximum configured semaphores - * - * Output parameters: NONE - */ - -void _POSIX_Semaphore_Manager_initialization( - unsigned32 maximum_semaphores -) -{ - _Objects_Initialize_information( - &_POSIX_Semaphore_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_SEMAPHORES, /* object class */ - maximum_semaphores /* maximum objects of this class */, - sizeof( POSIX_Semaphore_Control ), - /* size of this object's control block */ - TRUE, /* TRUE if names for this object are strings */ - _POSIX_PATH_MAX /* maximum length of each object's name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/posix/src/semaphorecreatesupp.c b/c/src/exec/posix/src/semaphorecreatesupp.c deleted file mode 100644 index 86b1179660..0000000000 --- a/c/src/exec/posix/src/semaphorecreatesupp.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include /* strlen */ - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Semaphore_Create_support - * - * This routine does the actual creation and initialization of - * a poxix semaphore. It is a support routine for sem_init and - * sem_open. - */ - -int _POSIX_Semaphore_Create_support( - const char *name, - int pshared, - unsigned int value, - POSIX_Semaphore_Control **the_sem -) -{ - POSIX_Semaphore_Control *the_semaphore; - CORE_semaphore_Attributes *the_sem_attr; - - _Thread_Disable_dispatch(); - - /* Sharing semaphores among processes is not currently supported */ - if (pshared != 0) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENOSYS ); - } - - if ( name ) { - if( strlen(name) > PATH_MAX ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); - } - } - - the_semaphore = _POSIX_Semaphore_Allocate(); - - if ( !the_semaphore ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENOSPC ); - } - -#if defined(RTEMS_MULTIPROCESSING) - if ( pshared == PTHREAD_PROCESS_SHARED && - !( _Objects_MP_Allocate_and_open( &_POSIX_Semaphore_Information, 0, - the_semaphore->Object.id, FALSE ) ) ) { - _POSIX_Semaphore_Free( the_semaphore ); - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EAGAIN ); - } -#endif - - the_semaphore->process_shared = pshared; - - if ( name ) { - the_semaphore->named = TRUE; - the_semaphore->open_count = 1; - the_semaphore->linked = TRUE; - } - else - the_semaphore->named = FALSE; - - the_sem_attr = &the_semaphore->Semaphore.Attributes; - - /* - * POSIX does not appear to specify what the discipline for - * blocking tasks on this semaphore should be. It could somehow - * be derived from the current scheduling policy. One - * thing is certain, no matter what we decide, it won't be - * the same as all other POSIX implementations. :) - */ - - the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; - - /* - * This effectively disables limit checking. - */ - - the_sem_attr->maximum_count = 0xFFFFFFFF; - - _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); - - /* - * Make the semaphore available for use. - */ - - _Objects_Open( - &_POSIX_Semaphore_Information, - &the_semaphore->Object, - (char *) name - ); - - *the_sem = the_semaphore; - -#if defined(RTEMS_MULTIPROCESSING) - if ( pshared == PTHREAD_PROCESS_SHARED ) - _POSIX_Semaphore_MP_Send_process_packet( - POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE, - the_semaphore->Object.id, - (char *) name, - 0 /* proxy id - Not used */ - ); -#endif - - _Thread_Enable_dispatch(); - return 0; -} diff --git a/c/src/exec/posix/src/semaphoredeletesupp.c b/c/src/exec/posix/src/semaphoredeletesupp.c deleted file mode 100644 index a0d8e5ea12..0000000000 --- a/c/src/exec/posix/src/semaphoredeletesupp.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Semaphore_Delete - */ - -void _POSIX_Semaphore_Delete( - POSIX_Semaphore_Control *the_semaphore -) -{ - if ( !the_semaphore->linked && !the_semaphore->open_count ) { - _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); - - _CORE_semaphore_Flush( - &the_semaphore->Semaphore, -#if defined(RTEMS_MULTIPROCESSING) - _POSIX_Semaphore_MP_Send_object_was_deleted, -#else - NULL, -#endif - -1 /* XXX should also seterrno -> EINVAL */ - ); - - _POSIX_Semaphore_Free( the_semaphore ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { - - _Objects_MP_Close( - &_POSIX_Semaphore_Information, - the_semaphore->Object.id - ); - - _POSIX_Semaphore_MP_Send_process_packet( - POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE, - the_semaphore->Object.id, - 0, /* Not used */ - 0 /* Not used */ - ); - } -#endif - - } -} diff --git a/c/src/exec/posix/src/semaphoremp.c b/c/src/exec/posix/src/semaphoremp.c deleted file mode 100644 index d5a4cf9f1e..0000000000 --- a/c/src/exec/posix/src/semaphoremp.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#if defined(RTEMS_MULTIPROCESSING) -/* - * _POSIX_Semaphore_MP_Send_process_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * process operation can be performed on another node. - */ - -void _POSIX_Semaphore_MP_Send_process_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - Objects_Name name, - Objects_Id proxy_id -) -{ - POSIX_MP_NOT_IMPLEMENTED(); -} - -/* - * _POSIX_Semaphore_MP_Send_request_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive operation can be initiated on another node. - */ - -int _POSIX_Semaphore_MP_Send_request_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - boolean wait, /* XXX options */ - Watchdog_Interval timeout -) -{ - POSIX_MP_NOT_IMPLEMENTED(); - return 0; -} - -/* - * _POSIX_Semaphore_MP_Send_response_packet - * - * DESCRIPTION: - * - * This routine performs a remote procedure call so that a - * directive can be performed on another node. - */ - -void _POSIX_Semaphore_MP_Send_response_packet( - POSIX_Semaphore_MP_Remote_operations operation, - Objects_Id semaphore_id, - Thread_Control *the_thread -) -{ - POSIX_MP_NOT_IMPLEMENTED(); -} - -/* - * - * _POSIX_Semaphore_MP_Process_packet - * - * DESCRIPTION: - * - * This routine performs the actions specific to this package for - * the request from another node. - */ - -void _POSIX_Semaphore_MP_Process_packet( - MP_packet_Prefix *the_packet_prefix -) -{ - POSIX_MP_NOT_IMPLEMENTED(); -} - -/* - * _POSIX_Semaphore_MP_Send_object_was_deleted - * - * DESCRIPTION: - * - * This routine is invoked indirectly by the thread queue - * when a proxy has been removed from the thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Semaphore_MP_Send_object_was_deleted( - Thread_Control *the_proxy -) -{ - POSIX_MP_NOT_IMPLEMENTED(); -} - -/* - * _POSIX_Semaphore_MP_Send_extract_proxy - * - * DESCRIPTION: - * - * This routine is invoked when a task is deleted and it - * has a proxy which must be removed from a thread queue and - * the remote node must be informed of this. - */ - -void _POSIX_Semaphore_MP_Send_extract_proxy( - Thread_Control *the_thread -) -{ - POSIX_MP_NOT_IMPLEMENTED(); -} - -/* - * _POSIX_Semaphore_MP_Get_packet - * - * DESCRIPTION: - * - * This function is used to obtain a semaphore mp packet. - */ - -POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet( void ) -{ - POSIX_MP_NOT_IMPLEMENTED(); - return NULL; -} - -#endif /* endif RTEMS_MULTIPROCESSING */ diff --git a/c/src/exec/posix/src/semaphorenametoid.c b/c/src/exec/posix/src/semaphorenametoid.c deleted file mode 100644 index e5d15cd7ed..0000000000 --- a/c/src/exec/posix/src/semaphorenametoid.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Semaphore_Name_to_id - * - * Look up the specified name and attempt to locate the id - * for the associated semaphore. - */ - -int _POSIX_Semaphore_Name_to_id( - const char *name, - sem_t *id -) -{ - Objects_Name_to_id_errors status; - - if ( !name ) - return EINVAL; - - if ( !name[0] ) - return EINVAL; - - status = _Objects_Name_to_id( - &_POSIX_Semaphore_Information, (char *)name, 0, (Objects_Id*)id ); - - if ( status == OBJECTS_SUCCESSFUL ) - return 0; - - return ENOENT; -} - diff --git a/c/src/exec/posix/src/semaphorewaitsupp.c b/c/src/exec/posix/src/semaphorewaitsupp.c deleted file mode 100644 index d3fd9787ce..0000000000 --- a/c/src/exec/posix/src/semaphorewaitsupp.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * _POSIX_Semaphore_Wait_support - */ - -int _POSIX_Semaphore_Wait_support( - sem_t *sem, - boolean blocking, - Watchdog_Interval timeout -) -{ - register POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - the_semaphore = _POSIX_Semaphore_Get( sem, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - _CORE_semaphore_Seize( - &the_semaphore->Semaphore, - the_semaphore->Object.id, - blocking, - timeout - ); - _Thread_Enable_dispatch(); - switch ( _Thread_Executing->Wait.return_code ) { - case CORE_SEMAPHORE_STATUS_SUCCESSFUL: - break; - case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT: - rtems_set_errno_and_return_minus_one( EAGAIN ); - case CORE_SEMAPHORE_WAS_DELETED: - rtems_set_errno_and_return_minus_one( EAGAIN ); - case CORE_SEMAPHORE_TIMEOUT: - rtems_set_errno_and_return_minus_one( ETIMEDOUT ); - break; - case CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED: - /* - * This error can not occur since we set the maximum - * count to the largest value the count can hold. - */ - break; - } - } - return 0; -} diff --git a/c/src/exec/posix/src/semclose.c b/c/src/exec/posix/src/semclose.c deleted file mode 100644 index a0e786ba27..0000000000 --- a/c/src/exec/posix/src/semclose.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -/*PAGE - * - * sem_close - * - * Routine to close a semaphore that has been opened or initialized. - * - * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 - */ - -int sem_close( - sem_t *sem -) -{ - register POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - the_semaphore = _POSIX_Semaphore_Get( sem, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - the_semaphore->open_count -= 1; - _POSIX_Semaphore_Delete( the_semaphore ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/semdestroy.c b/c/src/exec/posix/src/semdestroy.c deleted file mode 100644 index 01ea1606e0..0000000000 --- a/c/src/exec/posix/src/semdestroy.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 - */ - -int sem_destroy( - sem_t *sem -) -{ - register POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - the_semaphore = _POSIX_Semaphore_Get( sem, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - /* - * Undefined operation on a named semaphore. - */ - - if ( the_semaphore->named == TRUE ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - _POSIX_Semaphore_Delete( the_semaphore ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/semgetvalue.c b/c/src/exec/posix/src/semgetvalue.c deleted file mode 100644 index 71a99df73e..0000000000 --- a/c/src/exec/posix/src/semgetvalue.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 - */ - -int sem_getvalue( - sem_t *sem, - int *sval -) -{ - register POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - the_semaphore = _POSIX_Semaphore_Get( sem, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/seminit.c b/c/src/exec/posix/src/seminit.c deleted file mode 100644 index 0635ebea0f..0000000000 --- a/c/src/exec/posix/src/seminit.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219 - */ - -int sem_init( - sem_t *sem, - int pshared, - unsigned int value -) -{ - int status; - POSIX_Semaphore_Control *the_semaphore; - - if ( !sem ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - status = _POSIX_Semaphore_Create_support( - NULL, - pshared, - value, - &the_semaphore - ); - - if ( status != -1 ) - *sem = the_semaphore->Object.id; - - return status; -} diff --git a/c/src/exec/posix/src/semopen.c b/c/src/exec/posix/src/semopen.c deleted file mode 100644 index d956f9a86b..0000000000 --- a/c/src/exec/posix/src/semopen.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * sem_open - * - * Opens a named semaphore. Used in conjunction with the sem_close - * and sem_unlink commands. - * - * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221 - * - * NOTE: When oflag is O_CREAT, then optional third and fourth - * parameters must be present. - */ - -sem_t *sem_open( - const char *name, - int oflag, - ... - /* mode_t mode, */ - /* unsigned int value */ -) -{ - va_list arg; - mode_t mode; - unsigned int value = 0; - int status; - sem_t the_semaphore_id; - POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - _Thread_Disable_dispatch(); - - if ( oflag & O_CREAT ) { - va_start(arg, oflag); - mode = (mode_t) va_arg( arg, unsigned int ); - value = va_arg( arg, unsigned int ); - va_end(arg); - } - - status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); - - /* - * If the name to id translation worked, then the semaphore exists - * and we can just return a pointer to the id. Otherwise we may - * need to check to see if this is a "semaphore does not exist" - * or some other miscellaneous error on the name. - */ - - if ( status ) { - - /* - * Unless provided a valid name that did not already exist - * and we are willing to create then it is an error. - */ - - if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); - } - } else { - - /* - * Check for existence with creation. - */ - - if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); - } - - the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); - the_semaphore->open_count += 1; - _Thread_Enable_dispatch(); - _Thread_Enable_dispatch(); - return (sem_t *)&the_semaphore->Object.id; - - } - - /* - * At this point, the semaphore does not exist and everything has been - * checked. We should go ahead and create a semaphore. - */ - - status =_POSIX_Semaphore_Create_support( - name, - FALSE, /* not shared across processes */ - value, - &the_semaphore - ); - - /* - * errno was set by Create_support, so don't set it again. - */ - - _Thread_Enable_dispatch(); - - if ( status == -1 ) - return SEM_FAILED; - - return (sem_t *) &the_semaphore->Object.id; -} - - diff --git a/c/src/exec/posix/src/sempost.c b/c/src/exec/posix/src/sempost.c deleted file mode 100644 index 187e511253..0000000000 --- a/c/src/exec/posix/src/sempost.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 - */ - -int sem_post( - sem_t *sem -) -{ - register POSIX_Semaphore_Control *the_semaphore; - Objects_Locations location; - - the_semaphore = _POSIX_Semaphore_Get( sem, &location ); - switch ( location ) { - case OBJECTS_ERROR: - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - rtems_set_errno_and_return_minus_one( EINVAL ); - case OBJECTS_LOCAL: - _CORE_semaphore_Surrender( - &the_semaphore->Semaphore, - the_semaphore->Object.id, -#if defined(RTEMS_MULTIPROCESSING) - NULL /* XXX need to define a routine to handle this case */ -#else - NULL -#endif - ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/c/src/exec/posix/src/semtimedwait.c b/c/src/exec/posix/src/semtimedwait.c deleted file mode 100644 index f5904c59fd..0000000000 --- a/c/src/exec/posix/src/semtimedwait.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - -int sem_timedwait( - sem_t *sem, - const struct timespec *timeout -) -{ - return _POSIX_Semaphore_Wait_support( - sem, - TRUE, - _POSIX_Timespec_to_interval( timeout ) - ); -} diff --git a/c/src/exec/posix/src/semtrywait.c b/c/src/exec/posix/src/semtrywait.c deleted file mode 100644 index 2aecde9425..0000000000 --- a/c/src/exec/posix/src/semtrywait.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - -int sem_trywait( - sem_t *sem -) -{ - return _POSIX_Semaphore_Wait_support( sem, FALSE, THREAD_QUEUE_WAIT_FOREVER ); -} diff --git a/c/src/exec/posix/src/semunlink.c b/c/src/exec/posix/src/semunlink.c deleted file mode 100644 index 29912d4281..0000000000 --- a/c/src/exec/posix/src/semunlink.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * sem_unlink - * - * Unlinks a named semaphore, sem_close must also be called to remove - * the semaphore. - * - * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 - */ - -int sem_unlink( - const char *name -) -{ - int status; - register POSIX_Semaphore_Control *the_semaphore; - sem_t the_semaphore_id; - - _Thread_Disable_dispatch(); - - status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); - if ( status != 0 ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( status ); - } - - /* - * Don't support unlinking a remote semaphore. - */ - - if ( !_Objects_Is_local_id(the_semaphore_id) ) { - _Thread_Enable_dispatch(); - rtems_set_errno_and_return_minus_one( ENOSYS ); - } - - the_semaphore = (POSIX_Semaphore_Control *) _Objects_Get_local_object( - &_POSIX_Semaphore_Information, - _Objects_Get_index( the_semaphore_id ) - ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { - _Objects_MP_Close( &_POSIX_Semaphore_Information, the_semaphore_id ); - } -#endif - - the_semaphore->linked = FALSE; - _POSIX_Semaphore_Namespace_remove( the_semaphore ); - _POSIX_Semaphore_Delete( the_semaphore ); - - _Thread_Enable_dispatch(); - return 0; -} diff --git a/c/src/exec/posix/src/semwait.c b/c/src/exec/posix/src/semwait.c deleted file mode 100644 index 9ef787c727..0000000000 --- a/c/src/exec/posix/src/semwait.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/*PAGE - * - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - -int sem_wait( - sem_t *sem -) -{ - return _POSIX_Semaphore_Wait_support( sem, TRUE, THREAD_QUEUE_WAIT_FOREVER ); -} diff --git a/c/src/exec/posix/src/setcancelstate.c b/c/src/exec/posix/src/setcancelstate.c deleted file mode 100644 index 4a2fb1f93f..0000000000 --- a/c/src/exec/posix/src/setcancelstate.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -int pthread_setcancelstate( - int state, - int *oldstate -) -{ - POSIX_API_Control *thread_support; - - /* - * Don't even think about deleting a resource from an ISR. - * Besides this request is supposed to be for _Thread_Executing - * and the ISR context is not a thread. - */ - - if ( _ISR_Is_in_progress() ) - return EPROTO; - - if ( !oldstate ) - return EINVAL; - - if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) - return EINVAL; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - _Thread_Disable_dispatch(); - *oldstate = thread_support->cancelability_state; - thread_support->cancelability_state = state; - - if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && - thread_support->cancelation_requested ) - _POSIX_Threads_cancel_run( _Thread_Executing ); - _Thread_Enable_dispatch(); - - return 0; -} diff --git a/c/src/exec/posix/src/setcanceltype.c b/c/src/exec/posix/src/setcanceltype.c deleted file mode 100644 index aff7d84dda..0000000000 --- a/c/src/exec/posix/src/setcanceltype.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -int pthread_setcanceltype( - int type, - int *oldtype -) -{ - POSIX_API_Control *thread_support; - - /* - * Don't even think about deleting a resource from an ISR. - * Besides this request is supposed to be for _Thread_Executing - * and the ISR context is not a thread. - */ - - if ( _ISR_Is_in_progress() ) - return EPROTO; - - if ( !oldtype ) - return EINVAL; - - if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) - return EINVAL; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - _Thread_Disable_dispatch(); - *oldtype = thread_support->cancelability_type; - thread_support->cancelability_type = type; - - if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && - thread_support->cancelation_requested ) - _POSIX_Threads_cancel_run( _Thread_Executing ); - _Thread_Enable_dispatch(); - - return 0; -} diff --git a/c/src/exec/posix/src/setpgid.c b/c/src/exec/posix/src/setpgid.c deleted file mode 100644 index 26786cc552..0000000000 --- a/c/src/exec/posix/src/setpgid.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/*PAGE - * - * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89 - */ - -int setpgid( - pid_t pid, - pid_t pgid -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} diff --git a/c/src/exec/posix/src/setsid.c b/c/src/exec/posix/src/setsid.c deleted file mode 100644 index 81a60a798d..0000000000 --- a/c/src/exec/posix/src/setsid.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/*PAGE - * - * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88 - */ - -pid_t setsid( void ) -{ - rtems_set_errno_and_return_minus_one( EPERM ); -} - - diff --git a/c/src/exec/posix/src/sigaction.c b/c/src/exec/posix/src/sigaction.c deleted file mode 100644 index 708d1ac0b4..0000000000 --- a/c/src/exec/posix/src/sigaction.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * PARAMETERS_PASSING_S is defined in ptimer.c - */ - -extern void PARAMETERS_PASSING_S (int num_signal, const struct sigaction inf); - -int sigaction( - int sig, - const struct sigaction *act, - struct sigaction *oact -) -{ - ISR_Level level; - - if ( oact ) - *oact = _POSIX_signals_Vectors[ sig ]; - - if ( !sig ) - return 0; - - if ( !is_valid_signo(sig) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - /* - * Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references. - * - * NOTE: Solaris documentation claims to "silently enforce" this which - * contradicts the POSIX specification. - */ - - if ( sig == SIGKILL ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - /* - * Evaluate the new action structure and set the global signal vector - * appropriately. - */ - - if ( act ) { - - /* - * Unless the user is installing the default signal actions, then - * we can just copy the provided sigaction structure into the vectors. - */ - - _ISR_Disable( level ); - if ( act->sa_handler == SIG_DFL ) { - _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; - } else { - _POSIX_signals_Clear_process_signals( signo_to_mask(sig) ); - _POSIX_signals_Vectors[ sig ] = *act; - } - _ISR_Enable( level ); - } - - /* - * No need to evaluate or dispatch because: - * - * + If we were ignoring the signal before, none could be pending - * now (signals not posted when SIG_IGN). - * + If we are now ignoring a signal that was previously pending, - * we clear the pending signal indicator. - */ - - return 0; -} - diff --git a/c/src/exec/posix/src/sigaddset.c b/c/src/exec/posix/src/sigaddset.c deleted file mode 100644 index 864e314940..0000000000 --- a/c/src/exec/posix/src/sigaddset.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int sigaddset( - sigset_t *set, - int signo -) -{ - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - *set |= signo_to_mask(signo); - return 0; -} diff --git a/c/src/exec/posix/src/sigdelset.c b/c/src/exec/posix/src/sigdelset.c deleted file mode 100644 index bf914935ec..0000000000 --- a/c/src/exec/posix/src/sigdelset.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigdelset( - sigset_t *set, - int signo -) -{ - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - *set &= ~signo_to_mask(signo); - return 0; -} - diff --git a/c/src/exec/posix/src/sigemptyset.c b/c/src/exec/posix/src/sigemptyset.c deleted file mode 100644 index 5f606a6409..0000000000 --- a/c/src/exec/posix/src/sigemptyset.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int sigemptyset( - sigset_t *set -) -{ - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - *set = 0; - return 0; -} - diff --git a/c/src/exec/posix/src/sigfillset.c b/c/src/exec/posix/src/sigfillset.c deleted file mode 100644 index 89a98d2066..0000000000 --- a/c/src/exec/posix/src/sigfillset.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int sigfillset( - sigset_t *set -) -{ - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - *set = SIGNAL_ALL_MASK; - return 0; -} - diff --git a/c/src/exec/posix/src/sigismember.c b/c/src/exec/posix/src/sigismember.c deleted file mode 100644 index 64ace130a7..0000000000 --- a/c/src/exec/posix/src/sigismember.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int sigismember( - const sigset_t *set, - int signo -) -{ - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( *set & signo_to_mask(signo) ) - return 1; - - return 0; -} - diff --git a/c/src/exec/posix/src/signal_2.c b/c/src/exec/posix/src/signal_2.c deleted file mode 100644 index 2141269b10..0000000000 --- a/c/src/exec/posix/src/signal_2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * signal(2) - Install signal handler - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -typedef void (*sighandler_t)(int); - -sighandler_t signal( - int signum, - sighandler_t handler -) -{ - struct sigaction s; - struct sigaction old; - - s.sa_handler = handler ; - sigemptyset(&s.sa_mask); - - /* - * Depending on which system we want to behave like, one of - * the following versions should be chosen. - */ - -/* #define signal_like_linux */ - -#if defined(signal_like_linux) - s.sa_flags = SA_RESTART | SA_INTERRUPT | SA_NOMASK; - s.sa_restorer= NULL ; -#elif defined(signal_like_SVR4) - s.sa_flags = SA_RESTART; -#else - s.sa_flags = 0; -#endif - - sigaction( signum, &s, &old ); - return (sighandler_t) old.sa_handler; -} diff --git a/c/src/exec/posix/src/sigpending.c b/c/src/exec/posix/src/sigpending.c deleted file mode 100644 index 3ca22341a3..0000000000 --- a/c/src/exec/posix/src/sigpending.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 3.3.6 Examine Pending Signals, P1003.1b-1993, p. 75 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -int sigpending( - sigset_t *set -) -{ - POSIX_API_Control *api; - - if ( !set ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - *set = api->signals_pending | _POSIX_signals_Pending; - - return 0; -} diff --git a/c/src/exec/posix/src/sigprocmask.c b/c/src/exec/posix/src/sigprocmask.c deleted file mode 100644 index 2b04f52e99..0000000000 --- a/c/src/exec/posix/src/sigprocmask.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 - * - * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -int sigprocmask( - int how, - const sigset_t *set, - sigset_t *oset -) -{ - /* - * P1003.1c/Draft 10, p. 38 maps sigprocmask to pthread_sigmask. - */ - - return pthread_sigmask( how, set, oset ); -} diff --git a/c/src/exec/posix/src/sigqueue.c b/c/src/exec/posix/src/sigqueue.c deleted file mode 100644 index 66a8ee941f..0000000000 --- a/c/src/exec/posix/src/sigqueue.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int sigqueue( - pid_t pid, - int signo, - const union sigval value -) -{ - return killinfo( pid, signo, &value ); -} - diff --git a/c/src/exec/posix/src/sigsuspend.c b/c/src/exec/posix/src/sigsuspend.c deleted file mode 100644 index 0aa5699766..0000000000 --- a/c/src/exec/posix/src/sigsuspend.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int sigsuspend( - const sigset_t *sigmask -) -{ - sigset_t saved_signals_blocked; - sigset_t all_signals; - int status; - POSIX_API_Control *api; - - api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); - - (void) sigfillset( &all_signals ); - - status = sigtimedwait( &all_signals, NULL, NULL ); - - (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); - - return status; -} diff --git a/c/src/exec/posix/src/sigtimedwait.c b/c/src/exec/posix/src/sigtimedwait.c deleted file mode 100644 index 917b6a14ff..0000000000 --- a/c/src/exec/posix/src/sigtimedwait.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int _POSIX_signals_Get_highest( - sigset_t set -) -{ - int signo; - - for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { - if ( set & signo_to_mask( signo ) ) - return signo; - } - -/* XXX - add __SIGFIRSTNOTRT or something like that to newlib signal .h */ - - for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { - if ( set & signo_to_mask( signo ) ) - return signo; - } - - return 0; -} - -int sigtimedwait( - const sigset_t *set, - siginfo_t *info, - const struct timespec *timeout -) -{ - Thread_Control *the_thread; - POSIX_API_Control *api; - Watchdog_Interval interval; - siginfo_t signal_information; - siginfo_t *the_info; - int signo; - ISR_Level level; - - /* - * Error check parameters before disabling interrupts. - */ - - interval = 0; - if ( timeout ) { - - if ( timeout->tv_nsec < 0 || - timeout->tv_nsec >= TOD_NANOSECONDS_PER_SECOND) { - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - interval = _POSIX_Timespec_to_interval( timeout ); - } - - /* - * Initialize local variables. - */ - - the_info = ( info ) ? info : &signal_information; - - the_thread = _Thread_Executing; - - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - /* - * What if they are already pending? - */ - - /* API signals pending? */ - - _ISR_Disable( level ); - if ( *set & api->signals_pending ) { - /* XXX real info later */ - the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); - _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, FALSE, FALSE ); - _ISR_Enable( level ); - - the_info->si_code = SI_USER; - the_info->si_value.sival_int = 0; - return the_info->si_signo; - } - - /* Process pending signals? */ - - if ( *set & _POSIX_signals_Pending ) { - signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); - _POSIX_signals_Clear_signals( api, signo, the_info, TRUE, FALSE ); - _ISR_Enable( level ); - - the_info->si_signo = signo; - the_info->si_code = SI_USER; - the_info->si_value.sival_int = 0; - return signo; - } - - the_info->si_signo = -1; - - _Thread_Disable_dispatch(); - the_thread->Wait.queue = &_POSIX_signals_Wait_queue; - the_thread->Wait.return_code = EINTR; - the_thread->Wait.option = *set; - the_thread->Wait.return_argument = (void *) the_info; - _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); - _ISR_Enable( level ); - _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); - _Thread_Enable_dispatch(); - - /* - * When the thread is set free by a signal, it is need to eliminate - * the signal. - */ - - _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, FALSE, FALSE ); - errno = _Thread_Executing->Wait.return_code; - return the_info->si_signo; -} diff --git a/c/src/exec/posix/src/sigwait.c b/c/src/exec/posix/src/sigwait.c deleted file mode 100644 index 78183e8908..0000000000 --- a/c/src/exec/posix/src/sigwait.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include - -int sigwait( - const sigset_t *set, - int *sig -) -{ - int status; - - status = sigtimedwait( set, NULL, NULL ); - - if ( status != -1 ) { - if ( sig ) - *sig = status; - return 0; - } - - return errno; -} - diff --git a/c/src/exec/posix/src/sigwaitinfo.c b/c/src/exec/posix/src/sigwaitinfo.c deleted file mode 100644 index 13d3f3f034..0000000000 --- a/c/src/exec/posix/src/sigwaitinfo.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include - -int sigwaitinfo( - const sigset_t *set, - siginfo_t *info -) -{ - return sigtimedwait( set, info, NULL ); -} - diff --git a/c/src/exec/posix/src/sleep.c b/c/src/exec/posix/src/sleep.c deleted file mode 100644 index 501fe5770f..0000000000 --- a/c/src/exec/posix/src/sleep.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - - -unsigned int sleep( - unsigned int seconds -) -{ - /* XXX can we get away with this implementation? */ - struct timespec tp; - struct timespec tm; - - tp.tv_sec = seconds; - tp.tv_nsec = 0; - - nanosleep( &tp, &tm ); - - return tm.tv_sec; /* seconds remaining */ -} diff --git a/c/src/exec/posix/src/sysconf.c b/c/src/exec/posix/src/sysconf.c deleted file mode 100644 index 905f53696c..0000000000 --- a/c/src/exec/posix/src/sysconf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -/*PAGE - * - * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95 - */ - -long sysconf( - int name -) -{ - - switch (name) { - case _SC_CLK_TCK: - return _TOD_Ticks_per_second; - - case _SC_OPEN_MAX: { - extern unsigned32 rtems_libio_number_iops; - return rtems_libio_number_iops; - } - -#if defined(__sparc__) - case 515: /* Solaris _SC_STACK_PROT */ - return 0; -#endif - - default: - break; - } - - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/c/src/exec/posix/src/testcancel.c b/c/src/exec/posix/src/testcancel.c deleted file mode 100644 index 08a423747f..0000000000 --- a/c/src/exec/posix/src/testcancel.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -void pthread_testcancel( void ) -{ - POSIX_API_Control *thread_support; - - /* - * Don't even think about deleting a resource from an ISR. - * Besides this request is supposed to be for _Thread_Executing - * and the ISR context is not a thread. - */ - - if ( _ISR_Is_in_progress() ) - return; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - _Thread_Disable_dispatch(); - if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelation_requested ) - _POSIX_Threads_cancel_run( _Thread_Executing ); - _Thread_Enable_dispatch(); -} diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c deleted file mode 100644 index 081f5c6d59..0000000000 --- a/c/src/exec/posix/src/time.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/*PAGE - * - * 4.5.1 Get System Time, P1003.1b-1993, p. 91 - */ - -/* Using the implementation in newlib */ -#if 0 -time_t time( - time_t *tloc -) -{ - time_t seconds_since_epoch; - - /* - * No error is the time of day is not set. For RTEMS the system time - * starts out at the rtems epoch. - */ - - /* - * Internally the RTEMS epoch is 1988. This must be taken into account. - */ - - seconds_since_epoch = _TOD_Seconds_since_epoch; - - seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988; - - if ( tloc ) - *tloc = seconds_since_epoch; - - return seconds_since_epoch; -} -#endif diff --git a/c/src/exec/posix/src/types.c b/c/src/exec/posix/src/types.c deleted file mode 100644 index 56f60bda14..0000000000 --- a/c/src/exec/posix/src/types.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is the shell of what it initially was and is now misnamed. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - -/* - * TEMPORARY - */ - -#include - -int POSIX_MP_NOT_IMPLEMENTED() -{ - assert( 0 ); - return 0; -} - -int POSIX_BOTTOM_REACHED() -{ - assert( 0 ); - return 0; -} - -int POSIX_NOT_IMPLEMENTED() -{ - assert( 0 ); - return 0; -} - -/* - * END OF TEMPORARY - */ - diff --git a/c/src/exec/posix/src/wait.c b/c/src/exec/posix/src/wait.c deleted file mode 100644 index 09dfd3ded7..0000000000 --- a/c/src/exec/posix/src/wait.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * waitpid() - POSIX 1003.1b 3.2.1 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -int wait( - int *stat_loc -) -{ - errno = ENOSYS; - return -1; -} diff --git a/c/src/exec/posix/src/waitpid.c b/c/src/exec/posix/src/waitpid.c deleted file mode 100644 index aece9bbb81..0000000000 --- a/c/src/exec/posix/src/waitpid.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * waitpid() - POSIX 1003.1 3.2.1 - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -int waitpid( - pid_t pid, - int *stat_loc, - int options -) -{ - errno = ENOSYS; - return -1; -} -- cgit v1.2.3