diff options
author | cvs2git <rtems-devel@rtems.org> | 1996-09-30 20:15:02 +0000 |
---|---|---|
committer | cvs2git <rtems-devel@rtems.org> | 1996-09-30 20:15:02 +0000 |
commit | 43e1177def5a04b962b591496b2990e1c57ce63e (patch) | |
tree | fc1be17df72a87979f270adb59423ca71992b18b /cpukit/posix/src | |
parent | fixed incorrect placement of CPU_STRUCTURE_ALIGNMENT macro. (diff) | |
download | rtems-3.6.0.tar.bz2 |
This commit was manufactured by cvs2svn to create tag 'rtems-3-6-0'.3.6.0
Sprout from master 1996-09-30 20:15:01 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'fixed incorrect placement of CPU_STRUCTURE_ALIGNMENT macro.'
Delete:
c/build-tools/README
c/build-tools/cklength.c
c/build-tools/eolstrip.c
c/build-tools/packhex.c
c/build-tools/unhex.c
c/src/exec/libcsupport/include/clockdrv.h
c/src/exec/libcsupport/include/console.h
c/src/exec/libcsupport/include/iosupp.h
c/src/exec/libcsupport/include/ringbuf.h
c/src/exec/libcsupport/include/rtems/assoc.h
c/src/exec/libcsupport/include/rtems/error.h
c/src/exec/libcsupport/include/rtems/libcsupport.h
c/src/exec/libcsupport/include/rtems/libio.h
c/src/exec/libcsupport/include/spurious.h
c/src/exec/libcsupport/include/sys/utsname.h
c/src/exec/libcsupport/include/timerdrv.h
c/src/exec/libcsupport/include/vmeintr.h
c/src/exec/libcsupport/src/README
c/src/exec/libcsupport/src/__brk.c
c/src/exec/libcsupport/src/__gettod.c
c/src/exec/libcsupport/src/__times.c
c/src/exec/libcsupport/src/assoc.c
c/src/exec/libcsupport/src/error.c
c/src/exec/libcsupport/src/hosterr.c
c/src/exec/libcsupport/src/libio.c
c/src/exec/libcsupport/src/malloc.c
c/src/exec/libcsupport/src/newlibc.c
c/src/exec/libcsupport/src/no_libc.c
c/src/exec/libcsupport/src/unixlibc.c
c/src/exec/libcsupport/src/utsname.c
c/src/exec/posix/include/limits.h
c/src/exec/posix/include/rtems/posix/cancel.h
c/src/exec/posix/include/rtems/posix/cond.h
c/src/exec/posix/include/rtems/posix/condmp.h
c/src/exec/posix/include/rtems/posix/config.h
c/src/exec/posix/include/rtems/posix/intr.h
c/src/exec/posix/include/rtems/posix/key.h
c/src/exec/posix/include/rtems/posix/mqueue.h
c/src/exec/posix/include/rtems/posix/mqueuemp.h
c/src/exec/posix/include/rtems/posix/mutex.h
c/src/exec/posix/include/rtems/posix/mutexmp.h
c/src/exec/posix/include/rtems/posix/posixapi.h
c/src/exec/posix/include/rtems/posix/priority.h
c/src/exec/posix/include/rtems/posix/psignal.h
c/src/exec/posix/include/rtems/posix/pthread.h
c/src/exec/posix/include/rtems/posix/pthreadmp.h
c/src/exec/posix/include/rtems/posix/semaphore.h
c/src/exec/posix/include/rtems/posix/semaphoremp.h
c/src/exec/posix/include/rtems/posix/seterr.h
c/src/exec/posix/include/rtems/posix/threadsup.h
c/src/exec/posix/include/rtems/posix/time.h
c/src/exec/posix/include/sys/utsname.h
c/src/exec/rtems/include/rtems.h
c/src/exec/rtems/include/rtems/rtems/asr.h
c/src/exec/rtems/include/rtems/rtems/attr.h
c/src/exec/rtems/include/rtems/rtems/clock.h
c/src/exec/rtems/include/rtems/rtems/config.h
c/src/exec/rtems/include/rtems/rtems/dpmem.h
c/src/exec/rtems/include/rtems/rtems/event.h
c/src/exec/rtems/include/rtems/rtems/eventmp.h
c/src/exec/rtems/include/rtems/rtems/eventset.h
c/src/exec/rtems/include/rtems/rtems/intr.h
c/src/exec/rtems/include/rtems/rtems/message.h
c/src/exec/rtems/include/rtems/rtems/modes.h
c/src/exec/rtems/include/rtems/rtems/mp.h
c/src/exec/rtems/include/rtems/rtems/msgmp.h
c/src/exec/rtems/include/rtems/rtems/options.h
c/src/exec/rtems/include/rtems/rtems/part.h
c/src/exec/rtems/include/rtems/rtems/partmp.h
c/src/exec/rtems/include/rtems/rtems/ratemon.h
c/src/exec/rtems/include/rtems/rtems/region.h
c/src/exec/rtems/include/rtems/rtems/regionmp.h
c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
c/src/exec/rtems/include/rtems/rtems/sem.h
c/src/exec/rtems/include/rtems/rtems/semmp.h
c/src/exec/rtems/include/rtems/rtems/signal.h
c/src/exec/rtems/include/rtems/rtems/signalmp.h
c/src/exec/rtems/include/rtems/rtems/status.h
c/src/exec/rtems/include/rtems/rtems/support.h
c/src/exec/rtems/include/rtems/rtems/taskmp.h
c/src/exec/rtems/include/rtems/rtems/tasks.h
c/src/exec/rtems/include/rtems/rtems/timer.h
c/src/exec/rtems/include/rtems/rtems/types.h
c/src/exec/rtems/inline/rtems/rtems/asr.inl
c/src/exec/rtems/inline/rtems/rtems/attr.inl
c/src/exec/rtems/inline/rtems/rtems/dpmem.inl
c/src/exec/rtems/inline/rtems/rtems/event.inl
c/src/exec/rtems/inline/rtems/rtems/eventset.inl
c/src/exec/rtems/inline/rtems/rtems/message.inl
c/src/exec/rtems/inline/rtems/rtems/modes.inl
c/src/exec/rtems/inline/rtems/rtems/options.inl
c/src/exec/rtems/inline/rtems/rtems/part.inl
c/src/exec/rtems/inline/rtems/rtems/ratemon.inl
c/src/exec/rtems/inline/rtems/rtems/region.inl
c/src/exec/rtems/inline/rtems/rtems/sem.inl
c/src/exec/rtems/inline/rtems/rtems/status.inl
c/src/exec/rtems/inline/rtems/rtems/support.inl
c/src/exec/rtems/inline/rtems/rtems/tasks.inl
c/src/exec/rtems/inline/rtems/rtems/timer.inl
c/src/exec/rtems/macros/rtems/rtems/asr.inl
c/src/exec/rtems/macros/rtems/rtems/attr.inl
c/src/exec/rtems/macros/rtems/rtems/dpmem.inl
c/src/exec/rtems/macros/rtems/rtems/event.inl
c/src/exec/rtems/macros/rtems/rtems/eventset.inl
c/src/exec/rtems/macros/rtems/rtems/message.inl
c/src/exec/rtems/macros/rtems/rtems/modes.inl
c/src/exec/rtems/macros/rtems/rtems/options.inl
c/src/exec/rtems/macros/rtems/rtems/part.inl
c/src/exec/rtems/macros/rtems/rtems/ratemon.inl
c/src/exec/rtems/macros/rtems/rtems/region.inl
c/src/exec/rtems/macros/rtems/rtems/sem.inl
c/src/exec/rtems/macros/rtems/rtems/status.inl
c/src/exec/rtems/macros/rtems/rtems/support.inl
c/src/exec/rtems/macros/rtems/rtems/tasks.inl
c/src/exec/rtems/macros/rtems/rtems/timer.inl
c/src/exec/rtems/src/rtclock.c
c/src/exec/rtems/src/rtemstimer.c
c/src/exec/sapi/headers/confdefs.h
c/src/exec/sapi/include/confdefs.h
c/src/exec/sapi/include/rtems/config.h
c/src/exec/sapi/include/rtems/directives.h
c/src/exec/sapi/include/rtems/extension.h
c/src/exec/sapi/include/rtems/fatal.h
c/src/exec/sapi/include/rtems/init.h
c/src/exec/sapi/include/rtems/io.h
c/src/exec/sapi/include/rtems/mptables.h
c/src/exec/sapi/include/rtems/sptables.h
c/src/exec/sapi/inline/rtems/extension.inl
c/src/exec/sapi/macros/rtems/extension.inl
c/src/exec/sapi/src/exinit.c
c/src/exec/score/cpu/hppa1.1/cpu.c
c/src/exec/score/cpu/hppa1.1/cpu.h
c/src/exec/score/cpu/hppa1.1/cpu_asm.h
c/src/exec/score/cpu/hppa1.1/cpu_asm.s
c/src/exec/score/cpu/hppa1.1/hppa.h
c/src/exec/score/cpu/hppa1.1/hppatypes.h
c/src/exec/score/cpu/hppa1.1/rtems.s
c/src/exec/score/cpu/mips/asm.h
c/src/exec/score/cpu/mips/cpu.c
c/src/exec/score/cpu/mips/cpu_asm.S
c/src/exec/score/cpu/mips/cpu_asm.h
c/src/exec/score/cpu/mips/idtcpu.h
c/src/exec/score/cpu/mips/idtmon.h
c/src/exec/score/cpu/mips/iregdef.h
c/src/exec/score/cpu/mips/rtems.c
c/src/exec/score/cpu/powerpc/README
c/src/exec/score/cpu/powerpc/TODO
c/src/exec/score/cpu/powerpc/cpu.c
c/src/exec/score/cpu/powerpc/cpu.h
c/src/exec/score/cpu/powerpc/cpu_asm.s
c/src/exec/score/cpu/powerpc/irq_stub.s
c/src/exec/score/cpu/powerpc/ppc.h
c/src/exec/score/cpu/powerpc/ppctypes.h
c/src/exec/score/cpu/powerpc/rtems.s
c/src/exec/score/include/rtems/debug.h
c/src/exec/score/include/rtems/score/address.h
c/src/exec/score/include/rtems/score/apiext.h
c/src/exec/score/include/rtems/score/bitfield.h
c/src/exec/score/include/rtems/score/chain.h
c/src/exec/score/include/rtems/score/context.h
c/src/exec/score/include/rtems/score/copyrt.h
c/src/exec/score/include/rtems/score/coremsg.h
c/src/exec/score/include/rtems/score/coremutex.h
c/src/exec/score/include/rtems/score/coresem.h
c/src/exec/score/include/rtems/score/heap.h
c/src/exec/score/include/rtems/score/interr.h
c/src/exec/score/include/rtems/score/isr.h
c/src/exec/score/include/rtems/score/mpci.h
c/src/exec/score/include/rtems/score/mppkt.h
c/src/exec/score/include/rtems/score/object.h
c/src/exec/score/include/rtems/score/objectmp.h
c/src/exec/score/include/rtems/score/priority.h
c/src/exec/score/include/rtems/score/stack.h
c/src/exec/score/include/rtems/score/states.h
c/src/exec/score/include/rtems/score/sysstate.h
c/src/exec/score/include/rtems/score/thread.h
c/src/exec/score/include/rtems/score/threadmp.h
c/src/exec/score/include/rtems/score/threadq.h
c/src/exec/score/include/rtems/score/tod.h
c/src/exec/score/include/rtems/score/tqdata.h
c/src/exec/score/include/rtems/score/userext.h
c/src/exec/score/include/rtems/score/watchdog.h
c/src/exec/score/include/rtems/score/wkspace.h
c/src/exec/score/include/rtems/system.h
c/src/exec/score/inline/rtems/score/address.inl
c/src/exec/score/inline/rtems/score/chain.inl
c/src/exec/score/inline/rtems/score/coremsg.inl
c/src/exec/score/inline/rtems/score/coremutex.inl
c/src/exec/score/inline/rtems/score/coresem.inl
c/src/exec/score/inline/rtems/score/heap.inl
c/src/exec/score/inline/rtems/score/isr.inl
c/src/exec/score/inline/rtems/score/mppkt.inl
c/src/exec/score/inline/rtems/score/object.inl
c/src/exec/score/inline/rtems/score/objectmp.inl
c/src/exec/score/inline/rtems/score/priority.inl
c/src/exec/score/inline/rtems/score/stack.inl
c/src/exec/score/inline/rtems/score/states.inl
c/src/exec/score/inline/rtems/score/sysstate.inl
c/src/exec/score/inline/rtems/score/thread.inl
c/src/exec/score/inline/rtems/score/threadmp.inl
c/src/exec/score/inline/rtems/score/tod.inl
c/src/exec/score/inline/rtems/score/tqdata.inl
c/src/exec/score/inline/rtems/score/userext.inl
c/src/exec/score/inline/rtems/score/watchdog.inl
c/src/exec/score/inline/rtems/score/wkspace.inl
c/src/exec/score/macros/rtems/score/README
c/src/exec/score/macros/rtems/score/address.inl
c/src/exec/score/macros/rtems/score/chain.inl
c/src/exec/score/macros/rtems/score/coremsg.inl
c/src/exec/score/macros/rtems/score/coremutex.inl
c/src/exec/score/macros/rtems/score/coresem.inl
c/src/exec/score/macros/rtems/score/heap.inl
c/src/exec/score/macros/rtems/score/isr.inl
c/src/exec/score/macros/rtems/score/mppkt.inl
c/src/exec/score/macros/rtems/score/object.inl
c/src/exec/score/macros/rtems/score/objectmp.inl
c/src/exec/score/macros/rtems/score/priority.inl
c/src/exec/score/macros/rtems/score/stack.inl
c/src/exec/score/macros/rtems/score/states.inl
c/src/exec/score/macros/rtems/score/sysstate.inl
c/src/exec/score/macros/rtems/score/thread.inl
c/src/exec/score/macros/rtems/score/threadmp.inl
c/src/exec/score/macros/rtems/score/tod.inl
c/src/exec/score/macros/rtems/score/tqdata.inl
c/src/exec/score/macros/rtems/score/userext.inl
c/src/exec/score/macros/rtems/score/watchdog.inl
c/src/exec/score/macros/rtems/score/wkspace.inl
c/src/exec/score/src/coretod.c
c/src/exec/score/tools/hppa1.1/genoffsets.c
c/src/lib/include/rtems/assoc.h
c/src/lib/include/rtems/error.h
c/src/lib/include/rtems/libcsupport.h
c/src/lib/include/rtems/libio.h
c/src/lib/include/sys/utsname.h
c/src/lib/libbsp/hppa1.1/pxfl/README
c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h
c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h
c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c
c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c
c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c
c/src/lib/libbsp/hppa1.1/simhppa/times
c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c
c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c
c/src/lib/libbsp/mips/p4000/README
c/src/lib/libbsp/mips/p4000/console/console.c
c/src/lib/libbsp/mips/p4000/console/led.S
c/src/lib/libbsp/mips/p4000/include/bsp.h
c/src/lib/libbsp/mips/p4000/include/coverhd.h
c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S
c/src/lib/libbsp/mips/p4000/start/start.S
c/src/lib/libbsp/mips/p4000/startup/bspclean.c
c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds
c/src/lib/libbsp/mips/p4000/startup/idtmem.S
c/src/lib/libbsp/mips/p4000/startup/idttlb.S
c/src/lib/libbsp/mips/p4000/startup/inittlb.c
c/src/lib/libbsp/mips/p4000/startup/linkcmds
c/src/lib/libbsp/mips/p4000/startup/setvec.c
c/src/lib/libbsp/mips/p4000/times
c/src/lib/libbsp/powerpc/papyrus/README
c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s
c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s
c/src/lib/libbsp/powerpc/papyrus/include/bsp.h
c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h
c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c
c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c
c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds
c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c
c/src/lib/libbsp/powerpc/papyrus/times
c/src/lib/libc/utsname.c
c/src/lib/libcpu/hppa1.1/clock/clock.c
c/src/lib/libcpu/hppa1.1/runway/runway.h
c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c
c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h
c/src/lib/libcpu/hppa1.1/timer/timer.c
c/src/lib/libcpu/mips/clock/ckinit.c
c/src/lib/libcpu/mips/clock/clock.S
c/src/lib/libcpu/mips/clock/clock.h
c/src/lib/libcpu/mips/timer/gettime.S
c/src/lib/libcpu/mips/timer/timer.c
c/src/lib/libcpu/powerpc/README
c/src/lib/libcpu/powerpc/ppc403/README
c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
c/src/lib/libcpu/powerpc/ppc403/console/console.c
c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
c/src/lib/libcpu/powerpc/ppc403/vectors/README
c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s
c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s
c/src/lib/libcpu/sparc/include/erc32.h
c/src/libchip/shmdr/README
c/src/libchip/shmdr/addlq.c
c/src/libchip/shmdr/cnvpkt.c
c/src/libchip/shmdr/dump.c
c/src/libchip/shmdr/fatal.c
c/src/libchip/shmdr/getlq.c
c/src/libchip/shmdr/getpkt.c
c/src/libchip/shmdr/init.c
c/src/libchip/shmdr/initlq.c
c/src/libchip/shmdr/intr.c
c/src/libchip/shmdr/mpci.h
c/src/libchip/shmdr/mpisr.c
c/src/libchip/shmdr/poll.c
c/src/libchip/shmdr/receive.c
c/src/libchip/shmdr/retpkt.c
c/src/libchip/shmdr/send.c
c/src/libchip/shmdr/setckvec.c
c/src/libchip/shmdr/shm_driver.h
c/src/optman/rtems/no-dpmem.c
c/src/optman/rtems/no-event.c
c/src/optman/rtems/no-mp.c
c/src/optman/rtems/no-msg.c
c/src/optman/rtems/no-part.c
c/src/optman/rtems/no-region.c
c/src/optman/rtems/no-rtmon.c
c/src/optman/rtems/no-sem.c
c/src/optman/rtems/no-signal.c
c/src/optman/rtems/no-timer.c
c/src/optman/sapi/no-ext.c
c/src/optman/sapi/no-io.c
cpukit/libcsupport/include/clockdrv.h
cpukit/libcsupport/include/console.h
cpukit/libcsupport/include/iosupp.h
cpukit/libcsupport/include/ringbuf.h
cpukit/libcsupport/include/rtems/assoc.h
cpukit/libcsupport/include/rtems/error.h
cpukit/libcsupport/include/rtems/libcsupport.h
cpukit/libcsupport/include/rtems/libio.h
cpukit/libcsupport/include/spurious.h
cpukit/libcsupport/include/sys/utsname.h
cpukit/libcsupport/include/timerdrv.h
cpukit/libcsupport/include/vmeintr.h
cpukit/libcsupport/src/README
cpukit/libcsupport/src/__brk.c
cpukit/libcsupport/src/__gettod.c
cpukit/libcsupport/src/__times.c
cpukit/libcsupport/src/assoc.c
cpukit/libcsupport/src/error.c
cpukit/libcsupport/src/hosterr.c
cpukit/libcsupport/src/libio.c
cpukit/libcsupport/src/malloc.c
cpukit/libcsupport/src/newlibc.c
cpukit/libcsupport/src/no_libc.c
cpukit/libcsupport/src/unixlibc.c
cpukit/libcsupport/src/utsname.c
cpukit/libmisc/README
cpukit/libmisc/monitor/README
cpukit/libmisc/monitor/mon-command.c
cpukit/libmisc/monitor/mon-config.c
cpukit/libmisc/monitor/mon-dname.c
cpukit/libmisc/monitor/mon-driver.c
cpukit/libmisc/monitor/mon-extension.c
cpukit/libmisc/monitor/mon-itask.c
cpukit/libmisc/monitor/mon-manager.c
cpukit/libmisc/monitor/mon-monitor.c
cpukit/libmisc/monitor/mon-mpci.c
cpukit/libmisc/monitor/mon-object.c
cpukit/libmisc/monitor/mon-prmisc.c
cpukit/libmisc/monitor/mon-queue.c
cpukit/libmisc/monitor/mon-server.c
cpukit/libmisc/monitor/mon-symbols.c
cpukit/libmisc/monitor/mon-task.c
cpukit/libmisc/monitor/monitor.h
cpukit/libmisc/monitor/symbols.h
cpukit/libmisc/stackchk/README
cpukit/libmisc/stackchk/check.c
cpukit/libmisc/stackchk/internal.h
cpukit/libmisc/stackchk/stackchk.h
cpukit/posix/include/aio.h
cpukit/posix/include/devctl.h
cpukit/posix/include/intr.h
cpukit/posix/include/mqueue.h
cpukit/posix/include/rtems/posix/cancel.h
cpukit/posix/include/rtems/posix/cond.h
cpukit/posix/include/rtems/posix/condmp.h
cpukit/posix/include/rtems/posix/config.h
cpukit/posix/include/rtems/posix/intr.h
cpukit/posix/include/rtems/posix/key.h
cpukit/posix/include/rtems/posix/mqueue.h
cpukit/posix/include/rtems/posix/mqueuemp.h
cpukit/posix/include/rtems/posix/mutex.h
cpukit/posix/include/rtems/posix/mutexmp.h
cpukit/posix/include/rtems/posix/posixapi.h
cpukit/posix/include/rtems/posix/priority.h
cpukit/posix/include/rtems/posix/psignal.h
cpukit/posix/include/rtems/posix/pthread.h
cpukit/posix/include/rtems/posix/pthreadmp.h
cpukit/posix/include/rtems/posix/semaphore.h
cpukit/posix/include/rtems/posix/semaphoremp.h
cpukit/posix/include/rtems/posix/threadsup.h
cpukit/posix/include/rtems/posix/time.h
cpukit/posix/include/sched.h
cpukit/posix/include/semaphore.h
cpukit/posix/inline/rtems/posix/cond.inl
cpukit/posix/inline/rtems/posix/intr.inl
cpukit/posix/inline/rtems/posix/key.inl
cpukit/posix/inline/rtems/posix/mqueue.inl
cpukit/posix/inline/rtems/posix/mutex.inl
cpukit/posix/inline/rtems/posix/priority.inl
cpukit/posix/inline/rtems/posix/pthread.inl
cpukit/posix/inline/rtems/posix/semaphore.inl
cpukit/posix/src/adasupp.c
cpukit/posix/src/aio.c
cpukit/posix/src/cancel.c
cpukit/posix/src/cond.c
cpukit/posix/src/devctl.c
cpukit/posix/src/intr.c
cpukit/posix/src/key.c
cpukit/posix/src/mqueue.c
cpukit/posix/src/mutex.c
cpukit/posix/src/psignal.c
cpukit/posix/src/pthread.c
cpukit/posix/src/ptimer.c
cpukit/posix/src/sched.c
cpukit/posix/src/semaphore.c
cpukit/posix/src/time.c
cpukit/posix/src/types.c
cpukit/rtems/include/rtems.h
cpukit/rtems/include/rtems/rtems/asr.h
cpukit/rtems/include/rtems/rtems/attr.h
cpukit/rtems/include/rtems/rtems/clock.h
cpukit/rtems/include/rtems/rtems/config.h
cpukit/rtems/include/rtems/rtems/dpmem.h
cpukit/rtems/include/rtems/rtems/event.h
cpukit/rtems/include/rtems/rtems/eventmp.h
cpukit/rtems/include/rtems/rtems/eventset.h
cpukit/rtems/include/rtems/rtems/intr.h
cpukit/rtems/include/rtems/rtems/message.h
cpukit/rtems/include/rtems/rtems/modes.h
cpukit/rtems/include/rtems/rtems/mp.h
cpukit/rtems/include/rtems/rtems/msgmp.h
cpukit/rtems/include/rtems/rtems/options.h
cpukit/rtems/include/rtems/rtems/part.h
cpukit/rtems/include/rtems/rtems/partmp.h
cpukit/rtems/include/rtems/rtems/ratemon.h
cpukit/rtems/include/rtems/rtems/region.h
cpukit/rtems/include/rtems/rtems/regionmp.h
cpukit/rtems/include/rtems/rtems/rtemsapi.h
cpukit/rtems/include/rtems/rtems/sem.h
cpukit/rtems/include/rtems/rtems/semmp.h
cpukit/rtems/include/rtems/rtems/signal.h
cpukit/rtems/include/rtems/rtems/signalmp.h
cpukit/rtems/include/rtems/rtems/status.h
cpukit/rtems/include/rtems/rtems/support.h
cpukit/rtems/include/rtems/rtems/taskmp.h
cpukit/rtems/include/rtems/rtems/tasks.h
cpukit/rtems/include/rtems/rtems/timer.h
cpukit/rtems/include/rtems/rtems/types.h
cpukit/rtems/inline/rtems/rtems/asr.inl
cpukit/rtems/inline/rtems/rtems/attr.inl
cpukit/rtems/inline/rtems/rtems/dpmem.inl
cpukit/rtems/inline/rtems/rtems/event.inl
cpukit/rtems/inline/rtems/rtems/eventset.inl
cpukit/rtems/inline/rtems/rtems/message.inl
cpukit/rtems/inline/rtems/rtems/modes.inl
cpukit/rtems/inline/rtems/rtems/options.inl
cpukit/rtems/inline/rtems/rtems/part.inl
cpukit/rtems/inline/rtems/rtems/ratemon.inl
cpukit/rtems/inline/rtems/rtems/region.inl
cpukit/rtems/inline/rtems/rtems/sem.inl
cpukit/rtems/inline/rtems/rtems/status.inl
cpukit/rtems/inline/rtems/rtems/support.inl
cpukit/rtems/inline/rtems/rtems/tasks.inl
cpukit/rtems/inline/rtems/rtems/timer.inl
cpukit/rtems/macros/rtems/rtems/asr.inl
cpukit/rtems/macros/rtems/rtems/attr.inl
cpukit/rtems/macros/rtems/rtems/dpmem.inl
cpukit/rtems/macros/rtems/rtems/event.inl
cpukit/rtems/macros/rtems/rtems/eventset.inl
cpukit/rtems/macros/rtems/rtems/message.inl
cpukit/rtems/macros/rtems/rtems/modes.inl
cpukit/rtems/macros/rtems/rtems/options.inl
cpukit/rtems/macros/rtems/rtems/part.inl
cpukit/rtems/macros/rtems/rtems/ratemon.inl
cpukit/rtems/macros/rtems/rtems/region.inl
cpukit/rtems/macros/rtems/rtems/sem.inl
cpukit/rtems/macros/rtems/rtems/status.inl
cpukit/rtems/macros/rtems/rtems/support.inl
cpukit/rtems/macros/rtems/rtems/tasks.inl
cpukit/rtems/macros/rtems/rtems/timer.inl
cpukit/rtems/src/dpmem.c
cpukit/rtems/src/event.c
cpukit/rtems/src/eventmp.c
cpukit/rtems/src/intr.c
cpukit/rtems/src/mp.c
cpukit/rtems/src/msg.c
cpukit/rtems/src/msgmp.c
cpukit/rtems/src/part.c
cpukit/rtems/src/partmp.c
cpukit/rtems/src/ratemon.c
cpukit/rtems/src/region.c
cpukit/rtems/src/regionmp.c
cpukit/rtems/src/rtclock.c
cpukit/rtems/src/rtemstimer.c
cpukit/rtems/src/sem.c
cpukit/rtems/src/semmp.c
cpukit/rtems/src/signal.c
cpukit/rtems/src/signalmp.c
cpukit/rtems/src/taskmp.c
cpukit/rtems/src/tasks.c
cpukit/sapi/include/confdefs.h
cpukit/sapi/include/rtems/config.h
cpukit/sapi/include/rtems/extension.h
cpukit/sapi/include/rtems/fatal.h
cpukit/sapi/include/rtems/init.h
cpukit/sapi/include/rtems/io.h
cpukit/sapi/include/rtems/mptables.h
cpukit/sapi/inline/rtems/extension.inl
cpukit/sapi/macros/rtems/extension.inl
cpukit/sapi/src/debug.c
cpukit/sapi/src/exinit.c
cpukit/sapi/src/extension.c
cpukit/sapi/src/fatal.c
cpukit/sapi/src/io.c
cpukit/sapi/src/posixapi.c
cpukit/sapi/src/rtemsapi.c
cpukit/score/cpu/a29k/amd.ah
cpukit/score/cpu/a29k/asm.h
cpukit/score/cpu/a29k/cpu.c
cpukit/score/cpu/a29k/pswmacro.ah
cpukit/score/cpu/hppa1.1/cpu.c
cpukit/score/cpu/i386/asm.h
cpukit/score/cpu/i386/cpu.c
cpukit/score/cpu/i386/rtems/asm.h
cpukit/score/cpu/i960/asm.h
cpukit/score/cpu/i960/cpu.c
cpukit/score/cpu/m68k/asm.h
cpukit/score/cpu/m68k/cpu.c
cpukit/score/cpu/m68k/m68302.h
cpukit/score/cpu/m68k/m68360.h
cpukit/score/cpu/m68k/qsm.h
cpukit/score/cpu/m68k/rtems/asm.h
cpukit/score/cpu/m68k/rtems/m68k/m68302.h
cpukit/score/cpu/m68k/rtems/m68k/m68360.h
cpukit/score/cpu/m68k/rtems/m68k/qsm.h
cpukit/score/cpu/m68k/rtems/m68k/sim.h
cpukit/score/cpu/m68k/sim.h
cpukit/score/cpu/mips/asm.h
cpukit/score/cpu/mips/cpu.c
cpukit/score/cpu/mips/cpu_asm.S
cpukit/score/cpu/mips/idtcpu.h
cpukit/score/cpu/mips/iregdef.h
cpukit/score/cpu/mips/rtems/asm.h
cpukit/score/cpu/mips/rtems/mips/idtcpu.h
cpukit/score/cpu/mips/rtems/mips/iregdef.h
cpukit/score/cpu/mips64orion/asm.h
cpukit/score/cpu/mips64orion/cpu.c
cpukit/score/cpu/mips64orion/cpu_asm.S
cpukit/score/cpu/mips64orion/cpu_asm.h
cpukit/score/cpu/mips64orion/idtcpu.h
cpukit/score/cpu/mips64orion/idtmon.h
cpukit/score/cpu/mips64orion/iregdef.h
cpukit/score/cpu/no_cpu/asm.h
cpukit/score/cpu/no_cpu/cpu.c
cpukit/score/cpu/no_cpu/cpu_asm.c
cpukit/score/cpu/no_cpu/rtems/asm.h
cpukit/score/cpu/sparc/README
cpukit/score/cpu/sparc/asm.h
cpukit/score/cpu/sparc/cpu.c
cpukit/score/cpu/sparc/rtems/asm.h
cpukit/score/cpu/unix/cpu.c
cpukit/score/include/rtems/debug.h
cpukit/score/include/rtems/score/address.h
cpukit/score/include/rtems/score/apiext.h
cpukit/score/include/rtems/score/bitfield.h
cpukit/score/include/rtems/score/chain.h
cpukit/score/include/rtems/score/context.h
cpukit/score/include/rtems/score/copyrt.h
cpukit/score/include/rtems/score/coremsg.h
cpukit/score/include/rtems/score/coremutex.h
cpukit/score/include/rtems/score/coresem.h
cpukit/score/include/rtems/score/heap.h
cpukit/score/include/rtems/score/interr.h
cpukit/score/include/rtems/score/isr.h
cpukit/score/include/rtems/score/mpci.h
cpukit/score/include/rtems/score/mppkt.h
cpukit/score/include/rtems/score/object.h
cpukit/score/include/rtems/score/objectmp.h
cpukit/score/include/rtems/score/priority.h
cpukit/score/include/rtems/score/stack.h
cpukit/score/include/rtems/score/states.h
cpukit/score/include/rtems/score/sysstate.h
cpukit/score/include/rtems/score/thread.h
cpukit/score/include/rtems/score/threadmp.h
cpukit/score/include/rtems/score/threadq.h
cpukit/score/include/rtems/score/tod.h
cpukit/score/include/rtems/score/tqdata.h
cpukit/score/include/rtems/score/userext.h
cpukit/score/include/rtems/score/watchdog.h
cpukit/score/include/rtems/score/wkspace.h
cpukit/score/include/rtems/system.h
cpukit/score/inline/rtems/score/address.inl
cpukit/score/inline/rtems/score/chain.inl
cpukit/score/inline/rtems/score/coremsg.inl
cpukit/score/inline/rtems/score/coremutex.inl
cpukit/score/inline/rtems/score/coresem.inl
cpukit/score/inline/rtems/score/heap.inl
cpukit/score/inline/rtems/score/isr.inl
cpukit/score/inline/rtems/score/mppkt.inl
cpukit/score/inline/rtems/score/object.inl
cpukit/score/inline/rtems/score/objectmp.inl
cpukit/score/inline/rtems/score/priority.inl
cpukit/score/inline/rtems/score/stack.inl
cpukit/score/inline/rtems/score/states.inl
cpukit/score/inline/rtems/score/sysstate.inl
cpukit/score/inline/rtems/score/thread.inl
cpukit/score/inline/rtems/score/threadmp.inl
cpukit/score/inline/rtems/score/tod.inl
cpukit/score/inline/rtems/score/tqdata.inl
cpukit/score/inline/rtems/score/userext.inl
cpukit/score/inline/rtems/score/watchdog.inl
cpukit/score/inline/rtems/score/wkspace.inl
cpukit/score/macros/README
cpukit/score/macros/rtems/score/README
cpukit/score/macros/rtems/score/address.inl
cpukit/score/macros/rtems/score/chain.inl
cpukit/score/macros/rtems/score/coremsg.inl
cpukit/score/macros/rtems/score/coremutex.inl
cpukit/score/macros/rtems/score/coresem.inl
cpukit/score/macros/rtems/score/heap.inl
cpukit/score/macros/rtems/score/isr.inl
cpukit/score/macros/rtems/score/mppkt.inl
cpukit/score/macros/rtems/score/object.inl
cpukit/score/macros/rtems/score/objectmp.inl
cpukit/score/macros/rtems/score/priority.inl
cpukit/score/macros/rtems/score/stack.inl
cpukit/score/macros/rtems/score/states.inl
cpukit/score/macros/rtems/score/sysstate.inl
cpukit/score/macros/rtems/score/thread.inl
cpukit/score/macros/rtems/score/threadmp.inl
cpukit/score/macros/rtems/score/tod.inl
cpukit/score/macros/rtems/score/tqdata.inl
cpukit/score/macros/rtems/score/userext.inl
cpukit/score/macros/rtems/score/watchdog.inl
cpukit/score/macros/rtems/score/wkspace.inl
cpukit/score/src/apiext.c
cpukit/score/src/chain.c
cpukit/score/src/coremsg.c
cpukit/score/src/coremutex.c
cpukit/score/src/coresem.c
cpukit/score/src/coretod.c
cpukit/score/src/heap.c
cpukit/score/src/interr.c
cpukit/score/src/isr.c
cpukit/score/src/mpci.c
cpukit/score/src/object.c
cpukit/score/src/objectmp.c
cpukit/score/src/thread.c
cpukit/score/src/threadmp.c
cpukit/score/src/threadq.c
cpukit/score/src/userext.c
cpukit/score/src/watchdog.c
cpukit/score/src/wkspace.c
cpukit/zlib/doc/rfc1950.txt
cpukit/zlib/doc/rfc1951.txt
cpukit/zlib/doc/rfc1952.txt
testsuites/README
testsuites/libtests/README
testsuites/libtests/malloctest/init.c
testsuites/libtests/malloctest/system.h
testsuites/libtests/malloctest/task1.c
testsuites/libtests/stackchk/blow.c
testsuites/libtests/stackchk/init.c
testsuites/libtests/stackchk/stackchk.scn
testsuites/libtests/stackchk/system.h
testsuites/libtests/stackchk/task1.c
testsuites/mptests/README
testsuites/mptests/mp01/init.c
testsuites/mptests/mp01/node1/mp01.doc
testsuites/mptests/mp01/node1/mp01.scn
testsuites/mptests/mp01/node2/mp01.doc
testsuites/mptests/mp01/node2/mp01.scn
testsuites/mptests/mp01/system.h
testsuites/mptests/mp01/task1.c
testsuites/mptests/mp02/init.c
testsuites/mptests/mp02/node1/mp02.doc
testsuites/mptests/mp02/node1/mp02.scn
testsuites/mptests/mp02/node2/mp02.doc
testsuites/mptests/mp02/node2/mp02.scn
testsuites/mptests/mp02/system.h
testsuites/mptests/mp02/task1.c
testsuites/mptests/mp03/delay.c
testsuites/mptests/mp03/init.c
testsuites/mptests/mp03/node1/mp03.doc
testsuites/mptests/mp03/node1/mp03.scn
testsuites/mptests/mp03/node2/mp03.doc
testsuites/mptests/mp03/node2/mp03.scn
testsuites/mptests/mp03/system.h
testsuites/mptests/mp03/task1.c
testsuites/mptests/mp04/init.c
testsuites/mptests/mp04/node1/mp04.doc
testsuites/mptests/mp04/node1/mp04.scn
testsuites/mptests/mp04/node2/mp04.doc
testsuites/mptests/mp04/node2/mp04.scn
testsuites/mptests/mp04/system.h
testsuites/mptests/mp04/task1.c
testsuites/mptests/mp05/asr.c
testsuites/mptests/mp05/init.c
testsuites/mptests/mp05/node1/mp05.doc
testsuites/mptests/mp05/node1/mp05.scn
testsuites/mptests/mp05/node2/mp05.doc
testsuites/mptests/mp05/node2/mp05.scn
testsuites/mptests/mp05/system.h
testsuites/mptests/mp05/task1.c
testsuites/mptests/mp06/init.c
testsuites/mptests/mp06/node1/mp06.doc
testsuites/mptests/mp06/node1/mp06.scn
testsuites/mptests/mp06/node2/mp06.doc
testsuites/mptests/mp06/node2/mp06.scn
testsuites/mptests/mp06/system.h
testsuites/mptests/mp06/task1.c
testsuites/mptests/mp07/init.c
testsuites/mptests/mp07/node1/mp07.doc
testsuites/mptests/mp07/node1/mp07.scn
testsuites/mptests/mp07/node2/mp07.doc
testsuites/mptests/mp07/node2/mp07.scn
testsuites/mptests/mp07/system.h
testsuites/mptests/mp07/task1.c
testsuites/mptests/mp08/init.c
testsuites/mptests/mp08/node1/mp08.doc
testsuites/mptests/mp08/node1/mp08.scn
testsuites/mptests/mp08/node2/mp08.doc
testsuites/mptests/mp08/node2/mp08.scn
testsuites/mptests/mp08/system.h
testsuites/mptests/mp08/task1.c
testsuites/mptests/mp09/init.c
testsuites/mptests/mp09/node1/mp09.doc
testsuites/mptests/mp09/node1/mp09.scn
testsuites/mptests/mp09/node2/mp09.doc
testsuites/mptests/mp09/node2/mp09.scn
testsuites/mptests/mp09/recvmsg.c
testsuites/mptests/mp09/sendmsg.c
testsuites/mptests/mp09/system.h
testsuites/mptests/mp09/task1.c
testsuites/mptests/mp10/init.c
testsuites/mptests/mp10/node1/mp10.doc
testsuites/mptests/mp10/node1/mp10.scn
testsuites/mptests/mp10/node2/mp10.doc
testsuites/mptests/mp10/node2/mp10.scn
testsuites/mptests/mp10/system.h
testsuites/mptests/mp10/task1.c
testsuites/mptests/mp10/task2.c
testsuites/mptests/mp10/task3.c
testsuites/mptests/mp11/init.c
testsuites/mptests/mp11/node1/mp11.doc
testsuites/mptests/mp11/node1/mp11.scn
testsuites/mptests/mp11/node2/mp11.doc
testsuites/mptests/mp11/node2/mp11.scn
testsuites/mptests/mp11/system.h
testsuites/mptests/mp12/init.c
testsuites/mptests/mp12/node1/mp12.doc
testsuites/mptests/mp12/node1/mp12.scn
testsuites/mptests/mp12/node2/mp12.doc
testsuites/mptests/mp12/node2/mp12.scn
testsuites/mptests/mp12/system.h
testsuites/mptests/mp13/init.c
testsuites/mptests/mp13/node1/mp13.doc
testsuites/mptests/mp13/node1/mp13.scn
testsuites/mptests/mp13/node2/mp13.doc
testsuites/mptests/mp13/node2/mp13.scn
testsuites/mptests/mp13/system.h
testsuites/mptests/mp13/task1.c
testsuites/mptests/mp13/task2.c
testsuites/mptests/mp14/delay.c
testsuites/mptests/mp14/evtask1.c
testsuites/mptests/mp14/evtmtask.c
testsuites/mptests/mp14/exit.c
testsuites/mptests/mp14/init.c
testsuites/mptests/mp14/msgtask1.c
testsuites/mptests/mp14/node1/mp14.doc
testsuites/mptests/mp14/node1/mp14.scn
testsuites/mptests/mp14/node2/mp14.doc
testsuites/mptests/mp14/node2/mp14.scn
testsuites/mptests/mp14/pttask1.c
testsuites/mptests/mp14/smtask1.c
testsuites/mptests/mp14/system.h
testsuites/psxtests/include/pmacros.h
testsuites/psxtests/psx01/init.c
testsuites/psxtests/psx01/psx01.scn
testsuites/psxtests/psx01/system.h
testsuites/psxtests/psx01/task.c
testsuites/psxtests/psx02/init.c
testsuites/psxtests/psx02/psx02.scn
testsuites/psxtests/psx02/system.h
testsuites/psxtests/psx02/task.c
testsuites/psxtests/psx03/init.c
testsuites/psxtests/psx03/psx03.scn
testsuites/psxtests/psx03/system.h
testsuites/psxtests/psx03/task.c
testsuites/psxtests/psx04/init.c
testsuites/psxtests/psx04/psx04.scn
testsuites/psxtests/psx04/system.h
testsuites/psxtests/psx04/task1.c
testsuites/psxtests/psx04/task2.c
testsuites/psxtests/psx04/task3.c
testsuites/psxtests/psx05/init.c
testsuites/psxtests/psx05/psx05.scn
testsuites/psxtests/psx05/system.h
testsuites/psxtests/psx05/task.c
testsuites/psxtests/psx05/task2.c
testsuites/psxtests/psx05/task3.c
testsuites/psxtests/psx06/init.c
testsuites/psxtests/psx06/psx06.scn
testsuites/psxtests/psx06/system.h
testsuites/psxtests/psx06/task.c
testsuites/psxtests/psx06/task2.c
testsuites/psxtests/psx07/init.c
testsuites/psxtests/psx07/psx07.scn
testsuites/psxtests/psx07/system.h
testsuites/psxtests/psx07/task.c
testsuites/psxtests/psx08/init.c
testsuites/psxtests/psx08/psx08.scn
testsuites/psxtests/psx08/system.h
testsuites/psxtests/psx08/task2.c
testsuites/psxtests/psx09/init.c
testsuites/psxtests/psx09/psx09.scn
testsuites/psxtests/psx09/system.h
testsuites/psxtests/psx10/init.c
testsuites/psxtests/psx10/psx10.scn
testsuites/psxtests/psx10/system.h
testsuites/psxtests/psx10/task.c
testsuites/psxtests/psx10/task2.c
testsuites/psxtests/psx10/task3.c
testsuites/psxtests/psx11/init.c
testsuites/psxtests/psx11/psx11.scn
testsuites/psxtests/psx11/system.h
testsuites/psxtests/psx11/task.c
testsuites/psxtests/psx12/init.c
testsuites/psxtests/psx12/psx12.scn
testsuites/psxtests/psx12/system.h
testsuites/psxtests/psx12/task.c
testsuites/psxtests/psxhdrs/clock01.c
testsuites/psxtests/psxhdrs/clock02.c
testsuites/psxtests/psxhdrs/clock03.c
testsuites/psxtests/psxhdrs/clock04.c
testsuites/psxtests/psxhdrs/clock05.c
testsuites/psxtests/psxhdrs/clock06.c
testsuites/psxtests/psxhdrs/cond01.c
testsuites/psxtests/psxhdrs/cond02.c
testsuites/psxtests/psxhdrs/cond03.c
testsuites/psxtests/psxhdrs/cond04.c
testsuites/psxtests/psxhdrs/cond05.c
testsuites/psxtests/psxhdrs/cond06.c
testsuites/psxtests/psxhdrs/cond07.c
testsuites/psxtests/psxhdrs/cond08.c
testsuites/psxtests/psxhdrs/cond09.c
testsuites/psxtests/psxhdrs/cond10.c
testsuites/psxtests/psxhdrs/key01.c
testsuites/psxtests/psxhdrs/key02.c
testsuites/psxtests/psxhdrs/key03.c
testsuites/psxtests/psxhdrs/key04.c
testsuites/psxtests/psxhdrs/mutex01.c
testsuites/psxtests/psxhdrs/mutex02.c
testsuites/psxtests/psxhdrs/mutex03.c
testsuites/psxtests/psxhdrs/mutex04.c
testsuites/psxtests/psxhdrs/mutex05.c
testsuites/psxtests/psxhdrs/mutex06.c
testsuites/psxtests/psxhdrs/mutex07.c
testsuites/psxtests/psxhdrs/mutex08.c
testsuites/psxtests/psxhdrs/mutex09.c
testsuites/psxtests/psxhdrs/mutex10.c
testsuites/psxtests/psxhdrs/mutex11.c
testsuites/psxtests/psxhdrs/mutex12.c
testsuites/psxtests/psxhdrs/mutex13.c
testsuites/psxtests/psxhdrs/mutex14.c
testsuites/psxtests/psxhdrs/mutex15.c
testsuites/psxtests/psxhdrs/mutex16.c
testsuites/psxtests/psxhdrs/proc01.c
testsuites/psxtests/psxhdrs/proc02.c
testsuites/psxtests/psxhdrs/proc03.c
testsuites/psxtests/psxhdrs/proc04.c
testsuites/psxtests/psxhdrs/proc05.c
testsuites/psxtests/psxhdrs/proc06.c
testsuites/psxtests/psxhdrs/proc07.c
testsuites/psxtests/psxhdrs/proc08.c
testsuites/psxtests/psxhdrs/proc09.c
testsuites/psxtests/psxhdrs/proc10.c
testsuites/psxtests/psxhdrs/proc11.c
testsuites/psxtests/psxhdrs/proc12.c
testsuites/psxtests/psxhdrs/proc13.c
testsuites/psxtests/psxhdrs/proc14.c
testsuites/psxtests/psxhdrs/pthread01.c
testsuites/psxtests/psxhdrs/pthread02.c
testsuites/psxtests/psxhdrs/pthread03.c
testsuites/psxtests/psxhdrs/pthread04.c
testsuites/psxtests/psxhdrs/pthread05.c
testsuites/psxtests/psxhdrs/pthread06.c
testsuites/psxtests/psxhdrs/pthread07.c
testsuites/psxtests/psxhdrs/pthread08.c
testsuites/psxtests/psxhdrs/pthread09.c
testsuites/psxtests/psxhdrs/pthread10.c
testsuites/psxtests/psxhdrs/pthread11.c
testsuites/psxtests/psxhdrs/pthread12.c
testsuites/psxtests/psxhdrs/pthread13.c
testsuites/psxtests/psxhdrs/pthread14.c
testsuites/psxtests/psxhdrs/pthread15.c
testsuites/psxtests/psxhdrs/pthread16.c
testsuites/psxtests/psxhdrs/pthread17.c
testsuites/psxtests/psxhdrs/pthread18.c
testsuites/psxtests/psxhdrs/pthread19.c
testsuites/psxtests/psxhdrs/pthread20.c
testsuites/psxtests/psxhdrs/pthread21.c
testsuites/psxtests/psxhdrs/pthread22.c
testsuites/psxtests/psxhdrs/pthread23.c
testsuites/psxtests/psxhdrs/pthread24.c
testsuites/psxtests/psxhdrs/pthread25.c
testsuites/psxtests/psxhdrs/pthread26.c
testsuites/psxtests/psxhdrs/pthread27.c
testsuites/psxtests/psxhdrs/pthread28.c
testsuites/psxtests/psxhdrs/pthread29.c
testsuites/psxtests/psxhdrs/pthread30.c
testsuites/psxtests/psxhdrs/pthread31.c
testsuites/psxtests/psxhdrs/pthread32.c
testsuites/psxtests/psxhdrs/pthread33.c
testsuites/psxtests/psxhdrs/pthread34.c
testsuites/psxtests/psxhdrs/pthread35.c
testsuites/psxtests/psxhdrs/pthread36.c
testsuites/psxtests/psxhdrs/sched01.c
testsuites/psxtests/psxhdrs/sched02.c
testsuites/psxtests/psxhdrs/sched03.c
testsuites/psxtests/psxhdrs/sched04.c
testsuites/psxtests/psxhdrs/sched05.c
testsuites/psxtests/psxhdrs/sched06.c
testsuites/psxtests/psxhdrs/sched07.c
testsuites/psxtests/psxhdrs/sched08.c
testsuites/psxtests/psxhdrs/signal01.c
testsuites/psxtests/psxhdrs/signal02.c
testsuites/psxtests/psxhdrs/signal03.c
testsuites/psxtests/psxhdrs/signal04.c
testsuites/psxtests/psxhdrs/signal05.c
testsuites/psxtests/psxhdrs/signal06.c
testsuites/psxtests/psxhdrs/signal07.c
testsuites/psxtests/psxhdrs/signal08.c
testsuites/psxtests/psxhdrs/signal09.c
testsuites/psxtests/psxhdrs/signal10.c
testsuites/psxtests/psxhdrs/signal11.c
testsuites/psxtests/psxhdrs/signal12.c
testsuites/psxtests/psxhdrs/signal13.c
testsuites/psxtests/psxhdrs/signal14.c
testsuites/psxtests/psxhdrs/signal15.c
testsuites/psxtests/psxhdrs/signal16.c
testsuites/psxtests/psxhdrs/signal17.c
testsuites/psxtests/psxhdrs/signal18.c
testsuites/psxtests/psxhdrs/signal19.c
testsuites/psxtests/psxhdrs/signal20.c
testsuites/psxtests/psxhdrs/signal21.c
testsuites/psxtests/psxhdrs/signal22.c
testsuites/psxtests/psxhdrs/time01.c
testsuites/psxtests/psxhdrs/time02.c
testsuites/psxtests/psxhdrs/time03.c
testsuites/psxtests/psxhdrs/time04.c
testsuites/psxtests/psxhdrs/time05.c
testsuites/psxtests/psxhdrs/time06.c
testsuites/psxtests/psxhdrs/time07.c
testsuites/psxtests/psxhdrs/time08.c
testsuites/psxtests/psxhdrs/time09.c
testsuites/psxtests/psxhdrs/time10.c
testsuites/psxtests/psxhdrs/time11.c
testsuites/psxtests/psxhdrs/time12.c
testsuites/psxtests/psxhdrs/time13.c
testsuites/psxtests/psxhdrs/timer01.c
testsuites/psxtests/psxhdrs/timer02.c
testsuites/psxtests/psxhdrs/timer03.c
testsuites/psxtests/psxhdrs/timer04.c
testsuites/psxtests/psxhdrs/timer05.c
testsuites/psxtests/psxhdrs/timer06.c
testsuites/samples/README
testsuites/samples/base_mp/apptask.c
testsuites/samples/base_mp/init.c
testsuites/samples/base_mp/node1/base_mp.doc
testsuites/samples/base_mp/node1/base_mp.scn
testsuites/samples/base_mp/node2/base_mp.doc
testsuites/samples/base_mp/node2/base_mp.scn
testsuites/samples/base_mp/system.h
testsuites/samples/base_sp/apptask.c
testsuites/samples/base_sp/base_sp.doc
testsuites/samples/base_sp/base_sp.scn
testsuites/samples/base_sp/init.c
testsuites/samples/base_sp/system.h
testsuites/samples/cdtest/cdtest.scn
testsuites/samples/cdtest/init.c
testsuites/samples/cdtest/main.cc
testsuites/samples/cdtest/system.h
testsuites/samples/hello/hello.doc
testsuites/samples/hello/hello.scn
testsuites/samples/hello/init.c
testsuites/samples/hello/system.h
testsuites/samples/paranoia/init.c
testsuites/samples/paranoia/paranoia.c
testsuites/samples/paranoia/paranoia.doc
testsuites/samples/paranoia/system.h
testsuites/samples/ticker/init.c
testsuites/samples/ticker/system.h
testsuites/samples/ticker/tasks.c
testsuites/samples/ticker/ticker.doc
testsuites/samples/ticker/ticker.scn
testsuites/sptests/README
testsuites/sptests/sp01/init.c
testsuites/sptests/sp01/sp01.doc
testsuites/sptests/sp01/sp01.scn
testsuites/sptests/sp01/system.h
testsuites/sptests/sp01/task1.c
testsuites/sptests/sp02/init.c
testsuites/sptests/sp02/preempt.c
testsuites/sptests/sp02/sp02.doc
testsuites/sptests/sp02/sp02.scn
testsuites/sptests/sp02/system.h
testsuites/sptests/sp02/task1.c
testsuites/sptests/sp02/task2.c
testsuites/sptests/sp02/task3.c
testsuites/sptests/sp03/init.c
testsuites/sptests/sp03/sp03.doc
testsuites/sptests/sp03/sp03.scn
testsuites/sptests/sp03/system.h
testsuites/sptests/sp03/task1.c
testsuites/sptests/sp03/task2.c
testsuites/sptests/sp04/init.c
testsuites/sptests/sp04/sp04.doc
testsuites/sptests/sp04/sp04.scn
testsuites/sptests/sp04/system.h
testsuites/sptests/sp04/task1.c
testsuites/sptests/sp04/task2.c
testsuites/sptests/sp04/task3.c
testsuites/sptests/sp04/tswitch.c
testsuites/sptests/sp05/init.c
testsuites/sptests/sp05/sp05.doc
testsuites/sptests/sp05/sp05.scn
testsuites/sptests/sp05/system.h
testsuites/sptests/sp05/task1.c
testsuites/sptests/sp05/task2.c
testsuites/sptests/sp05/task3.c
testsuites/sptests/sp06/init.c
testsuites/sptests/sp06/sp06.doc
testsuites/sptests/sp06/sp06.scn
testsuites/sptests/sp06/system.h
testsuites/sptests/sp06/task1.c
testsuites/sptests/sp06/task2.c
testsuites/sptests/sp06/task3.c
testsuites/sptests/sp07/init.c
testsuites/sptests/sp07/sp07.doc
testsuites/sptests/sp07/sp07.scn
testsuites/sptests/sp07/system.h
testsuites/sptests/sp07/task1.c
testsuites/sptests/sp07/task2.c
testsuites/sptests/sp07/task3.c
testsuites/sptests/sp07/task4.c
testsuites/sptests/sp07/taskexit.c
testsuites/sptests/sp07/tcreate.c
testsuites/sptests/sp07/tdelete.c
testsuites/sptests/sp07/trestart.c
testsuites/sptests/sp07/tstart.c
testsuites/sptests/sp08/init.c
testsuites/sptests/sp08/sp08.doc
testsuites/sptests/sp08/sp08.scn
testsuites/sptests/sp08/system.h
testsuites/sptests/sp08/task1.c
testsuites/sptests/sp09/delay.c
testsuites/sptests/sp09/init.c
testsuites/sptests/sp09/isr.c
testsuites/sptests/sp09/screen01.c
testsuites/sptests/sp09/screen02.c
testsuites/sptests/sp09/screen03.c
testsuites/sptests/sp09/screen04.c
testsuites/sptests/sp09/screen05.c
testsuites/sptests/sp09/screen06.c
testsuites/sptests/sp09/screen07.c
testsuites/sptests/sp09/screen08.c
testsuites/sptests/sp09/screen09.c
testsuites/sptests/sp09/screen10.c
testsuites/sptests/sp09/screen11.c
testsuites/sptests/sp09/screen12.c
testsuites/sptests/sp09/screen13.c
testsuites/sptests/sp09/screen14.c
testsuites/sptests/sp09/sp09.doc
testsuites/sptests/sp09/sp09.scn
testsuites/sptests/sp09/system.h
testsuites/sptests/sp09/task1.c
testsuites/sptests/sp09/task2.c
testsuites/sptests/sp09/task3.c
testsuites/sptests/sp09/task4.c
testsuites/sptests/sp11/init.c
testsuites/sptests/sp11/sp11.doc
testsuites/sptests/sp11/sp11.scn
testsuites/sptests/sp11/system.h
testsuites/sptests/sp11/task1.c
testsuites/sptests/sp11/task2.c
testsuites/sptests/sp11/timer.c
testsuites/sptests/sp12/init.c
testsuites/sptests/sp12/pridrv.c
testsuites/sptests/sp12/pritask.c
testsuites/sptests/sp12/sp12.doc
testsuites/sptests/sp12/sp12.scn
testsuites/sptests/sp12/system.h
testsuites/sptests/sp12/task1.c
testsuites/sptests/sp12/task2.c
testsuites/sptests/sp12/task3.c
testsuites/sptests/sp12/task4.c
testsuites/sptests/sp12/task5.c
testsuites/sptests/sp13/fillbuff.c
testsuites/sptests/sp13/init.c
testsuites/sptests/sp13/putbuff.c
testsuites/sptests/sp13/sp13.doc
testsuites/sptests/sp13/sp13.scn
testsuites/sptests/sp13/system.h
testsuites/sptests/sp13/task1.c
testsuites/sptests/sp13/task2.c
testsuites/sptests/sp13/task3.c
testsuites/sptests/sp14/asr.c
testsuites/sptests/sp14/init.c
testsuites/sptests/sp14/sp14.doc
testsuites/sptests/sp14/sp14.scn
testsuites/sptests/sp14/system.h
testsuites/sptests/sp14/task1.c
testsuites/sptests/sp14/task2.c
testsuites/sptests/sp15/init.c
testsuites/sptests/sp15/sp15.doc
testsuites/sptests/sp15/sp15.scn
testsuites/sptests/sp15/system.h
testsuites/sptests/sp15/task1.c
testsuites/sptests/sp16/init.c
testsuites/sptests/sp16/sp16.doc
testsuites/sptests/sp16/sp16.scn
testsuites/sptests/sp16/system.h
testsuites/sptests/sp16/task1.c
testsuites/sptests/sp16/task2.c
testsuites/sptests/sp16/task3.c
testsuites/sptests/sp16/task4.c
testsuites/sptests/sp16/task5.c
testsuites/sptests/sp17/asr.c
testsuites/sptests/sp17/init.c
testsuites/sptests/sp17/sp17.doc
testsuites/sptests/sp17/sp17.scn
testsuites/sptests/sp17/system.h
testsuites/sptests/sp17/task1.c
testsuites/sptests/sp17/task2.c
testsuites/sptests/sp19/first.c
testsuites/sptests/sp19/fptask.c
testsuites/sptests/sp19/fptest.h
testsuites/sptests/sp19/init.c
testsuites/sptests/sp19/inttest.h
testsuites/sptests/sp19/sp19.doc
testsuites/sptests/sp19/sp19.scn
testsuites/sptests/sp19/system.h
testsuites/sptests/sp19/task1.c
testsuites/sptests/sp20/getall.c
testsuites/sptests/sp20/init.c
testsuites/sptests/sp20/sp20.doc
testsuites/sptests/sp20/sp20.scn
testsuites/sptests/sp20/system.h
testsuites/sptests/sp20/task1.c
testsuites/sptests/sp21/init.c
testsuites/sptests/sp21/sp21.doc
testsuites/sptests/sp21/sp21.scn
testsuites/sptests/sp21/system.h
testsuites/sptests/sp21/task1.c
testsuites/sptests/sp22/delay.c
testsuites/sptests/sp22/init.c
testsuites/sptests/sp22/prtime.c
testsuites/sptests/sp22/sp22.doc
testsuites/sptests/sp22/sp22.scn
testsuites/sptests/sp22/system.h
testsuites/sptests/sp22/task1.c
testsuites/sptests/sp23/init.c
testsuites/sptests/sp23/sp23.doc
testsuites/sptests/sp23/sp23.scn
testsuites/sptests/sp23/system.h
testsuites/sptests/sp23/task1.c
testsuites/sptests/sp24/init.c
testsuites/sptests/sp24/resume.c
testsuites/sptests/sp24/sp24.doc
testsuites/sptests/sp24/sp24.scn
testsuites/sptests/sp24/system.h
testsuites/sptests/sp24/task1.c
testsuites/sptests/sp25/init.c
testsuites/sptests/sp25/sp25.doc
testsuites/sptests/sp25/sp25.scn
testsuites/sptests/sp25/system.h
testsuites/sptests/sp25/task1.c
testsuites/sptests/spfatal/fatal.c
testsuites/sptests/spfatal/init.c
testsuites/sptests/spfatal/puterr.c
testsuites/sptests/spfatal/spfatal.doc
testsuites/sptests/spfatal/spfatal.scn
testsuites/sptests/spfatal/system.h
testsuites/sptests/spfatal/task1.c
testsuites/sptests/spsize/getint.c
testsuites/sptests/spsize/init.c
testsuites/sptests/spsize/size.c
testsuites/sptests/spsize/system.h
testsuites/support/include/tmacros.h
testsuites/tmtests/README
testsuites/tmtests/include/timesys.h
testsuites/tmtests/tm01/system.h
testsuites/tmtests/tm01/task1.c
testsuites/tmtests/tm01/tm01.doc
testsuites/tmtests/tm02/system.h
testsuites/tmtests/tm02/task1.c
testsuites/tmtests/tm02/tm02.doc
testsuites/tmtests/tm03/system.h
testsuites/tmtests/tm03/task1.c
testsuites/tmtests/tm03/tm03.doc
testsuites/tmtests/tm04/system.h
testsuites/tmtests/tm04/task1.c
testsuites/tmtests/tm04/tm04.doc
testsuites/tmtests/tm05/system.h
testsuites/tmtests/tm05/task1.c
testsuites/tmtests/tm05/tm05.doc
testsuites/tmtests/tm06/system.h
testsuites/tmtests/tm06/task1.c
testsuites/tmtests/tm06/tm06.doc
testsuites/tmtests/tm07/system.h
testsuites/tmtests/tm07/task1.c
testsuites/tmtests/tm07/tm07.doc
testsuites/tmtests/tm08/system.h
testsuites/tmtests/tm08/task1.c
testsuites/tmtests/tm08/tm08.doc
testsuites/tmtests/tm09/system.h
testsuites/tmtests/tm09/task1.c
testsuites/tmtests/tm09/tm09.doc
testsuites/tmtests/tm10/system.h
testsuites/tmtests/tm10/task1.c
testsuites/tmtests/tm10/tm10.doc
testsuites/tmtests/tm11/system.h
testsuites/tmtests/tm11/task1.c
testsuites/tmtests/tm11/tm11.doc
testsuites/tmtests/tm12/system.h
testsuites/tmtests/tm12/task1.c
testsuites/tmtests/tm12/tm12.doc
testsuites/tmtests/tm13/system.h
testsuites/tmtests/tm13/task1.c
testsuites/tmtests/tm13/tm13.doc
testsuites/tmtests/tm14/system.h
testsuites/tmtests/tm14/task1.c
testsuites/tmtests/tm14/tm14.doc
testsuites/tmtests/tm15/system.h
testsuites/tmtests/tm15/task1.c
testsuites/tmtests/tm15/tm15.doc
testsuites/tmtests/tm16/system.h
testsuites/tmtests/tm16/task1.c
testsuites/tmtests/tm16/tm16.doc
testsuites/tmtests/tm17/system.h
testsuites/tmtests/tm17/task1.c
testsuites/tmtests/tm17/tm17.doc
testsuites/tmtests/tm18/system.h
testsuites/tmtests/tm18/task1.c
testsuites/tmtests/tm18/tm18.doc
testsuites/tmtests/tm19/system.h
testsuites/tmtests/tm19/task1.c
testsuites/tmtests/tm19/tm19.doc
testsuites/tmtests/tm20/system.h
testsuites/tmtests/tm20/task1.c
testsuites/tmtests/tm20/tm20.doc
testsuites/tmtests/tm21/system.h
testsuites/tmtests/tm21/task1.c
testsuites/tmtests/tm21/tm21.doc
testsuites/tmtests/tm22/system.h
testsuites/tmtests/tm22/task1.c
testsuites/tmtests/tm22/tm22.doc
testsuites/tmtests/tm23/system.h
testsuites/tmtests/tm23/task1.c
testsuites/tmtests/tm23/tm23.doc
testsuites/tmtests/tm24/system.h
testsuites/tmtests/tm24/task1.c
testsuites/tmtests/tm24/tm24.doc
testsuites/tmtests/tm25/system.h
testsuites/tmtests/tm25/task1.c
testsuites/tmtests/tm25/tm25.doc
testsuites/tmtests/tm26/fptest.h
testsuites/tmtests/tm26/system.h
testsuites/tmtests/tm26/task1.c
testsuites/tmtests/tm26/tm26.doc
testsuites/tmtests/tm27/system.h
testsuites/tmtests/tm27/task1.c
testsuites/tmtests/tm27/tm27.doc
testsuites/tmtests/tm28/system.h
testsuites/tmtests/tm28/task1.c
testsuites/tmtests/tm28/tm28.doc
testsuites/tmtests/tm29/system.h
testsuites/tmtests/tm29/task1.c
testsuites/tmtests/tm29/tm29.doc
testsuites/tmtests/tmck/system.h
testsuites/tmtests/tmck/task1.c
testsuites/tmtests/tmck/tmck.doc
testsuites/tmtests/tmoverhd/dumrtems.h
testsuites/tmtests/tmoverhd/empty.c
testsuites/tmtests/tmoverhd/system.h
testsuites/tmtests/tmoverhd/testtask.c
testsuites/tmtests/tmoverhd/tmoverhd.doc
tools/build/README
tools/build/cklength.c
tools/build/eolstrip.c
tools/build/os/msdos/README
tools/build/os/msdos/cklength.uue
tools/build/os/msdos/fixtimer.c
tools/build/os/msdos/fixtimer.uue
tools/build/os/msdos/ifc.c
tools/build/os/msdos/ifc_exe.uue
tools/build/packhex.c
tools/build/scripts/README
tools/build/src/cklength.c
tools/build/src/eolstrip.c
tools/build/src/packhex.c
tools/build/src/unhex.c
tools/build/unhex.c
tools/cpu/hppa1.1/genoffsets.c
tools/cpu/unix/gensize.c
tools/update/310_to_320_list
tools/update/README
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r-- | cpukit/posix/src/adasupp.c | 28 | ||||
-rw-r--r-- | cpukit/posix/src/aio.c | 111 | ||||
-rw-r--r-- | cpukit/posix/src/cancel.c | 228 | ||||
-rw-r--r-- | cpukit/posix/src/cond.c | 497 | ||||
-rw-r--r-- | cpukit/posix/src/devctl.c | 22 | ||||
-rw-r--r-- | cpukit/posix/src/intr.c | 340 | ||||
-rw-r--r-- | cpukit/posix/src/key.c | 262 | ||||
-rw-r--r-- | cpukit/posix/src/mqueue.c | 710 | ||||
-rw-r--r-- | cpukit/posix/src/mutex.c | 683 | ||||
-rw-r--r-- | cpukit/posix/src/psignal.c | 1347 | ||||
-rw-r--r-- | cpukit/posix/src/pthread.c | 1305 | ||||
-rw-r--r-- | cpukit/posix/src/ptimer.c | 75 | ||||
-rw-r--r-- | cpukit/posix/src/sched.c | 153 | ||||
-rw-r--r-- | cpukit/posix/src/semaphore.c | 571 | ||||
-rw-r--r-- | cpukit/posix/src/time.c | 390 | ||||
-rw-r--r-- | cpukit/posix/src/types.c | 222 |
16 files changed, 0 insertions, 6944 deletions
diff --git a/cpukit/posix/src/adasupp.c b/cpukit/posix/src/adasupp.c deleted file mode 100644 index 234b0c2a40..0000000000 --- a/cpukit/posix/src/adasupp.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> - -#include <rtems/system.h> -#include <rtems/posix/pthread.h> - -/*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/cpukit/posix/src/aio.c b/cpukit/posix/src/aio.c deleted file mode 100644 index 9fc072f820..0000000000 --- a/cpukit/posix/src/aio.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * $Id$ - */ - -#include <aio.h> - -#include <rtems/system.h> - -/*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/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c deleted file mode 100644 index b6cc073456..0000000000 --- a/cpukit/posix/src/cancel.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * $Id$ - */ - -#include <pthread.h> -#include <errno.h> - -#include <rtems/system.h> -#include <rtems/score/chain.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> -#include <rtems/posix/cancel.h> -#include <rtems/posix/pthread.h> -#include <rtems/posix/threadsup.h> - -/*PAGE - * - * POSIX_Thread_cancel_run - * - */ - -void POSIX_Thread_cancel_run( - Thread_Control *the_thread -) -{ - int old_cancel_state; - POSIX_Cancel_Handler_control *handler; - Chain_Control *handler_stack; - POSIX_API_Thread_Support_Control *thread_support; - ISR_Level level; - - thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; - - handler_stack = &thread_support->Cancellation_Handlers; - - old_cancel_state = thread_support->cancelability_state; - - 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 ); - } - - thread_support->cancelation_requested = 0; - - thread_support->cancelability_state = old_cancel_state; -} - -/*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_Thread_Support_Control *thread_support; - Objects_Locations location; - - 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; - - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -int pthread_setcancelstate( - int state, - int *oldstate -) -{ - POSIX_API_Thread_Support_Control *thread_support; - - if ( !oldstate ) - return EINVAL; - - if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) - return EINVAL; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - *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_Thread_cancel_run( _Thread_Executing ); - - return 0; -} - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -int pthread_setcanceltype( - int type, - int *oldtype -) -{ - POSIX_API_Thread_Support_Control *thread_support; - - if ( !oldtype ) - return EINVAL; - - if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) - return EINVAL; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - *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_Thread_cancel_run( _Thread_Executing ); - - return 0; -} - -/*PAGE - * - * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 - */ - -void pthread_testcancel( void ) -{ - POSIX_API_Thread_Support_Control *thread_support; - - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelation_requested ) - POSIX_Thread_cancel_run( _Thread_Executing ); -} - -/*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_Thread_Support_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 ); -} - -/*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_Thread_Support_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/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c deleted file mode 100644 index c480422f19..0000000000 --- a/cpukit/posix/src/cond.c +++ /dev/null @@ -1,497 +0,0 @@ -/* - * $Id$ - */ - -#include <pthread.h> -#include <errno.h> - -#include <rtems/system.h> -#include <rtems/score/object.h> -#include <rtems/score/states.h> -#include <rtems/score/watchdog.h> -#include <rtems/posix/cond.h> -#include <rtems/posix/time.h> -#include <rtems/posix/mutex.h> - -/* - * TEMPORARY - */ - -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(); -} - -/* - * END OF TEMPORARY - */ - -/*PAGE - * - * The default condition variable attributes structure. - */ - -const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = { - TRUE, /* is_initialized */ - PTHREAD_PROCESS_PRIVATE /* process_shared */ -}; - -/*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, - OBJECTS_POSIX_CONDITION_VARIABLES, - TRUE, - maximum_condition_variables, - sizeof( POSIX_Condition_variables_Control ), - FALSE, - 0, - FALSE - ); -} - -/*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; -} - -/*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; -} - -/*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; -} - -/*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; - } -} - -/*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 ( 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; - } - - 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, - OBJECTS_POSIX_CONDITION_VARIABLES, - THREAD_QUEUE_DISCIPLINE_FIFO, - STATES_WAITING_FOR_CONDITION_VARIABLE, - _POSIX_Condition_variables_MP_Send_extract_proxy, - ETIMEDOUT - ); - - _Objects_Open( - &_POSIX_Condition_variables_Information, - &the_cond->Object, - 0 - ); - - *cond = the_cond->Object.id; - - 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 */ - ); - - _Thread_Enable_dispatch(); - - return 0; -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - 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 ( 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 */ - ); - } - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - 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(); -} - -/*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 ); -} - -/*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 ); -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - 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 - status = ETIMEDOUT; - - mutex_status = pthread_mutex_lock( mutex ); - if ( mutex_status ) - return EINVAL; - - return status; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 - ); -} - -/*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/cpukit/posix/src/devctl.c b/cpukit/posix/src/devctl.c deleted file mode 100644 index 699bc2d228..0000000000 --- a/cpukit/posix/src/devctl.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * $Id$ - */ - -#include <devctl.h> - -#include <rtems/system.h> - -/*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/cpukit/posix/src/intr.c b/cpukit/posix/src/intr.c deleted file mode 100644 index 5d41a5fe52..0000000000 --- a/cpukit/posix/src/intr.c +++ /dev/null @@ -1,340 +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$ - */ - -#include <errno.h> -#include <intr.h> -#include <pthread.h> - -#include <rtems/system.h> -#include <rtems/score/isr.h> -#include <rtems/score/coresem.h> -#include <rtems/score/thread.h> -#include <rtems/score/watchdog.h> -#include <rtems/posix/intr.h> -#include <rtems/posix/time.h> -#include <rtems/posix/threadsup.h> - -/* - * _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, - OBJECTS_POSIX_INTERRUPTS, - FALSE, - maximum_interrupt_handlers, - sizeof( POSIX_Interrupt_Handler_control ), - FALSE, - 0, - FALSE - ); - - 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/cpukit/posix/src/key.c b/cpukit/posix/src/key.c deleted file mode 100644 index 1203343f66..0000000000 --- a/cpukit/posix/src/key.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * $Id$ - */ - -#include <errno.h> -#include <limits.h> -#include <pthread.h> -#include <string.h> - -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> -#include <rtems/posix/key.h> - -/* - * _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, - OBJECTS_POSIX_KEYS, - FALSE, - maximum_keys, - sizeof( POSIX_Keys_Control ), - FALSE, - 0, - FALSE - ); -} - -/*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_class; - unsigned32 bytes_to_allocate; - - - _Thread_Disable_dispatch(); - - the_key = _POSIX_Keys_Allocate(); - - if ( !the_key ) { - _Thread_Enable_dispatch(); - return EAGAIN; - } - - the_key->destructor = destructor; - - for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; - the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; - the_class++ ) { - - bytes_to_allocate = - (_Objects_Information_table[ the_class ]->maximum + 1) * sizeof( void * ); - - table = _Workspace_Allocate( bytes_to_allocate ); - - if ( !table ) { - for ( --the_class; - the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS; - the_class-- ) - _Workspace_Free( the_key->Values[ the_class ] ); - - _POSIX_Keys_Free( the_key ); - _Thread_Enable_dispatch(); - return ENOMEM; - } - - the_key->Values[ the_class ] = table; - memset( table, '\0', bytes_to_allocate ); - } - - the_key->is_active = TRUE; - - _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 ); - - *key = the_key->Object.id; - - _Thread_Enable_dispatch(); - - return 0; -} - -/*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(); -} - -/*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(); -} - -/*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_class; - - 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_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; - the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; - the_class++ ) - _Workspace_Free( the_key->Values[ the_class ] ); - - /* - * 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(); -} - -/*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/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c deleted file mode 100644 index 82da4ee706..0000000000 --- a/cpukit/posix/src/mqueue.c +++ /dev/null @@ -1,710 +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$ - */ - -#include <stdarg.h> - -#include <pthread.h> -#include <limits.h> -#include <errno.h> -#include <fcntl.h> -#include <mqueue.h> - -#include <rtems/system.h> -#include <rtems/score/watchdog.h> -#include <rtems/posix/seterr.h> -#include <rtems/posix/mqueue.h> -#include <rtems/posix/time.h> - -/*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, - OBJECTS_POSIX_MESSAGE_QUEUES, - TRUE, - maximum_message_queues, - sizeof( POSIX_Message_queue_Control ), - TRUE, - _POSIX_PATH_MAX, - FALSE - ); -} - -/*PAGE - * - * _POSIX_Message_queue_Create_support - */ - -int _POSIX_Message_queue_Create_support( - const char *name, - int pshared, - unsigned int oflag, - struct mq_attr *attr, - POSIX_Message_queue_Control **message_queue -) -{ - POSIX_Message_queue_Control *the_mq; - - _Thread_Disable_dispatch(); - - the_mq = _POSIX_Message_queue_Allocate(); - - if ( !the_mq ) { - _Thread_Enable_dispatch(); - set_errno_and_return_minus_one( ENFILE ); - } - - 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(); - set_errno_and_return_minus_one( ENFILE ); - } - - the_mq->process_shared = pshared; - - if ( name ) { - the_mq->named = TRUE; - the_mq->open_count = 1; - the_mq->linked = TRUE; - } - else - the_mq->named = FALSE; - - if ( oflag & O_NONBLOCK ) - the_mq->blocking = FALSE; - else - the_mq->blocking = TRUE; - - /* XXX - * - * Note that this should be based on the current scheduling policy. - */ - - /* XXX - * - * Message and waiting disciplines are not distinguished. - */ -/* - the_mq_attr->message_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; - the_mq_attr->waiting_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; - */ - - the_mq->Message_queue.Attributes.discipline = - CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; - - if ( ! _CORE_message_queue_Initialize( - &the_mq->Message_queue, - OBJECTS_POSIX_MESSAGE_QUEUES, - &the_mq->Message_queue.Attributes, - attr->mq_maxmsg, - attr->mq_msgsize, - _POSIX_Message_queue_MP_Send_extract_proxy ) ) { - - if ( pshared == PTHREAD_PROCESS_SHARED ) - _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id ); - - _POSIX_Message_queue_Free( the_mq ); - _Thread_Enable_dispatch(); - set_errno_and_return_minus_one( ENOSPC ); - } - - - /* XXX - need Names to be a string!!! */ - _Objects_Open( - &_POSIX_Message_queue_Information, - &the_mq->Object, - (char *) name - ); - - *message_queue = the_mq; - - 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 */ - ); - - _Thread_Enable_dispatch(); - return 0; -} - -/*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; - int status; - Objects_Id the_mq_id; - POSIX_Message_queue_Control *the_mq; - - if ( oflag & O_CREAT ) { - va_start(arg, oflag); - mode = (mode_t) va_arg( arg, mode_t * ); - attr = (struct mq_attr *) va_arg( arg, struct mq_attr ** ); - va_end(arg); - } - - 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 ) { - - if ( status == EINVAL ) { /* name -> ID translation failed */ - if ( !(oflag & O_CREAT) ) { /* willing to create it? */ - seterrno( ENOENT ); - return (mqd_t) -1; - } - /* we are willing to create it */ - } - seterrno( status ); /* some type of error */ - return (mqd_t) -1; - - } else { /* name -> ID translation succeeded */ - - if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { - seterrno( EEXIST ); - return (mqd_t) -1; - } - - /* - * XXX In this case we need to do an ID->pointer conversion to - * check the mode. This is probably a good place for a subroutine. - */ - - the_mq->open_count += 1; - - return (mqd_t)&the_mq->Object.id; - - } - - /* XXX verify this comment... - * - * 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 */ - oflag, - attr, - &the_mq - ); - - if ( status == -1 ) - return (mqd_t) -1; - - return (mqd_t) &the_mq->Object.id; -} - -/*PAGE - * - * _POSIX_Message_queue_Delete - */ - -void _POSIX_Message_queue_Delete( - POSIX_Message_queue_Control *the_mq -) -{ - if ( !the_mq->linked && !the_mq->open_count ) { - _POSIX_Message_queue_Free( the_mq ); - - 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 */ - ); - } - - } -} - -/*PAGE - * - * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275 - */ - -int mq_close( - mqd_t mqdes -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - the_mq->open_count -= 1; - _POSIX_Message_queue_Delete( the_mq ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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; - Objects_Locations location; - - status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); - - if ( !status ) - set_errno_and_return_minus_one( status ); - - the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - - _Objects_MP_Close( - &_POSIX_Message_queue_Information, - the_mq->Object.id - ); - - the_mq->linked = FALSE; - - _POSIX_Message_queue_Delete( the_mq ); - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * _POSIX_Message_queue_Send_support - */ - -int _POSIX_Message_queue_Send_support( - mqd_t mqdes, - const char *msg_ptr, - unsigned32 msg_len, - Priority_Control msg_prio, - Watchdog_Interval timeout -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - /* XXX must add support for timeout and priority */ - _CORE_message_queue_Send( - &the_mq->Message_queue, - (void *) msg_ptr, - msg_len, - mqdes, - NULL /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/ - ); - _Thread_Enable_dispatch(); - return _Thread_Executing->Wait.return_code; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 - ); -} - -/*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 ) - ); -} - -/*PAGE - * - * _POSIX_Message_queue_Receive_support - */ - -/* XXX be careful ... watch the size going through all 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 -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - unsigned32 status = 0; - unsigned32 length_out; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - /* XXX need to define the options argument to this */ - length_out = msg_len; - _CORE_message_queue_Seize( - &the_mq->Message_queue, - mqdes, - msg_ptr, - &length_out, - /* msg_prio, XXXX */ - the_mq->blocking, - timeout - ); - _Thread_Enable_dispatch(); - if ( !status ) - return length_out; - /* XXX --- the return codes gotta be looked at .. fix this */ - return _Thread_Executing->Wait.return_code; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 - ); -} - -/*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 ) - ); -} - -/*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; - - /* XXX do something with signals here!!!! */ -} - -/*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 -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EBADF ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - if ( notification ) { - if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { - _Thread_Enable_dispatch(); - seterrno( EBUSY ); - return( -1 ); - } - - _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(); -} - -/*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 -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - CORE_message_queue_Attributes *the_mq_attr; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - /* - * Return the old values. - */ - - /* XXX this is the same stuff as is in mq_getattr... and probably */ - /* XXX should be in an inlined private routine */ - - the_mq_attr = &the_mq->Message_queue.Attributes; - - omqstat->mq_flags = the_mq->flags; - omqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size; - omqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages; - omqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages; - - /* - * Ignore everything except the O_NONBLOCK bit. - */ - - if ( mqstat->mq_flags & O_NONBLOCK ) - the_mq->blocking = FALSE; - else - the_mq->blocking = TRUE; - - the_mq->flags = mqstat->mq_flags; - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283 - */ - -int mq_getattr( - mqd_t mqdes, - struct mq_attr *mqstat -) -{ - register POSIX_Message_queue_Control *the_mq; - Objects_Locations location; - CORE_message_queue_Attributes *the_mq_attr; - - the_mq = _POSIX_Message_queue_Get( mqdes, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - /* - * Return the old values. - */ - - /* XXX this is the same stuff as is in mq_setattr... and probably */ - /* XXX should be in an inlined private routine */ - - the_mq_attr = &the_mq->Message_queue.Attributes; - - mqstat->mq_flags = the_mq->flags; - 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/cpukit/posix/src/mutex.c b/cpukit/posix/src/mutex.c deleted file mode 100644 index 037791a252..0000000000 --- a/cpukit/posix/src/mutex.c +++ /dev/null @@ -1,683 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> - -#include <rtems/system.h> -#include <rtems/score/coremutex.h> -#include <rtems/score/watchdog.h> -#include <rtems/score/mpci.h> -#include <rtems/posix/mutex.h> -#include <rtems/posix/priority.h> -#include <rtems/posix/time.h> - -/* - * TEMPORARY - */ - -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 */ -} - -/* - * END OF TEMPORARY - */ - -/*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 */ -}; - -/*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; -} - -/*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, - OBJECTS_POSIX_MUTEXES, - TRUE, - maximum_mutexes, - sizeof( POSIX_Mutex_Control ), - FALSE, - 0, - FALSE - ); -} - -/*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; -} - -/*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; -} - -/*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; -} - -/*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; - } -} - -/*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; - register POSIX_Mutex_Control *mutex_in_use; - Objects_Locations location; - - if ( attr ) the_attr = attr; - else the_attr = &_POSIX_Mutex_Default_attributes; - - /* Check for NULL mutex */ - - if ( !mutex ) - return EINVAL; - - /* EBUSY if *mutex is a valid id */ - - mutex_in_use = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_ERROR: - break; - case OBJECTS_REMOTE: - case OBJECTS_LOCAL: - _Thread_Enable_dispatch(); - return EBUSY; - }; - - if ( !the_attr->is_initialized ) - return EINVAL; - - /* - * XXX: Be careful about attributes when global!!! - */ - - assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE ); - - if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) - return POSIX_MP_NOT_IMPLEMENTED(); - - /* - * 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 ( 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; - } - - the_mutex->process_shared = the_attr->process_shared; - - the_mutex_attr = &the_mutex->Mutex.Attributes; - - the_mutex_attr->allow_nesting = the_attr->recursive; - 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, - OBJECTS_POSIX_MUTEXES, - the_mutex_attr, - CORE_MUTEX_UNLOCKED, - NULL /* proxy_extract_callout */ - ); - - _Objects_Open( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); - - *mutex = the_mutex->Object.id; - - 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 */ - ); - - _Thread_Enable_dispatch(); - return 0; -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - 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, - _POSIX_Mutex_MP_Send_object_was_deleted, - EINVAL - ); - - _POSIX_Mutex_Free( the_mutex ); - - 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 */ - ); - } - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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; - - the_mutex = _POSIX_Mutex_Get( mutex, &location ); - switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - return _POSIX_Mutex_MP_Send_request_packet( - POSIX_MUTEX_MP_OBTAIN_REQUEST, - *mutex, - 0, /* must define the option set */ - WATCHDOG_NO_TIMEOUT - ); - case OBJECTS_LOCAL: - _CORE_mutex_Seize( - &the_mutex->Mutex, - the_mutex->Object.id, - blocking, - timeout - ); - _Thread_Enable_dispatch(); - return _POSIX_Mutex_From_core_mutex_status( - (CORE_mutex_Status) _Thread_Executing->Wait.return_code - ); - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 ); -} - -/*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 ); -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - return _POSIX_Mutex_MP_Send_request_packet( - POSIX_MUTEX_MP_RELEASE_REQUEST, - *mutex, - 0, /* Not used */ - MPCI_DEFAULT_TIMEOUT - ); - case OBJECTS_LOCAL: - status = _CORE_mutex_Surrender( - &the_mutex->Mutex, - the_mutex->Object.id, - POSIX_Threads_mutex_MP_support - ); - _Thread_Enable_dispatch(); - return _POSIX_Mutex_From_core_mutex_status( status ); - break; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 ) - ); -} - -/*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; - } -} - -/*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; -} - -/*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; -} - -/*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; -} - -/*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_ERROR: - return EINVAL; /* impossible to get here */ - case OBJECTS_REMOTE: - /* XXX It feels questionable to set the ceiling on a remote mutex. */ - return EINVAL; - 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, - POSIX_Threads_mutex_MP_support - ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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_ERROR: - return EINVAL; - case OBJECTS_REMOTE: - return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */ - 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/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c deleted file mode 100644 index 289c9f02d5..0000000000 --- a/cpukit/posix/src/psignal.c +++ /dev/null @@ -1,1347 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> -#include <signal.h> - -#include <rtems/system.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> -#include <rtems/score/tqdata.h> -#include <rtems/score/wkspace.h> -#include <rtems/posix/seterr.h> -#include <rtems/posix/threadsup.h> -#include <rtems/posix/pthread.h> -#include <rtems/posix/time.h> - -/* - * 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_Abormal_termination_handler( int signo ) -{ - exit( 1 ); -} - -#define _POSIX_signals_Stop_handler NULL -#define _POSIX_signals_Continue_handler NULL - -#define SIGACTION_TERMINATE \ - { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abormal_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) -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_IGNORE, - /* SIGRT 19 */ SIGACTION_IGNORE, - /* SIGRT 20 */ SIGACTION_IGNORE, - /* SIGRT 21 */ SIGACTION_IGNORE, - /* SIGRT 22 */ SIGACTION_IGNORE, - /* SIGRT 23 */ SIGACTION_IGNORE, - /* SIGRT 24 */ SIGACTION_IGNORE, - /* SIGRT 25 */ SIGACTION_IGNORE, - /* SIGRT 26 */ SIGACTION_IGNORE, - /* SIGRT 27 */ SIGACTION_IGNORE, - /* SIGRT 28 */ SIGACTION_IGNORE, - /* SIGRT 29 */ SIGACTION_IGNORE, - /* SIGRT 30 */ SIGACTION_IGNORE, - /* SIGRT 31 */ SIGACTION_IGNORE, - /* SIGRTMAX 32 */ SIGACTION_IGNORE -}; - -struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; - -Watchdog_Control _POSIX_signals_Alarm_timer; - -Thread_queue_Control _POSIX_signals_Wait_queue; - -typedef struct { - Chain_Node Node; - siginfo_t Info; -} POSIX_signals_Siginfo_node; - -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)) - -/*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; - -} - -/*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 ); -} - -/*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 ); -} - -/*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; -} - - -/*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; - - 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; -} - -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 siginfo.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, - OBJECTS_NO_CLASS, - THREAD_QUEUE_DISCIPLINE_PRIORITY, - STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL, - NULL, - 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 ) - ); -} - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigemptyset( - sigset_t *set -) -{ - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - *set = 0; - return 0; -} - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigfillset( - sigset_t *set -) -{ - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - *set = SIGNAL_ALL_MASK; - return 0; -} - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigaddset( - sigset_t *set, - int signo -) -{ - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - set_errno_and_return_minus_one( EINVAL ); - - *set |= signo_to_mask(signo); - return 0; -} - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigdelset( - sigset_t *set, - int signo -) -{ - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - set_errno_and_return_minus_one( EINVAL ); - - *set &= ~signo_to_mask(signo); - return 0; -} - -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 - */ - -int sigismember( - const sigset_t *set, - int signo -) -{ - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - if ( !signo ) - return 0; - - if ( !is_valid_signo(signo) ) - set_errno_and_return_minus_one( EINVAL ); - - if ( *set & signo_to_mask(signo) ) - return 1; - - return 0; -} - -/* - * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70 - */ - -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) ) - 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 ) - 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; -} - -/* - * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 - * - * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). - * - */ - -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 ); -} - -/* - * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 - * - * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). - */ - -int pthread_sigmask( - int how, - const sigset_t *set, - sigset_t *oset -) -{ - POSIX_API_Control *api; - - if ( !set && !oset ) - 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: - 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; -} - -/* - * 3.3.6 Examine Pending Signals, P1003.1b-1993, p. 75 - */ - -int sigpending( - sigset_t *set -) -{ - POSIX_API_Control *api; - - if ( !set ) - set_errno_and_return_minus_one( EINVAL ); - - api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - - *set = api->signals_pending | _POSIX_signals_Pending; - - return 0; -} - -/* - * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75 - */ - -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; -} - -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). - */ - -int sigwaitinfo( - const sigset_t *set, - siginfo_t *info -) -{ - return sigtimedwait( set, info, NULL ); -} - -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). - */ - -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 siginfo.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; - - 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? */ - - 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 ); - 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 ); - - if ( !info ) { - the_info->si_signo = signo; - the_info->si_code = SI_USER; - the_info->si_value.sival_int = 0; - } - } - - interval = 0; - if ( timeout ) { - - if (timeout->tv_nsec < 0 || timeout->tv_nsec >= TOD_NANOSECONDS_PER_SECOND) - set_errno_and_return_minus_one( EINVAL ); - - interval = _POSIX_Timespec_to_interval( timeout ); - } - - 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 ); - _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); - _Thread_Enable_dispatch(); - - errno = _Thread_Executing->Wait.return_code; - return the_info->si_signo; -} - -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). - */ - -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; -} - -/*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_class; - 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() ) - set_errno_and_return_minus_one( ESRCH ); - - /* - * Validate the signal passed if not 0. - */ - - if ( sig && !is_valid_signo(sig) ) - 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_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; - the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; - the_class++ ) { - - if ( the_class == OBJECTS_INTERNAL_THREADS ) - continue; - - the_info = _Objects_Information_table[ the_class ]; - - 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 ) - set_errno_and_return_minus_one( EAGAIN ); - - psiginfo->Info = *siginfo; - - _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); - } - - _Thread_Enable_dispatch(); - return 0; -} - -/*PAGE - * - * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 - * - * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS. - */ - -int kill( - pid_t pid, - int sig -) -{ - return killinfo( pid, sig, NULL ); -} - -/* - * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 - */ - -int sigqueue( - pid_t pid, - int signo, - const union sigval value -) -{ - return killinfo( pid, signo, &value ); -} - -/* - * 3.3.10 Send a Signal to a Thread, P1003.1c/D10, p. 43 - */ - -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) ) - set_errno_and_return_minus_one( EINVAL ); - - if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) - set_errno_and_return_minus_one( ENOSYS ); - - /* - * RTEMS does not support sending a siginfo signal to a specific thread. - */ - - the_thread = _POSIX_Threads_Get( thread, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: - 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(); -} - -/* - * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79 - */ - -Watchdog_Control _POSIX_signals_Alarm_timer; - -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: - remaining = the_timer->initial - - (the_timer->stop_time - the_timer->start_time); - break; - } - - _Watchdog_Insert_seconds( the_timer, seconds ); - - return remaining; -} - -/* - * 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/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c deleted file mode 100644 index 5864c22072..0000000000 --- a/cpukit/posix/src/pthread.c +++ /dev/null @@ -1,1305 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> -#include <limits.h> - -#include <rtems/system.h> -#include <rtems/score/apiext.h> -#include <rtems/score/stack.h> -#include <rtems/score/thread.h> -#include <rtems/score/userext.h> -#include <rtems/score/wkspace.h> -#include <rtems/posix/pthread.h> -#include <rtems/posix/priority.h> -#include <rtems/posix/psignal.h> -#include <rtems/posix/config.h> -#include <rtems/posix/key.h> -#include <rtems/posix/time.h> - -/*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 ); - - 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 ); -} - -/*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 ); - - /* - * 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_class( created->Object.id ) == OBJECTS_POSIX_THREADS ) { - executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - api->signals_blocked = api->signals_blocked; - } else - api->signals_blocked = 0xffffffff; - -/* XXX set signal parameters -- block all signals for non-posix threads */ - - _Thread_queue_Initialize( - &api->Join_List, - OBJECTS_NO_CLASS, /* only used for proxy operations */ - THREAD_QUEUE_DISCIPLINE_FIFO, - STATES_WAITING_FOR_JOIN_AT_EXIT, - NULL, /* no extract proxy handler */ - 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 ]; - - /* XXX run 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 ); -} - -/*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, PTHREAD_MINIMUM_STACK_SIZE * 2 ); - assert( !status ); - - status = pthread_create( - &thread_id, - &attr, - user_threads[ index ].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 }, - { _POSIX_Threads_Create_extension, /* create */ - NULL, /* start */ - NULL, /* restart */ - _POSIX_Threads_Delete_extension, /* delete */ - NULL, /* switch */ - NULL, /* begin */ - NULL, /* 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, - OBJECTS_POSIX_THREADS, - FALSE, /* does not support global */ - maximum_pthreads, - sizeof( Thread_Control ), - TRUE, - 5, /* length is arbitrary for now */ - TRUE /* this class is threads */ - ); - - /* - * 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. - */ - -} - -/*PAGE - * - * 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." - */ - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -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; - } -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -int pthread_attr_getscope( - const pthread_attr_t *attr, - int *contentionscope -) -{ - if ( !attr || !attr->is_initialized || !contentionscope ) - return EINVAL; - - *contentionscope = attr->contentionscope; - return 0; -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -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; - } -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -int pthread_attr_getinheritsched( - const pthread_attr_t *attr, - int *inheritsched -) -{ - if ( !attr || !attr->is_initialized || !inheritsched ) - return EINVAL; - - *inheritsched = attr->inheritsched; - return 0; -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -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; - } -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 - */ - -int pthread_attr_getschedpolicy( - const pthread_attr_t *attr, - int *policy -) -{ - if ( !attr || !attr->is_initialized || !policy ) - return EINVAL; - - *policy = attr->schedpolicy; - return 0; -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 - */ - -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; -} - -/*PAGE - * - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 - */ - -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; -} - -/*PAGE - * - * 13.5.2 Dynamic Thread Scheduling Parameters Access, - * P1003.1c/Draft 10, p. 124 - */ - -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 ]; - *policy = api->schedpolicy; - *param = api->schedparam; - param->sched_priority = - _POSIX_Priority_From_core( the_thread->current_priority ); - _Thread_Enable_dispatch(); - return 0; - } - - return POSIX_BOTTOM_REACHED(); - -} - -/*PAGE - * - * 13.5.2 Dynamic Thread Scheduling Parameters Access, - * P1003.1c/Draft 10, p. 124 - */ - -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 ); - break; - - case SCHED_SPORADIC: - api->ss_high_priority = api->schedparam.sched_priority; - _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); - break; - } - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -int pthread_attr_init( - pthread_attr_t *attr -) -{ - if ( !attr ) - return EINVAL; - - *attr = _POSIX_Threads_Default_attributes; - return 0; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -int pthread_attr_destroy( - pthread_attr_t *attr -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - attr->is_initialized = FALSE; - return 0; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -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; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -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; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -int pthread_attr_getstackaddr( - const pthread_attr_t *attr, - void **stackaddr -) -{ - if ( !attr || !attr->is_initialized || !stackaddr ) - return EINVAL; - - *stackaddr = attr->stackaddr; - return 0; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -int pthread_attr_setstackaddr( - pthread_attr_t *attr, - void *stackaddr -) -{ - if ( !attr || !attr->is_initialized ) - return EINVAL; - - attr->stackaddr = stackaddr; - return 0; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -int pthread_attr_getdetachstate( - const pthread_attr_t *attr, - int *detachstate -) -{ - if ( !attr || !attr->is_initialized || !detachstate ) - return EINVAL; - - *detachstate = attr->detachstate; - return 0; -} - -/*PAGE - * - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 - */ - -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; - } -} - -/*PAGE - * - * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144 - */ - -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; - char *default_name = "psx"; - 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. - */ - - is_fp = CPU_HARDWARE_FP; - - /* - * 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 */ - &default_name /* 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 = 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; -} - -/*PAGE - * - * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147 - */ - -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(); -} - -/*PAGE - * - * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149 - */ - -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(); -} - -/*PAGE - * - * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150 - * - * NOTE: Key destructors are executed in the POSIX api delete extension. - */ - -void pthread_exit( - void *value_ptr -) -{ - _Thread_Disable_dispatch(); - - _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr; - - _Thread_Close( &_POSIX_Threads_Information, _Thread_Executing ); - - _POSIX_Threads_Free( _Thread_Executing ); - - _Thread_Enable_dispatch(); -} - -/*PAGE - * - * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152 - */ - -pthread_t pthread_self( void ) -{ - return _Thread_Executing->Object.id; -} - -/*PAGE - * - * 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. - */ - -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 -} - -/*PAGE - * - * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154 - */ - -int pthread_once( - pthread_once_t *once_control, - void (*init_routine)(void) -) -{ - if ( !once_control || !init_routine ) - return EINVAL; - - _Thread_Disable_dispatch(); - - if ( !once_control->init_executed ) { - once_control->is_initialized = TRUE; - once_control->init_executed = TRUE; - (*init_routine)(); - } - - _Thread_Enable_dispatch(); - return 0; -} - -/*PAGE - * - * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58 - */ - -int pthread_getcpuclockid( - pthread_t pid, - clockid_t *clock_id -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/*PAGE - * - * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 - */ - -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; - } -} - -/*PAGE - * - * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 - */ - -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/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c deleted file mode 100644 index 0446a7a683..0000000000 --- a/cpukit/posix/src/ptimer.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <time.h> -#include <errno.h> - -#include <rtems/system.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> -#include <rtems/score/tod.h> - -#include <rtems/posix/time.h> - -/* - * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 - */ - -int timer_create( - clockid_t clock_id, - struct sigevent *evp, - timer_t *timerid -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/* - * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 - */ - -int timer_delete( - timer_t timerid -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -int timer_settime( - timer_t timerid, - int flags, - const struct itimerspec *value, - struct itimerspec *ovalue -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -int timer_gettime( - timer_t timerid, - struct itimerspec *value -) -{ - return POSIX_NOT_IMPLEMENTED(); -} - -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - */ - -int timer_getoverrun( - timer_t timerid -) -{ - return POSIX_NOT_IMPLEMENTED(); -} diff --git a/cpukit/posix/src/sched.c b/cpukit/posix/src/sched.c deleted file mode 100644 index e558126926..0000000000 --- a/cpukit/posix/src/sched.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <sched.h> -#include <errno.h> - -#include <rtems/system.h> -#include <rtems/score/tod.h> -#include <rtems/score/thread.h> -#include <rtems/posix/seterr.h> -#include <rtems/posix/priority.h> -#include <rtems/posix/time.h> - -/*PAGE - * - * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 - * - */ - -int sched_setparam( - pid_t pid, - const struct sched_param *param -) -{ - 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 -) -{ - 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 -) -{ - 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 -) -{ - 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: - 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: - 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 != getpid() ) - set_errno_and_return_minus_one( ESRCH ); - - if ( !interval ) - 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/cpukit/posix/src/semaphore.c b/cpukit/posix/src/semaphore.c deleted file mode 100644 index a968abe43b..0000000000 --- a/cpukit/posix/src/semaphore.c +++ /dev/null @@ -1,571 +0,0 @@ -/* - * $Id$ - */ - -#include <stdarg.h> - -#include <errno.h> -#include <fcntl.h> -#include <pthread.h> -#include <semaphore.h> -#include <limits.h> - -#include <rtems/system.h> -#include <rtems/score/object.h> -#include <rtems/posix/semaphore.h> -#include <rtems/posix/time.h> - -/*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, - OBJECTS_POSIX_SEMAPHORES, - TRUE, - maximum_semaphores, - sizeof( POSIX_Semaphore_Control ), - TRUE, - _POSIX_PATH_MAX, - FALSE - ); -} - -/*PAGE - * - * _POSIX_Semaphore_Create_support - */ - -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(); - - the_semaphore = _POSIX_Semaphore_Allocate(); - - if ( !the_semaphore ) { - _Thread_Enable_dispatch(); - set_errno_and_return_minus_one( ENOMEM ); - } - - 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(); - set_errno_and_return_minus_one( EAGAIN ); - } - - 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; - - /* XXX - * - * Note should this be based on the current scheduling policy? - */ - - the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; - - _CORE_semaphore_Initialize( - &the_semaphore->Semaphore, - OBJECTS_POSIX_SEMAPHORES, - the_sem_attr, - value, - 0 /* XXX - proxy_extract_callout is unused */ - ); - - /* XXX - need Names to be a string!!! */ - _Objects_Open( - &_POSIX_Semaphore_Information, - &the_semaphore->Object, - (char *) name - ); - - *the_sem = the_semaphore; - - 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 */ - ); - - _Thread_Enable_dispatch(); - return 0; -} - - -/*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; - - status = _POSIX_Semaphore_Create_support( - NULL, - pshared, - value, - &the_semaphore - ); - - if ( status != -1 ) - *sem = the_semaphore->Object.id; - - return status; -} - -/*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: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - /* - * Undefined operation on a named semaphore. - */ - - if ( the_semaphore->named == TRUE ) { - seterrno( EINVAL ); - return( -1 ); - } - - _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); - - _CORE_semaphore_Flush( - &the_semaphore->Semaphore, - _POSIX_Semaphore_MP_Send_object_was_deleted, - -1 /* XXX should also seterrno -> EINVAL */ - ); - - _POSIX_Semaphore_Free( the_semaphore ); - - 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 */ - ); - } - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * 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; - int status; - Objects_Id the_semaphore_id; - POSIX_Semaphore_Control *the_semaphore; - - - if ( oflag & O_CREAT ) { - va_start(arg, oflag); - mode = (mode_t) va_arg( arg, mode_t * ); - value = (unsigned int) 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 ) { - - if ( status == EINVAL ) { /* name -> ID translation failed */ - if ( !(oflag & O_CREAT) ) { /* willing to create it? */ - seterrno( ENOENT ); - return (sem_t *) -1; - } - /* we are willing to create it */ - } - seterrno( status ); /* some type of error */ - return (sem_t *) -1; - - } else { /* name -> ID translation succeeded */ - - if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { - seterrno( EEXIST ); - return (sem_t *) -1; - } - - /* - * XXX In this case we need to do an ID->pointer conversion to - * check the mode. This is probably a good place for a subroutine. - */ - - the_semaphore->open_count += 1; - - return (sem_t *)&the_semaphore->Object.id; - - } - - /* XXX verify this comment... - * - * 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, - TRUE, /* shared across processes */ - value, - &the_semaphore - ); - - if ( status == -1 ) - return (sem_t *) -1; - - return (sem_t *) &the_semaphore->Object.id; - -} - -/*PAGE - * - * _POSIX_Semaphore_Delete - */ - -void _POSIX_Semaphore_Delete( - POSIX_Semaphore_Control *the_semaphore -) -{ - if ( !the_semaphore->linked && !the_semaphore->open_count ) { - _POSIX_Semaphore_Free( the_semaphore ); - - 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 */ - ); - } - - } -} - -/*PAGE - * - * 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: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - the_semaphore->open_count -= 1; - _POSIX_Semaphore_Delete( the_semaphore ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*PAGE - * - * 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; - Objects_Id the_semaphore_id; - Objects_Locations location; - - status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); - - if ( !status ) - set_errno_and_return_minus_one( status ); - - the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); - switch ( location ) { - case OBJECTS_ERROR: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - - if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { - _Objects_MP_Close( - &_POSIX_Semaphore_Information, - the_semaphore->Object.id - ); - } - - the_semaphore->linked = FALSE; - - _POSIX_Semaphore_Delete( the_semaphore ); - - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - _CORE_semaphore_Seize( - &the_semaphore->Semaphore, - the_semaphore->Object.id, - blocking, - timeout - ); - _Thread_Enable_dispatch(); - return _Thread_Executing->Wait.return_code; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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 ); -} - -/*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 ); -} - -/*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 ) - ); -} - -/*PAGE - * - * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 - */ - -void POSIX_Semaphore_MP_support( - Thread_Control *the_thread, - Objects_Id id -) -{ - (void) POSIX_MP_NOT_IMPLEMENTED(); -} - - -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: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - _CORE_semaphore_Surrender( - &the_semaphore->Semaphore, - the_semaphore->Object.id, - POSIX_Semaphore_MP_support - ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} - -/*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: - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return POSIX_MP_NOT_IMPLEMENTED(); - seterrno( EINVAL ); - return( -1 ); - case OBJECTS_LOCAL: - *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore ); - _Thread_Enable_dispatch(); - return 0; - } - return POSIX_BOTTOM_REACHED(); -} diff --git a/cpukit/posix/src/time.c b/cpukit/posix/src/time.c deleted file mode 100644 index f184f200e8..0000000000 --- a/cpukit/posix/src/time.c +++ /dev/null @@ -1,390 +0,0 @@ -/* - * $Id$ - */ - -#include <assert.h> -#include <time.h> -#include <errno.h> - -#include <rtems/system.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> -#include <rtems/score/tod.h> - -#include <rtems/posix/seterr.h> -#include <rtems/posix/time.h> - -/*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; -} - -/*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; - - return ticks; -} - -/*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; -} - -/*PAGE - * - * 4.5.1 Get System Time, P1003.1b-1993, p. 91 - */ - -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; -} - -/*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 ) ) - 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: - set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} - -/*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 ) - 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: - set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} - -/*PAGE - * - * 14.2.1 Clocks, P1003.1b-1993, p. 263 - */ - -int clock_getres( - clockid_t clock_id, - struct timespec *res -) -{ - if ( !res ) - 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 ) - _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res ); - break; - - default: - set_errno_and_return_minus_one( EINVAL ); - - } - return 0; -} - -/*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 ) - 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 ) - set_errno_and_return_minus_one( EAGAIN ); - - if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) - 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_Yield_processor(); - _Thread_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 ) - set_errno_and_return_minus_one( EINTR ); - } - - return 0; -} - -/*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(); -} - -/*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(); -} - -/*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/cpukit/posix/src/types.c b/cpukit/posix/src/types.c deleted file mode 100644 index 6bea1127b6..0000000000 --- a/cpukit/posix/src/types.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Id$ - */ - -#include <limits.h> -#include <errno.h> -#include <string.h> -#include <sys/types.h> - -#include <rtems/system.h> -#include <rtems/score/object.h> -#include <rtems/posix/seterr.h> - -pid_t _POSIX_types_Ppid = 0; -uid_t _POSIX_types_Uid = 0; -uid_t _POSIX_types_Euid = 0; -gid_t _POSIX_types_Gid = 0; -gid_t _POSIX_types_Egid = 0; - -/*PAGE - * - * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 - */ - -pid_t getpid( void ) -{ - return _Objects_Local_node; -} - -/*PAGE - * - * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 - */ - -pid_t getppid( void ) -{ - return _POSIX_types_Ppid; -} - -/*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.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; -} - -/*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.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; -} - -/*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; -} - -/*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; -} - -/*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 */ -} - -/*PAGE - * - * 4.2.4 Get User Name, P1003.1b-1993, p. 87 - * - * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). - */ - -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 -) -{ - if ( namesize < LOGIN_NAME_MAX ) - return ERANGE; - - strcpy( name, "posixapp" ); - return 0; -} - -/*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; -} - -/*PAGE - * - * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88 - */ - -pid_t setsid( void ) -{ - set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89 - */ - -int setpgid( - pid_t pid, - pid_t pgid -) -{ - set_errno_and_return_minus_one( ENOSYS ); -} - -/* - * TEMPORARY - */ - -#include <assert.h> - -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 - */ - |