Compare commits

..

203 Commits

Author SHA1 Message Date
cvs2git
43e1177def This commit was manufactured by cvs2svn to create tag 'rtems-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
1996-09-30 20:15:02 +00:00
Joel Sherrill
855edeca4f fixed incorrect placement of CPU_STRUCTURE_ALIGNMENT macro. 1996-09-30 20:15:01 +00:00
Joel Sherrill
8880e9c7a9 changed version string to 3.6.0 1996-09-30 20:14:27 +00:00
Joel Sherrill
348ba429c0 changed stack size of posix initialization threads to double the minimum
stack size so more of acvc would pass.
1996-09-30 20:14:08 +00:00
Joel Sherrill
6ae41fd035 updated for Release 3.6.0 to reflect status of posix threads. 1996-09-30 20:07:07 +00:00
Joel Sherrill
caf87fd78d data and control addresses were swapped for channel a of the scc 1996-09-27 15:49:44 +00:00
Joel Sherrill
b6082b01f5 added missing word in ACKNOWLEDGEMENTS 1996-09-20 14:25:24 +00:00
Joel Sherrill
1f4f392a5f new files 1996-09-18 22:23:15 +00:00
Joel Sherrill
0836603ae8 new files submitted by Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com)
1996-09-18 21:13:10 +00:00
Joel Sherrill
7abd27bda1 added cast 1996-09-18 21:07:37 +00:00
Joel Sherrill
c3e3d0766d address arithmetic changed to be more portable 1996-09-18 21:07:14 +00:00
Joel Sherrill
4a5e65186b new test submitted by Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com)
1996-09-18 21:06:49 +00:00
Joel Sherrill
d6b2bbaf1b new files submitted by Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com)
1996-09-18 20:56:35 +00:00
Joel Sherrill
5697c2817c pointer arithmetic reworked to be more portable 1996-09-18 20:55:53 +00:00
Joel Sherrill
be95da0e19 casts added to numerous arguments, prototypes corrected, and
proper include files added.
1996-09-18 20:55:13 +00:00
Joel Sherrill
0c35efe816 dummy function added to satisfy ANSI 1996-09-18 20:54:05 +00:00
Joel Sherrill
5e9a59462c modified to support non-GNU compilers and to use calloc rather than
malloc for per-thread reentrancy structure allocation.
1996-09-18 20:53:35 +00:00
Joel Sherrill
1f2d5dfcb3 added malloc_walk
miscellaneous corrections in casting.
1996-09-18 20:52:47 +00:00
Joel Sherrill
b1c215e8ab added prototype for malloc_walk 1996-09-18 20:52:16 +00:00
Joel Sherrill
94218b8ebd loop to clear workspace memory changed to use sizeof rather than
hardcoded 4 to be compatible with CPUs with 64-bit ints
1996-09-18 20:51:48 +00:00
Joel Sherrill
56e0b884f7 corrected prototype of _Objects_Get_next 1996-09-18 20:50:58 +00:00
Joel Sherrill
3861130b35 uses address object rather than direct pointer arithmetic 1996-09-18 20:50:27 +00:00
Joel Sherrill
4944b5bfe5 OBJECTS_NAME_ALIGNMENT definition changed to use sizeof rather than
hardcoded 4 to be compatible with CPUs with 64-bit ints
1996-09-18 20:50:04 +00:00
Joel Sherrill
857c52f90e MP_PACKET_MINIMUN_HETERO_CONVERSION definition changed to use sizeof
rather than hardcoded 4 to be compatible with CPUs with 64-bit ints
1996-09-18 20:49:36 +00:00
Joel Sherrill
533f89f12f modified declaration of CORE_message_queue_Buffer_control to avoid use
of GNU C extension
1996-09-18 20:48:56 +00:00
Joel Sherrill
2069773571 use address object to avoid direct pointer arithmetic 1996-09-18 20:47:39 +00:00
Joel Sherrill
d1193c7e82 corrected white space problems
added CPU_STRUCTURE_ALIGNMENT to default context structures
1996-09-18 20:47:31 +00:00
Joel Sherrill
a4d97d942b new files submitted by Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com).
1996-09-18 20:45:27 +00:00
Joel Sherrill
5961dbab25 added AMD 29K port 1996-09-18 20:29:00 +00:00
Joel Sherrill
0465d12889 added mvme147s from Dominique le Campion 1996-09-18 14:23:44 +00:00
Joel Sherrill
afe99c27db new file submitted by Dominique le Campion. 1996-09-18 14:17:54 +00:00
Joel Sherrill
cc51de913a extended Task_id and Task_name arrays to avoid indexing past end of array. 1996-09-17 21:38:59 +00:00
Joel Sherrill
1d9d044ec7 Reversed logic in conditional to correctly distinguish between
FIFO and priority disciplines.
1996-09-17 21:33:07 +00:00
Joel Sherrill
41be2e8943 added routine _POSIX_Timespec_subtract 1996-09-17 21:31:30 +00:00
Joel Sherrill
aa48536498 Added code to insure that the post switch extension was executed and
to made signals sent to a particular thread from an ISR operated correctly.
This behavior was required by the exception detection/reporting code
in the gnat runtime.
1996-09-17 21:31:10 +00:00
Joel Sherrill
9093c3c29b Corrected implementation of timed wait on condition variables. First
the timeout is given as a wall-time not an interval as was previously
implemented.  Second, the interpretation of ETIMEDOUT behavior was
incorrect as all possible error cases needed to be checked before
this error was returned.  This caused problems when the wall-time
specified was in the past.
1996-09-17 21:29:51 +00:00
Joel Sherrill
ded66f8f41 added prototype for _POSIX_Timespec_subtract 1996-09-17 21:26:25 +00:00
Mark Johannes
09093ee617 Fixed test to match change to pthread_cond_timedwait which now takes a wall
time.

Commented out calls to pthread_cond_wait and pthread_cond_timedwait without
the mutex locked before calling.
1996-09-12 20:41:27 +00:00
Joel Sherrill
cda277fc4b added $Id$ to file headers
cpu.h: added prototype for _CPU_ISR_Get_level()
1996-09-11 19:16:07 +00:00
Joel Sherrill
0971cd5b5a added $ string to file header 1996-09-11 19:15:09 +00:00
Joel Sherrill
5bb00a8bd3 added $Id$ string to file header 1996-09-11 19:13:44 +00:00
Joel Sherrill
9c0d032e8b new files 1996-09-11 19:12:43 +00:00
Joel Sherrill
b944007b11 added definition of EXT_INT5 1996-09-08 16:24:43 +00:00
Joel Sherrill
3d07c8b71d added mips64orion entries for SHM_LOCK_VALUE and SHM_UNLOCK_VALUE 1996-09-08 16:24:13 +00:00
Joel Sherrill
bdef2d8131 idtmem.S: changed reference to include files to correct location
iface.c: commented out routines now provided by rtems

setvec.c: remov
1996-09-08 16:23:35 +00:00
Joel Sherrill
eaa34e75ae changed reference to include files to correct location 1996-09-08 16:22:29 +00:00
Joel Sherrill
3335420529 moved PTHREAD_MINIMUM_STACK_SIZE from pthread.c to pthread.h so it would be
visible to other files.
1996-09-08 16:22:05 +00:00
Joel Sherrill
e7a36a98b1 Ada task stack size minimize is twice that for regular pthreads. 1996-09-08 16:21:48 +00:00
Joel Sherrill
ed5a518d09 moved PTHREAD_MINIMUM_STACK_SIZE from pthread.c to here so it would be
visible to other files.
1996-09-08 16:21:16 +00:00
Joel Sherrill
d1d3796ce9 changed to reflect status of R4600 work. 1996-09-06 19:57:39 +00:00
Joel Sherrill
8445e57d8c removed need for exceptbdr.h file 1996-09-06 19:57:21 +00:00
Joel Sherrill
f198c63d6a new file for MIPS port by Craig Lebakken (lebakken@minn.net) and
Derrick Ostertag (ostertag@transition.com).
1996-09-06 18:11:41 +00:00
Joel Sherrill
f29032c587 added MIPS port by Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com).
1996-09-06 18:09:25 +00:00
Joel Sherrill
2ffcc2ed9f modified test to take into account change in default value of
inheritsched pthread attribute from implicit to explicit scheduling
parameters.
1996-09-06 15:17:39 +00:00
Joel Sherrill
7fea679b6f changed _TOD_Is_set from a function to a boolean variable 1996-09-06 15:16:19 +00:00
Joel Sherrill
65c421ffc5 default thread attributes: default value for inheritsched changed from
explicit to inherit scheduler to be consistent with FSU pthreads for gnat.

_POSIX_Threads_Create_extension: now inherit signal blocked mask from
creator if the new thread is a posix thread.

_POSIX_Threads_Initialize_user_threads: make sure posix initialization
threads start with a useful priority.  If they inherit the priority
of the creating thread, they will end up at the same priority as the
idle thread.  Since the idle thread does not yield, they will not run.
1996-09-05 20:45:05 +00:00
Joel Sherrill
297be5c8f1 pthread_mutex_setprioceiling: fixed bug where returned priority was
not converted from core priority to posix priority.
1996-09-05 20:41:10 +00:00
Joel Sherrill
7e230f1032 added printf of status when not successful 1996-09-05 20:31:32 +00:00
Joel Sherrill
9a5cbef006 nanosleep: negative value for tv_sec is no longer an error. It now
is changed into being a 0 delay.
1996-09-05 20:29:07 +00:00
Joel Sherrill
f254b93fd8 nanosleep no longer consider a negative value of tv_sec to be an error.
Instead it is an indication of a request for a small delay.
1996-09-05 20:03:19 +00:00
Joel Sherrill
62bf651fe5 new file to support GNU Ada.
currently the only routine in this file simply returns the minimum stack
size for each thread.
1996-08-29 16:39:01 +00:00
Joel Sherrill
b5c04b68e5 fixed typo .. changed == to != 1996-08-27 15:19:51 +00:00
Joel Sherrill
5a2348090f check that we were passed a valid mutex and ignore errors from the
later pthread_mutex_lock.  This makes our behavior more compatible
with that of FSU pthreads.
1996-08-27 15:19:33 +00:00
Mark Johannes
e4cc41762c Changed all EFAULTS to EINVALs 1996-08-23 15:58:24 +00:00
Mark Johannes
3adf786d12 filled in screen 1996-08-23 15:56:50 +00:00
Mark Johannes
237088cfdf Filled in screen 1996-08-23 15:56:22 +00:00
Mark Johannes
78f5dae669 Filled in the screen 1996-08-23 15:55:02 +00:00
Mark Johannes
e2ceeca77e Added build_time statement to provide a tm for the test 1996-08-23 15:50:53 +00:00
Mark Johannes
257adbab17 Changed test 5 to test 10 at bottom 1996-08-23 15:17:16 +00:00
Mark Johannes
0b710dbbb0 pthread_create: changed EINVAL for no more threads back to EAGAIN 1996-08-23 14:47:58 +00:00
Mark Johannes
df70c6b3b0 Commented out the EINVAL for mutex not acquired befor cond_wait call 1996-08-22 20:18:44 +00:00
Mark Johannes
6702bffccd updated to support ENOTSUP 1996-08-21 15:49:21 +00:00
Mark Johannes
256a462255 Added Einval case for mutex not initialized 1996-08-20 21:41:08 +00:00
Mark Johannes
c5c5f8cb3e Changed all EFAULTs to EINVALs 1996-08-19 15:30:25 +00:00
Mark Johannes
02f041e40b pthread_mutex_init: added error messages for NULL mutex and EBUSY 1996-08-19 15:27:37 +00:00
Joel Sherrill
cd3868cdd3 updates from Tony Bennett (tbennett@divnc.com) 1996-08-15 21:09:02 +00:00
Joel Sherrill
0600e86f61 _Thread_Start_multitasking: added code to initialize the floating point
context of the first thread to execute.
1996-08-15 21:05:21 +00:00
Mark Johannes
9ac3e76569 changed ENOMEM error message 1996-08-15 19:38:46 +00:00
Mark Johannes
7fb19bbb79 init: added tests for pthread_kill and kill errors. 1996-08-15 19:27:08 +00:00
Joel Sherrill
851b18db1f changed error code 1996-08-15 18:59:34 +00:00
Joel Sherrill
fdf6917aaa changed error for too many threads to EAGAIN 1996-08-15 18:59:00 +00:00
Joel Sherrill
f3e191461c clock_gettime: changed assert condition to a standard error code
clock_getres: now checking for a null pointer being passed in
1996-08-15 18:58:09 +00:00
Joel Sherrill
b03ab63061 sched_rr_get_interval: converted assert condition into a standard error
code and added check for a NULL interval being passed in.
1996-08-15 18:57:07 +00:00
Joel Sherrill
57dae56225 added constant to indicate there is no mutex associated with this
condition variable
1996-08-15 18:56:09 +00:00
Mark Johannes
de45ddc655 pthread_kill: fixed the move of SIG_IGN not SA_SIGINFO 1996-08-15 16:29:00 +00:00
Mark Johannes
948721cd19 pthread_kill: moved check for SA_SIGINFO to allow for validation of all
parameters.  Also changed returns to macro of -1 and errno set.
1996-08-15 16:24:44 +00:00
Mark Johannes
48e685ceae fixed typo for NOTSUP -> ENOTSUP 1996-08-15 16:22:59 +00:00
Joel Sherrill
fb7d080c98 pthread_mutex_init returns EAGAIN not ENOMEM when there are too many mutexes. 1996-08-14 20:25:57 +00:00
Joel Sherrill
ac81b6cae6 added test cases for NULL being passed to pthread attribute get routines 1996-08-14 19:41:47 +00:00
Joel Sherrill
ff53a6d4fa added test case for pthread_attr_getscope being passed a NULL contentionscope 1996-08-14 19:30:49 +00:00
Mark Johannes
4e63ae5ae2 commented of ENOTSUP until fixed in newlib 1996-08-14 17:20:45 +00:00
Mark Johannes
aae1c9324a pthread_cond_timedwait: added error cases for abstime 1996-08-14 17:20:03 +00:00
Mark Johannes
87c8fd09ed system.h: added task3 and changed condition variable config to 1 1996-08-14 17:19:03 +00:00
Mark Johannes
b0c483edb9 task3: added to test error case in Wait_support for lock on mutex 1996-08-14 17:18:02 +00:00
Mark Johannes
520949bf98 init: added error case for wait timedwait, and wait support 1996-08-14 17:16:14 +00:00
Joel Sherrill
645fc95482 pthread_attr_setscope: returns ENOTSUP not ENOSYS for unsupport scope 1996-08-14 15:27:14 +00:00
Mark Johannes
dce801df4e pthread_cond_destroy: added enable dispatch to EBUSY case 1996-08-13 21:32:49 +00:00
Mark Johannes
95b76bc02b pthread_codn_destroy: EBUSY case moved and uses Thread_queue_First 1996-08-13 21:10:06 +00:00
Mark Johannes
456b376940 pthread_cond_destroy: EBUSY case now uses Thread_queue_First 1996-08-13 20:50:54 +00:00
Mark Johannes
c53eb2c3e7 removed count from Thread_queue_Control 1996-08-13 20:46:10 +00:00
Mark Johannes
a66fcc57aa removed Thread_queue_Get_number_waiting 1996-08-13 20:43:51 +00:00
Joel Sherrill
392b35ef88 deleted a line for spacing correction 1996-08-13 20:38:30 +00:00
Mark Johannes
48b40d8ba7 _POSIX_Condition_variables_Wait_support: changed status of lock and unlock to return EINVAL is there is an error 1996-08-13 19:53:51 +00:00
Mark Johannes
c8a4ed6d2a task_2: added comments and print statement for task exit 1996-08-13 19:06:45 +00:00
Mark Johannes
1d428a3c16 task_1: added comments and print statement for task exit 1996-08-13 19:06:12 +00:00
Mark Johannes
c9c94387d1 Init.c: added timewait case, added broadcast case 1996-08-13 19:05:27 +00:00
Mark Johannes
76f03c642c _POSIX_Condition_variables_Wait_support: fixed the timeout sequence. 1996-08-13 19:03:29 +00:00
Joel Sherrill
b2e8026e64 fixed spacing 1996-08-13 15:43:12 +00:00
Joel Sherrill
9b67f17052 corrected problem in which sigtimedwait() was being invoked with
the wrong mask.

removed code which was commented out.  This code was in another test.
1996-08-13 15:36:28 +00:00
Joel Sherrill
fc960ab03c chenaged format of output 1996-08-13 15:35:36 +00:00
Joel Sherrill
0d59c7a81f added include of errno.h so the test can check for EINTR. 1996-08-13 14:47:52 +00:00
Joel Sherrill
85f5b4ab06 nanosleep now returns -1 and EINTR when a signal interrupts EINTR. 1996-08-13 14:47:31 +00:00
Joel Sherrill
f48c906895 removed errors for TOD not set yet.
made nanosleep return -1/EINTR for being interrupted for a signal.
1996-08-13 14:24:00 +00:00
Joel Sherrill
aac34f7bbc added page break before sysconf() 1996-08-13 14:23:16 +00:00
Mark Johannes
e9624663a1 task_1: added to handle cases of waiting tasks on condition variables 1996-08-12 21:52:37 +00:00
Mark Johannes
a7f4c5a1ff system.h: added protoypes for task and task2, added mutex id, and task ids 1996-08-12 21:51:44 +00:00
Mark Johannes
aad3fe61d7 Init.c: added cases for signal, wait and broadcast 1996-08-12 21:49:54 +00:00
Mark Johannes
08515de591 Task2: new task for broadcast case 1996-08-12 21:49:14 +00:00
Joel Sherrill
5da2ae8b72 added test cases for clock_getres 1996-08-12 21:15:15 +00:00
Joel Sherrill
1087564111 clock_getres: added error check for NULL pointer being passed in. 1996-08-12 20:59:41 +00:00
Joel Sherrill
3fbfbcd5f4 sleep: wrong page number 1996-08-12 20:48:13 +00:00
Joel Sherrill
702a31c756 removed comment about NO_UNINITIALIZED_WARNINGS since that macro
no longer exists.
1996-08-12 20:08:36 +00:00
Joel Sherrill
221bd65cca added test case for stack too large 1996-08-12 20:00:02 +00:00
Joel Sherrill
5f08fd6179 nanosleep: verify rqtp parameter is non-NULL.
nanosleep: return 0 time remaining for a yield case.
1996-08-12 19:55:09 +00:00
Joel Sherrill
c4f5e752e6 added test cases for clock_gettime (invalid id), clock_settime (invalid_id),
nanosleep (yield cpu), and numerous error cases in nanosleep
1996-08-12 19:54:12 +00:00
Joel Sherrill
d60d9505ca added test case for non-NULL parameter to time() 1996-08-12 19:20:18 +00:00
Joel Sherrill
40cfab477e time: It is not an error if the TOD is not set. 1996-08-12 19:19:03 +00:00
Mark Johannes
9b77fee2bc Wait_support: removed the calls to mutex core to posix status codes 1996-08-12 19:00:12 +00:00
Mark Johannes
3b97b7a083 mutex.h: removes the promotion of core status code to POSXI status codes 1996-08-12 18:58:12 +00:00
Joel Sherrill
1402ee257d fixed spacing ; moved a dummy MP support routine to clean up printout. 1996-08-12 18:56:04 +00:00
Joel Sherrill
c7a9c6675e _POSIX_Mutex_Get: made null id an error 1996-08-12 18:06:27 +00:00
Joel Sherrill
ccdf4c579f pthread_mutex_getprioceiling: added error check for null old_ceiling
pthread_mutex_setprioceiling: added comment indicating an error was
impossible to generate.
1996-08-12 18:05:47 +00:00
Joel Sherrill
d06e9ca36a added numerous error test cases. 1996-08-12 18:04:38 +00:00
Mark Johannes
b1af454f18 mutex.h: promoted out _POSIX_Mutex_From_core_mutex_status 1996-08-12 17:41:37 +00:00
Mark Johannes
af04a79173 _POSIX_Condition_variables_Wait_support: added _POSIX_Mutex_From_core_mutex_status for the two calls to the mutex manager 1996-08-12 17:40:56 +00:00
Mark Johannes
cdcea6ceb6 _POSIX_Condition_variables_Signal_support: added setting mutex back to NULL
if the queue has been emptied of waiting tasks.

_POSIX_Condition_variables_Wait_support: added error check for different mutexesfor the same condition variable.  Also added _Thread_queue_Enter_critical_section
1996-08-12 17:21:04 +00:00
Joel Sherrill
f126ae2a86 pthread_mutexattr_setprioceiling: fixed typo 1996-08-12 17:04:13 +00:00
Joel Sherrill
db8e901180 pthread_mutexattr_setprioceiling: valid priority ceiling check looked at
value in attribute structure instead of passed in priority
1996-08-12 17:02:39 +00:00
Joel Sherrill
684c3c49c3 pthread_mutexattr_getprotocol: added check for attribute structure being
initialized
1996-08-12 16:29:14 +00:00
Mark Johannes
0cd15947c8 Init: added pthread_cond_init with an attr non-NULL, initialized the attr again 1996-08-12 15:15:51 +00:00
Mark Johannes
5263668f6d Init: added prliminary phtread_cond_init and destroy cases. 1996-08-12 14:49:02 +00:00
Mark Johannes
da4e38d98e system.h: added condition variable #define for 10 condition variables 1996-08-12 14:48:13 +00:00
Joel Sherrill
da2e5396d7 added test cases for errors in pthread_mutexattr_getpshared 1996-08-09 21:16:01 +00:00
Joel Sherrill
b9444fb905 added code to catch NULL pointers for return values passed to get routines 1996-08-09 19:58:58 +00:00
Joel Sherrill
13adea03e0 added test cases for EINVAL cases in pthread_mutexattr_destroy 1996-08-09 19:55:04 +00:00
Joel Sherrill
c03aeaffbe added test case for pthread_mutexattr_init being passed a null pointer. 1996-08-09 19:50:26 +00:00
Joel Sherrill
76117f2bd9 changed style of output to match other tests 1996-08-09 19:20:54 +00:00
Mark Johannes
1406a4b661 system.h: initial cvs 1996-08-09 19:10:50 +00:00
Joel Sherrill
c7dd091f65 lowered maximum number of threads to 2 to make test case easier.
include sched.h so test can invoke scheduler routines.
1996-08-09 18:48:33 +00:00
Joel Sherrill
d0b52492cd added test case for sched_yield.
changed format of some output.
1996-08-09 18:47:58 +00:00
Joel Sherrill
f643e23046 added test cases for errors in sched_get_priority_min and
sched_get_priority_max.

added test case for sched_yield.
1996-08-09 18:47:38 +00:00
Joel Sherrill
8699a7008e sched_yield: was not invoking the dispatcher. 1996-08-09 18:45:10 +00:00
Mark Johannes
695dd0b64c Init: added condattr - destroy, init, set and get cases 1996-08-09 18:28:21 +00:00
Joel Sherrill
66dfd0ba6e added test cases for invalid key ids 1996-08-09 17:44:04 +00:00
Joel Sherrill
d858fdbbaf merged remote object id and invalid id error cases. 1996-08-09 17:30:13 +00:00
Joel Sherrill
760ee96da9 reduced maximum keys to 2 to more easily generate error 1996-08-09 16:02:06 +00:00
Joel Sherrill
5b08e20b5e changed printf's which could be puts's to puts 1996-08-09 16:01:50 +00:00
Joel Sherrill
54e34e7a47 new test to test scheduling policy and paremeter paths in pthread_create. 1996-08-08 23:02:13 +00:00
Mark Johannes
13642cbc74 Init: Original file - tests for condition variables. 1996-08-08 22:26:55 +00:00
Joel Sherrill
79f189e26c split test into multiple tasks. 1996-08-08 21:58:26 +00:00
Joel Sherrill
76de65b371 added cases to increase coverage of pthread_create. cases added tested
error paths as well as inherit scheduling attributes.
1996-08-08 21:46:40 +00:00
Joel Sherrill
2b61358815 added test to complete coverage of pthread_setschedparam and increase
coverage of pthread_create
1996-08-08 20:47:49 +00:00
Mark Johannes
8ca831af38 Init: spacing 1996-08-08 19:21:47 +00:00
Mark Johannes
e35157311c Task_1: changed comment and task name to task1. 1996-08-08 19:20:13 +00:00
Mark Johannes
9f1a034e75 Init.c: added priority ceiling task cases. 1996-08-08 19:19:09 +00:00
Mark Johannes
77597ddd32 Added task2 and task3 prototypes and ids 1996-08-08 18:50:39 +00:00
Mark Johannes
481d8f8fa4 Signal_info_handler: added multiple signal cases to finish out the test 1996-08-08 18:44:09 +00:00
Joel Sherrill
4357da1801 changed phrase "RTEMS is support" to "RTEMS is supposed" 1996-08-08 18:27:44 +00:00
Mark Johannes
2a9a479d90 CORE_mutex_Status: added CORE_MUTEX_STATUS_CEILING_VIOLATED to enum 1996-08-08 18:27:11 +00:00
Mark Johannes
567ac4579d _POSIX_signals_Clear_signals: added this routine
_POSIX_signals_Get_highest: changed initial starting signal to SIGHUP, still needs SIGFIRSTNOTRT
1996-08-08 18:24:29 +00:00
Joel Sherrill
8b1c1ae6f0 print_current_time: added leading underscore to variables allocated
inside macros.
1996-08-08 16:53:32 +00:00
Joel Sherrill
66e519c1c1 ERC32_Force_interrupt implementation replaced per Jiri Gaisler's experience
on the real erc32 hardware.
1996-08-08 16:52:24 +00:00
Joel Sherrill
f55d898c6b added ss_high_priority field to support sporadic server. 1996-08-08 16:51:14 +00:00
Joel Sherrill
644c0fa618 added complete test cases for pthread_once. 1996-08-08 16:28:24 +00:00
Mark Johannes
b67f5bfb91 _MPCI_Register_packet_processor: changed protoype first parameter type to MP_packet_Classes 1996-08-08 12:35:20 +00:00
Mark Johannes
6b722e2747 _MPCI_Register_packet_processor: Changed prototype of fist parameter name to the_class 1996-08-08 12:32:50 +00:00
Mark Johannes
3fd3da452b _MPCI_Register_packet_processor: changes first parameter type to MP_packet_Classes 1996-08-08 12:31:01 +00:00
Joel Sherrill
2014063fec sporadic server debugged and working. This required minor changes in all
sporadic server related routines.
1996-08-07 22:06:08 +00:00
Joel Sherrill
ecc912f466 added more error cases to complete testing of pthread_equal when
RTEMS_DEBUG is enabled.
1996-08-07 22:05:15 +00:00
Joel Sherrill
42418a9d3c added test cases for ESRCH from pthread_join and pthread_detach 1996-08-07 22:00:57 +00:00
Joel Sherrill
84b03316d1 removed if 0 for basic sporadic server case accidentally left in. 1996-08-07 21:38:18 +00:00
Joel Sherrill
7e811af1eb basic sporadic server test.
sporadic server with priority ceiling mutex test.
1996-08-07 21:27:25 +00:00
Mark Johannes
a14684c356 _POSIX_Mutex_From_core_mutex_status: added priority ceiling violation case 1996-08-07 20:58:59 +00:00
Mark Johannes
cc757febff _CORE_Mutex_seize: added checks for priority ceiling violation, also added
checks to ensure priority was not lowered.
1996-08-07 20:57:28 +00:00
Joel Sherrill
c123a08496 added complete test cases for pthread_attr_getschedparam,
pthread_attr_setschedparam, and pthread_getschedparam.

added test cases for error paths for pthread_setschedparam.
1996-08-07 15:52:30 +00:00
Joel Sherrill
4bab8e2d35 get_errno: no longer needed by gnat runtime 1996-08-06 17:45:12 +00:00
Mark Johannes
0f99198845 _CORE_mutex_Seize: added change priority case if the mutex was obtained. 1996-08-06 16:26:11 +00:00
Joel Sherrill
a61f1a4682 _POSIX_Threads_Delete_extension: reorder to eliminate use of local pointer
variable before set.

pthread_join: using local variable so user can pass NULL pointer as argument
1996-08-06 16:24:41 +00:00
Mark Johannes
06883e131c POSIX_Mutex_Default_attributes: changed prio_ceiling to maximum priority 1996-08-06 16:24:06 +00:00
Joel Sherrill
b521ae2fa7 pthread_getspecific: use local variable so references to tcb are completed
before enabling dispatching
1996-08-06 16:23:09 +00:00
Joel Sherrill
20de2722aa join/detach basic tests pass 1996-08-02 18:25:16 +00:00
Joel Sherrill
375f37dfda removed unused prototypes 1996-08-02 16:46:56 +00:00
Joel Sherrill
870f2976f4 test successfully exercises all of pthread_attr_* set and get routines 1996-08-01 21:02:54 +00:00
Joel Sherrill
22b4b2e0d2 added page delimiters for comment blocks 1996-08-01 19:24:57 +00:00
Joel Sherrill
16bae520ac added 3 nops following write to wim since a restore following it is
subject to causing unpredictable window underflow/overflows.
1996-08-01 15:06:00 +00:00
Joel Sherrill
c65a0cee2f added key test 1996-07-31 17:17:48 +00:00
Mark Johannes
adae080a0e Fixed default vectors initialization, sigaction which had a redundant
if clause for DFT action.
1996-07-15 14:02:14 +00:00
Joel Sherrill
69c9543543 basic test cases passed 1996-07-04 18:09:23 +00:00
Joel Sherrill
ce78b89451 added test case for timeout using pthread_mutex_timedlock 1996-07-04 17:38:55 +00:00
Joel Sherrill
c6d15c2c26 first test cases for mutex manager pass 1996-07-04 17:01:48 +00:00
Joel Sherrill
e21cf313ca another attempt at the rtems_posix_api ifdef 1996-07-03 14:24:07 +00:00
Joel Sherrill
503dc05890 switched from "STATIC INLINE" to "RTEMS_INLINE_ROUTINE" 1996-07-03 14:20:03 +00:00
Joel Sherrill
5fc0dc11a0 changed version 1996-07-03 14:19:09 +00:00
323 changed files with 34431 additions and 628 deletions

View File

@@ -77,7 +77,14 @@ The following persons/organizations have made contributions:
+ Dominique le Campion (Dominique.LECAMPION@enst-bretagne.fr), for
Telecom Bretagne and T.N.I. (Brest, France) submitted the BSP for
the Motorola MVME147 board (68030 CPU + 68881 FPU).
the Motorola MVME147 board (68030 CPU + 68881 FPU) and the MVME147s
variant of this board.
+ Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
(ostertag@transition.com) of Transition Networks of Eden Prairie, MN
for porting RTEMS to the MIPS and AMD 29K architectures. This submission
includes complete support for the R4650 as well as partial support
for the R4600.
Finally, the RTEMS project would like to thank those who have contributed
to the other free software efforts which RTEMS utilizes. The primary RTEMS

View File

@@ -4,10 +4,17 @@
This is the list of outstanding problems in this release.
+ The POSIX threads and real time extensions code in this tree are
not completely tested yet. Some of the POSIX tests do run but none
of the POSIX code is in the normal build path.
+ The POSIX threads and real-time extensions are tested but this is
the first release with them included. They are not enabled by
default. The environment variable RTEMS_HAS_POSIX_API must be
set to "yes" and the C language macro RTEMS_POSIX_API must be defined
before this api is included in the build.
+ The shell scripts runtest and difftest do not work properly when
testing "debug" executables.
+ AMD 29k port is based on a non-GNU toolset.
+ The test spfatal is out of date and as a result will NOT execute
correctly. The addition of POSIX and consequent ongoing initialization
reorganization makes it pointless to fix this until the POSIX support
@@ -29,6 +36,10 @@ This is the list of outstanding problems in this release.
It is better to define these in the linkcmds file. It is also nice
to use the linkcmds file to place overlays for on-board hardware.
+ The __read(), __write(), etc. routines should be renamed __rtems_read(),
etc. to avoid potential naming conflicts. [NOTE: This is already
necessary under some versions of Linux with the unix port.]
+ The __read() system call in all of the BSPs using single
character input/output needs to be smarter. The following
issues need to be addressed:

137
c/src/exec/posix/base/aio.h Normal file
View File

@@ -0,0 +1,137 @@
/* aio.h
*
* $Id$
*/
#ifndef __POSIX_ASYNCHRONOUS_IO_h
#define __POSIX_ASYNCHRONOUS_IO_h
#include <rtems/posix/features.h>
#if defined(_POSIX_ASYNCHRONOUS_IO)
/*
* 6.7.1 Data Definitions for Asynchronous Input and Output,
* P1003.1b-1993, p. 151
*/
#include <sys/types.h>
#include <signal.h>
#include <time.h>
#include <fcntl.h>
/*
* 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
*/
#define AIO_CANCELED 0 /* all requested operations have been canceled */
#define AIO_NOTCANCELED 0 /* some of the operations could not be canceled */
/* since they are in progress */
#define AIO_ALLDONE 0 /* none of the requested operations could be */
/* canceled since they are already complete */
/* lio_listio() options */
#define LIO_WAIT 0 /* calling process is to suspend until the */
/* operation is complete */
#define LIO_NOWAIT 0 /* calling process is to continue execution while */
/* the operation is performed and no notification */
/* shall be given when the operation is completed */
#define LIO_READ 0 /* request a read() */
#define LIO_WRITE 0 /* request a write() */
#define LIO_NOP 0 /* no transfer is requested */
/*
* 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
*/
struct aiocb {
int aio_fildes; /* File descriptor */
off_t aio_offset; /* File offset */
volatile void *aio_buf; /* Location of buffer */
size_t aio_nbytes; /* Length of transfer */
int aio_reqprio; /* Request priority offset */
struct sigevent aio_sigevent; /* Signal number and value */
int aoi_lio_opcode; /* Operation to be performed */
};
/*
* 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
*/
int aio_read(
struct aiocb *aiocbp
);
/*
* 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
*/
int aio_write(
struct aiocb *aiocbp
);
/*
* 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
*/
int lio_listio(
int mode,
struct aiocb * const list[],
int nent,
struct sigevent *sig
);
/*
* 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
*/
int aio_error(
const struct aiocb *aiocbp
);
/*
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
* P1003.1b-1993, p. 162
*/
int aio_return(
const struct aiocb *aiocbp
);
/*
* 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
*/
int aio_cancel(
int filedes,
struct aiocb *aiocbp
);
/*
* 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
*/
int aio_suspend(
struct aiocb * const list[],
int nent,
const struct timespec *timeout
);
#if defined(_POSIX_SYNCHRONIZED_IO)
/*
* 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
*/
int aio_fsync(
int op,
struct aiocb *aiocbp
);
#endif /* _POSIX_SYNCHRONIZED_IO */
#endif /* _POSIX_ASYNCHRONOUS_IO */
#endif
/* end of include file */

View File

@@ -0,0 +1,30 @@
/* devctl.h
*
* $Id$
*/
#ifndef __POSIX_DEVICE_CONTROL_h
#define __POSIX_DEVICE_CONTROL_h
#include <rtems/posix/features.h>
#if defined(_POSIX_DEVICE_CONTROL)
#include <sys/types.h>
#include <unistd.h>
/*
* 21.2.1 Control a Device, P1003.4b/D8, p. 65
*/
int devctl(
int filedes,
void *dev_data_ptr,
size_t nbyte,
int *dev_info_ptr
);
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,72 @@
/* intr.h
*
* XXX: It is unclear if the type "intr_t" should be defined when
* _POSIX_INTERRUPT_CONTROL is not.
*
* $Id$
*/
#ifndef __POSIX_INTERRUPTS_h
#define __POSIX_INTERRUPTS_h
#include <rtems/posix/features.h>
#include <sys/types.h>
#include <sys/time.h>
#if defined(_POSIX_INTERRUPT_CONTROL)
/*
* 22.2 Concepts, P1003.4b/D8, p. 73
*/
typedef int intr_t;
/*
* 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
*/
/*
* Return codes from an interrupt handler
*/
#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
/* the thread that registered the */
/* ISR that the interrupt occurred. */
#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
/* do NOT perform notification. */
#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
/* let the next handler try. */
int intr_capture(
intr_t intr,
int (*intr_handler)( void *area ),
volatile void *area,
size_t areasize
);
int intr_release(
intr_t intr,
int (*intr_handler)( void *area )
);
int intr_lock(
intr_t intr
);
int intr_unlock(
intr_t intr
);
/*
* 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
*/
int intr_timed_wait(
int flags,
const struct timespec *timeout
);
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,164 @@
/* limits.h
*
* This file lists the minimums for the limits set by each of
* the POSIX features subsets.
*
* XXX: Careful attention needs to be paid to section 2.8 in 1003.1b-1993
* to segregrate the variables below based on their "class" according
* to our implementation. We also need to set the Run-Time Invariant
* and other related values.
*
* $Id$
*/
#include_next <limits.h>
#ifndef __POSIX_LIMITS_h
#define __POSIX_LIMITS_h
/* really only to get min stack size from <rtems/score/cpu.h> */
#include <rtems/system.h>
/****************************************************************************
****************************************************************************
* *
* P1003.1b-1993 defines the constants below this comment. *
* *
****************************************************************************
****************************************************************************/
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_MAX 1
#define _POSIX_ARG_MAX 4096
#define _POSIX_CHILD_MAX 6
#define _POSIX_DELAYTIMER_MAX 32
#define _POSIX_LINK_MAX 8
#define _POSIX_MAX_CANON 255
#define _POSIX_MAX_INPUT 255
#define _POSIX_MQ_OPEN_MAX 8
#define _POSIX_MQ_PRIO_MAX 32
#define _POSIX_NAME_MAX 14
#define _POSIX_NGROUPS_MAX 0
#define _POSIX_OPEN_MAX 16
#define _POSIX_PATH_MAX 255
#define _POSIX_PIPE_BUF 512
#define _POSIX_RTSIG_MAX 8
#define _POSIX_SEM_NSEMS_MAX 256
#define _POSIX_SEM_VALUE_MAX 32767
#define _POSIX_SIGQUEUE_MAX 32
#define _POSIX_SSIZE_MAX 32767
#define _POSIX_STREAM_MAX 8
#define _POSIX_TIMER_MAX 32
#define _POSIX_TZNAME_MAX 3
/*
* Definitions of the following may be omitted if the value is >= stated
* minimum but is indeterminate.
*/
#define AIO_LISTIO_MAX 2
#define AIO_MAX 1
#define AIO_PRIO_DELTA_MAX 0
#define ARG_MAX 4096
#define CHILD_MAX 6
#define DELAYTIMER_MAX 32
#define MQ_OPEN_MAX 8
#define MQ_PRIO_MAX 32
#define OPEN_MAX 16
#define PAGESIZE 1
#define RTSIG_MAX 8
#define SEM_NSEMS_MAX 256
#define SEM_VALUE_MAX 32767
#define SIGQUEUE_MAX 32
#define STREAM_MAX 8
#define TIMER_MAX 32
#define TZNAME_MAX 3
/*
* Pathname Variables
*/
#define LINK_MAX 8
#define MAX_CANON 255
#define MAX_INPUT 255
#define NAME_MAX 14
#define PATH_MAX 255
#define PIPE_BUF 512
/*
* Invariant values
*/
#define SSIZE_MAX 32767
/*
* Maximum Values
*/
#define _POSIX_CLOCKRES_MIN 0 /* in nanoseconds */
/****************************************************************************
****************************************************************************
* *
* P1003.1c/D10 defines the constants below this comment. *
*
* XXX: doc seems to have printing problems in this table :(
* *
****************************************************************************
****************************************************************************/
#define _POSIX_LOGIN_NAME_MAX 9
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 28
#define _POSIX_THREAD_THREADS_MAX 64
#define _POSIX_TTY_NAME_MAX 9
/*
* Definitions of the following may be omitted if the value is >= stated
* minimum but is indeterminate.
*/
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
#define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
#define PTHREAD_STACK_MIN CPU_STACK_MINIMUM_SIZE
/*
* The maximum number of keys (PTHREAD_KEYS_MAX) and threads
* (PTHREAD_THREADS_MAX) are configurable and may exceed the minimum.
*
#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
*/
/****************************************************************************
****************************************************************************
* *
* P1003.4b/D8 defines the constants below this comment. *
* *
****************************************************************************
****************************************************************************/
#define _POSIX_INTERRUPT_OVERRUN_MAX 32
/*
* Definitions of the following may be omitted if the value is >= stated
* minimum but is indeterminate.
*/
#define INTERRUPT_OVERRUN_MAX 32
/*
* Pathname Variables
*/
#define MIN_ALLOC_SIZE
#define REC_MIN_XFER_SIZE
#define REC_MAX_XFER_SIZE
#define REC_INCR_XFER_SIZE
#define REC_XFER_ALIGN
#define MAX_ATOMIC_SIZE
#endif
/* end of include file */

View File

@@ -0,0 +1,145 @@
/* mqueue.h
*
* $Id$
*/
#ifndef __POSIX_MESSAGE_QUEUE_h
#define __POSIX_MESSAGE_QUEUE_h
#include <rtems/posix/features.h>
#if defined(_POSIX_MESSAGE_PASSING)
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
/*
* 15.1.1 Data Structures, P1003.1b-1993, p. 271
*/
typedef Objects_Id mqd_t;
struct mq_attr {
long mq_flags; /* Message queue flags */
long mq_maxmsg; /* Maximum number of messages */
long mq_msgsize; /* Maximum message size */
long mq_curmsgs; /* Number of messages currently queued */
};
/*
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
*/
mqd_t mq_open(
const char *name,
int oflag,
...
);
/*
* 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
*/
int mq_close(
mqd_t mqdes
);
/*
* 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
*/
int mq_unlink(
const char *name
);
/*
* 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
*
* NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
*/
int mq_send(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio
);
#if defined(_POSIX_TIMEOUTS)
#include <time.h>
int mq_timedsend(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
/*
* 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
*
* NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
*/
ssize_t mq_receive(
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio
);
#if defined(_POSIX_TIMEOUTS)
int mq_timedreceive( /* XXX: should this be ssize_t */
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
#if defined(_POSIX_REALTIME_SIGNALS)
/*
* 15.2.6 Notify Process that a Message is Available on a Queue,
* P1003.1b-1993, p. 280
*/
int mq_notify(
mqd_t mqdes,
const struct sigevent *notification
);
#endif /* _POSIX_REALTIME_SIGNALS */
/*
* 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
*/
int mq_setattr(
mqd_t mqdes,
const struct mq_attr *mqstat,
struct mq_attr *omqstat
);
/*
* 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
*/
int mq_getattr(
mqd_t mqdes,
struct mq_attr *mqstat
);
#endif /* _POSIX_MESSAGE_PASSING */
#endif
/* end of include file */

View File

@@ -0,0 +1,500 @@
/* pthread.h
*
* $Id$
*/
#ifndef __PTHREAD_h
#define __PTHREAD_h
#include <sys/features.h>
#if defined(_POSIX_THREADS)
#include <sys/types.h>
#include <time.h>
#include <sys/sched.h>
/*
* 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."
*/
/*
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
*/
int pthread_mutexattr_init(
pthread_mutexattr_t *attr
);
int pthread_mutexattr_destroy(
pthread_mutexattr_t *attr
);
int pthread_mutexattr_getpshared(
const pthread_mutexattr_t *attr,
int *pshared
);
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
);
/*
* 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
*/
int pthread_mutex_init(
pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr
);
int pthread_mutex_destroy(
pthread_mutex_t *mutex
);
/*
* This is used to statically initialize a pthread_mutex_t. Example:
*
* pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
*/
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
/*
* 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
);
int pthread_mutex_trylock(
pthread_mutex_t *mutex
);
int pthread_mutex_unlock(
pthread_mutex_t *mutex
);
#if defined(_POSIX_TIMEOUTS)
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
/*
* 11.4.1 Condition Variable Initialization Attributes,
* P1003.1c/Draft 10, p. 96
*/
int pthread_condattr_init(
pthread_condattr_t *attr
);
int pthread_condattr_destroy(
pthread_condattr_t *attr
);
int pthread_condattr_getpshared(
const pthread_condattr_t *attr,
int *pshared
);
int pthread_condattr_setpshared(
pthread_condattr_t *attr,
int pshared
);
/*
* 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
);
int pthread_cond_destroy(
pthread_cond_t *mutex
);
/*
* This is used to statically initialize a pthread_cond_t. Example:
*
* pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
*/
#define PTHREAD_COND_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
/*
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
*/
int pthread_cond_signal(
pthread_cond_t *cond
);
int pthread_cond_broadcast(
pthread_cond_t *cond
);
/*
* 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
);
int pthread_cond_timedwait(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime
);
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
/*
* 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
*/
int pthread_attr_setscope(
pthread_attr_t *attr,
int contentionscope
);
int pthread_attr_getscope(
const pthread_attr_t *attr,
int *contentionscope
);
int pthread_attr_setinheritsched(
pthread_attr_t *attr,
int inheritsched
);
int pthread_attr_getinheritsched(
const pthread_attr_t *attr,
int *inheritsched
);
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
);
int pthread_attr_getschedpolicy(
const pthread_attr_t *attr,
int *policy
);
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
int pthread_attr_setschedparam(
pthread_attr_t *attr,
const struct sched_param *param
);
int pthread_attr_getschedparam(
const pthread_attr_t *attr,
struct sched_param *param
);
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
/*
* 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
);
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
);
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
*/
int pthread_mutexattr_setprotocol(
pthread_mutexattr_t *attr,
int protocol
);
int pthread_mutexattr_getprotocol(
const pthread_mutexattr_t *attr,
int *protocol
);
int pthread_mutexattr_setprioceiling(
pthread_mutexattr_t *attr,
int prioceiling
);
int pthread_mutexattr_getprioceiling(
const pthread_mutexattr_t *attr,
int *prioceiling
);
#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
#if defined(_POSIX_THREAD_PRIO_PROTECT)
/*
* 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
);
int pthread_mutex_getprioceiling(
pthread_mutex_t *mutex,
int *prioceiling
);
#endif /* _POSIX_THREAD_PRIO_PROTECT */
/*
* 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
*/
int pthread_attr_init(
pthread_attr_t *attr
);
int pthread_attr_destroy(
pthread_attr_t *attr
);
int pthread_attr_getstacksize(
const pthread_attr_t *attr,
size_t *stacksize
);
int pthread_attr_setstacksize(
pthread_attr_t *attr,
size_t stacksize
);
int pthread_attr_getstackaddr(
const pthread_attr_t *attr,
void **stackaddr
);
int pthread_attr_setstackaddr(
pthread_attr_t *attr,
void *stackaddr
);
int pthread_attr_getdetachstate(
const pthread_attr_t *attr,
int *detachstate
);
int pthread_attr_setdetachstate(
pthread_attr_t *attr,
int detachstate
);
/*
* 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
);
/*
* 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
*/
int pthread_join(
pthread_t thread,
void **value_ptr
);
/*
* 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
*/
int pthread_detach(
pthread_t thread
);
/*
* 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
*/
void pthread_exit(
void *value_ptr
);
/*
* 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX
*/
pthread_t pthread_self( void );
/*
* 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
*/
int pthread_equal(
pthread_t t1,
pthread_t t2
);
/*
* 16.1.8 Dynamic Package Initialization
*/
/*
* This is used to statically initialize a pthread_once_t. Example:
*
* pthread_once_t once = PTHREAD_ONCE_INIT;
*
* NOTE: This is named inconsistently -- it should be INITIALIZER.
*/
#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
);
/*
* 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 * )
);
/*
* 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
*/
int pthread_setspecific(
pthread_key_t key,
const void *value
);
void *pthread_getspecific(
pthread_key_t key
);
/*
* 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
*/
int pthread_key_delete(
pthread_key_t key
);
/*
* 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
*/
#define PTHREAD_CANCEL_ENABLE 0
#define PTHREAD_CANCEL_DISABLE 1
#define PTHREAD_CANCEL_DEFERRED 0
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
int pthread_cancel(
pthread_t thread
);
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
int pthread_setcancelstate(
int state,
int *oldstate
);
int pthread_setcanceltype(
int type,
int *oldtype
);
void pthread_testcancel( void );
/*
* 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
*/
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
);
void pthread_cleanup_pop(
int execute
);
#if defined(_POSIX_THREAD_CPUTIME)
/*
* 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58
*/
int pthread_getcpuclockid(
pthread_t thread_id,
clockid_t *clock_id
);
/*
* 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59
*/
int pthread_attr_setcputime(
pthread_attr_t *attr,
int clock_allowed
);
int pthread_attr_getcputime(
pthread_attr_t *attr,
int *clock_allowed
);
#endif /* defined(_POSIX_THREAD_CPUTIME) */
#endif /* defined(_POSIX_THREADS) */
#endif
/* end of include file */

View File

@@ -0,0 +1,88 @@
/* sched.h
*
* $Id$
*/
#ifndef __POSIX_SCHEDULING_h
#define __POSIX_SCHEDULING_h
#include <sys/features.h>
#if defined(_POSIX_PRIORITY_SCHEDULING)
#include <sys/types.h>
#include <time.h>
#include <sys/sched.h>
#include <pthread.h>
/*
* 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
*
*/
int sched_setparam(
pid_t pid,
const struct sched_param *param
);
/*
* 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
*/
int sched_getparam(
pid_t pid,
const struct sched_param *param
);
/*
* 13.3.3 Set Scheduling Policy and Scheduling Parameters,
* P1003.1b-1993, p. 254
*/
int sched_setscheduler(
pid_t pid,
int policy,
const struct sched_param *param
);
/*
* 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
*/
int sched_getscheduler(
pid_t pid
);
/*
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_max(
int policy
);
int sched_get_priority_min(
int policy
);
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
);
#endif /* _POSIX_PRIORITY_SCHEDULING */
#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
/*
* 13.3.5 Yield Processor, P1003.1b-1993, p. 257
*/
int sched_yield( void );
#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
#endif
/* end of include file */

View File

@@ -0,0 +1,108 @@
/* semaphore.h
*
* $Id$
*/
#ifndef __POSIX_SEMAPHORE_h
#define __POSIX_SEMAPHORE_h
#include <rtems/posix/features.h>
#if defined(_POSIX_SEMAPHORES)
#include <sys/time.h>
/*
* 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
*/
typedef int sem_t;
/*
* 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
*/
int sem_init(
sem_t *sem,
int pshared,
unsigned int value
);
/*
* 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
*/
int sem_destroy(
sem_t *sem
);
/*
* 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
*
* NOTE: Follows open() calling conventions.
*/
sem_t *sem_open(
const char *name,
int oflag,
...
);
/*
* 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
*/
int sem_close(
sem_t *sem
);
/*
* 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
*/
int sem_unlink(
const char *name
);
/*
* 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
*
* NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
*/
int sem_wait(
sem_t *sem
);
int sem_trywait(
sem_t *sem
);
#if defined(_POSIX_TIMEOUTS)
int sem_timedwait(
sem_t *sem,
const struct timespec *timeout
);
#endif
/*
* 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
*/
int sem_post(
sem_t *sem
);
/*
* 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
*/
int sem_getvalue(
sem_t *sem,
int *sval
);
#endif /* _POSIX_SEMAPHORES */
#endif
/* end of include file */

View File

@@ -0,0 +1,85 @@
/* unistd.h
*
* $Id$
*/
#ifndef __POSIX_UNISTD_h
#define __POSIX_UNISTD_h
#include <rtems/posix/features.h>
/*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
*
* NOTE: Table 4-2, Configurable System Variables, p. 96
*/
#define _SC_AIO_LISTIO_MAX 0
#define _SC_AIO_MAX 1
#define _SC_AIO_PRIO_DELTA_MAX 2
#define _SC_ARG_MAX 3
#define _SC_CHILD_MAX 4
#define _SC_CLK_TCK 5
#define _SC_DELAYTIMER_MAX 6
#define _SC_MQ_OPEN_MAX 7
#define _SC_MQ_PRIO_MAX 8
#define _SC_NGROUPS_MAX 9
#define _SC_OPEN_MAX 10
#define _SC_PAGESIZE 11
#define _SC_RTSIG_MAX 12
#define _SC_SEM_NSEMS_MAX 13
#define _SC_SEM_VALUE_MAX 14
#define _SC_SIGQUEUE_MAX 15
#define _SC_STREAM_MAX 16
#define _SC_TIMER_MAX 17
#define _SC_TZNAME_MAX 18
#define _SC_ASYNCHRONOUS_IO 19
#define _SC_FSYNC 20
#define _SC_JOB_CONTROL 21
#define _SC_MAPPED_FILES 22
#define _SC_MEMLOCK 23
#define _SC_MEMLOCK_RANGE 24
#define _SC_MEMORY_PROTECTION 25
#define _SC_MESSAGE_PASSING 26
#define _SC_PRIORITIZED_IO 27
#define _SC_REALTIME_SIGNALS 28
#define _SC_SAVED_IDS 29
#define _SC_SEMAPHORES 30
#define _SC_SHARED_MEMORY_OBJECTS 31
#define _SC_SYNCHRONIZED_IO 32
#define _SC_TIMERS 33
#define _SC_VERSION 34
/*
* P1003.1c/D10, p. 52 adds the following.
*/
#define _SC_GETGR_R_SIZE_MAX 35
#define _SC_GETPW_R_SIZE_MAX
#define _SC_LOGIN_NAME_MAX
#define _SC_THREAD_DESTRUCTOR_ITERATIONS
#define _SC_THREAD_KEYS_MAX
#define _SC_THREAD_STACK_MIN
#define _SC_THREAD_THREADS_MAX
#define _SC_TTY_NAME_MAX
#define _SC_THREADS
#define _SC_THREAD_ATTR_STACKADDR
#define _SC_THREAD_ATTR_STACKSIZE
#define _SC_THREAD_PRIORITY_SCHEDULING
#define _SC_THREAD_PRIO_INHERIT
#define _SC_THREAD_PRIO_CEILING
#define _SC_THREAD_PROCESS_SHARED
#define _SC_THREAD_SAGE_FUNCTIONS
/*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
*/
long sysconf(
int name
);
#endif
/* end of include */

View File

@@ -0,0 +1,16 @@
/* rtems/posix/cancel.h
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CANCEL_h
#define __RTEMS_POSIX_CANCEL_h
typedef struct {
Chain_Node Node;
void (*routine)( void * );
void *arg;
} POSIX_Cancel_Handler_control;
#endif
/* end of include file */

View File

@@ -0,0 +1,130 @@
/* rtems/posix/cond.h
*
* This include file contains all the private support information for
* POSIX condition variables.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h
#define __RTEMS_POSIX_CONDITION_VARIABLES_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/object.h>
#include <rtems/score/threadq.h>
/*
* Constant to indicate condition variable does not currently have
* a mutex assigned to it.
*/
#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
/*
* Data Structure used to manage a POSIX condition variable
*/
typedef struct {
Objects_Control Object;
int process_shared;
pthread_mutex_t Mutex;
Thread_queue_Control Wait_queue;
} POSIX_Condition_variables_Control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
/*
* _POSIX_Condition_variables_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Condition_variables_Manager_initialization(
unsigned32 maximum_condition_variables
);
/*
* _POSIX_Condition_variables_Allocate
*
* DESCRIPTION:
*
* This function allocates a condition variable control block from
* the inactive chain of free condition variable control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
_POSIX_Condition_variables_Allocate( void );
/*
* _POSIX_Condition_variables_Free
*
* DESCRIPTION:
*
* This routine frees a condition variable control block to the
* inactive chain of free condition variable control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
);
/*
* _POSIX_Condition_variables_Get
*
* DESCRIPTION:
*
* This function maps condition variable IDs to condition variable control
* blocks. If ID corresponds to a local condition variable, then it returns
* the_condition variable control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the condition variable ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_condition variable is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_condition variable is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
);
/*
* _POSIX_Condition_variables_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_condition variable is NULL
* and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
);
#include <rtems/posix/cond.inl>
#include <rtems/posix/condmp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,162 @@
/* condmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Condition Variable Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
/*
* The following enumerated type defines the list of
* remote condition variable operations.
*/
typedef enum {
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0,
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1,
POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2,
POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3,
POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4,
POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5,
POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6,
} POSIX_Condition_variables_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote condition variable operations.
*/
typedef struct {
MP_packet_Prefix Prefix;
POSIX_Condition_variables_MP_Remote_operations operation;
Objects_Name name;
boolean wait; /* XXX options */
Objects_Id proxy_id;
} POSIX_Condition_variables_MP_Packet;
/*
* _POSIX_Condition_variables_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*/
void _POSIX_Condition_variables_MP_Send_process_packet (
POSIX_Condition_variables_MP_Remote_operations operation,
Objects_Id condition_variables_id,
Objects_Name name,
Objects_Id proxy_id
);
/*
* _POSIX_Condition_variables_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
int _POSIX_Condition_variables_MP_Send_request_packet (
POSIX_Condition_variables_MP_Remote_operations operation,
Objects_Id condition_variables_id,
boolean wait, /* XXX options */
Watchdog_Interval timeout
);
/*
* _POSIX_Condition_variables_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _POSIX_Condition_variables_MP_Send_response_packet (
POSIX_Condition_variables_MP_Remote_operations operation,
Objects_Id condition_variables_id,
Thread_Control *the_thread
);
/*
*
* _POSIX_Condition_variables_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _POSIX_Condition_variables_MP_Process_packet (
MP_packet_Prefix *the_packet_prefix
);
/*
* _POSIX_Condition_variables_MP_Send_object_was_deleted
*
* DESCRIPTION:
*
* This routine is invoked indirectly by the thread queue
* when a proxy has been removed from the thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Condition_variables_MP_Send_object_was_deleted (
Thread_Control *the_proxy
);
/*
* _POSIX_Condition_variables_MP_Send_extract_proxy
*
* DESCRIPTION:
*
* This routine is invoked when a task is deleted and it
* has a proxy which must be removed from a thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Condition_variables_MP_Send_extract_proxy (
Thread_Control *the_thread
);
/*
* _POSIX_Condition_variables_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a condition variable mp packet.
*/
POSIX_Condition_variables_MP_Packet
*_POSIX_Condition_variables_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -0,0 +1,59 @@
/* config.h
*
* This include file contains the table of user defined configuration
* parameters specific for the POSIX API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CONFIGURATION_h
#define __RTEMS_POSIX_CONFIGURATION_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* XXX
*
* The following records define the Configuration Table. The
* information contained in this table is required in all
* RTEMS systems, whether single or multiprocessor. This
* table primarily defines the following:
*
* + required number of each object type
*/
/*
* For now, we are only allowing the user to specify the entry point
* for posix initialization threads.
*/
typedef struct {
void *(*entry)(void *);
} posix_initialization_threads_table;
typedef struct {
int maximum_threads;
int maximum_mutexes;
int maximum_condition_variables;
int maximum_keys;
int maximum_queued_signals;
int number_of_initialization_threads;
posix_initialization_threads_table *User_initialization_threads_table;
} posix_api_configuration_table;
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,154 @@
/* rtems/posix/intr.h
*
* This include file contains all the private support information for
* POSIX Interrupt Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_KEY_h
#define __RTEMS_POSIX_KEY_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/isr.h>
#include <rtems/score/object.h>
/*
* Data Structure used to manage each POSIX Interrupt Vector
*/
typedef struct {
int number_installed;
int lock_count;
int deferred_count;
Chain_Control Handlers;
} POSIX_Interrupt_Control;
/*
* Data Structure used to manage a POSIX Interrupt Handler
*/
typedef struct {
Objects_Control Object;
int is_active;
intr_t vector;
Thread_Control *server;
int (*handler)( void *area );
volatile void *user_data_area;
} POSIX_Interrupt_Handler_control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
/*
* The following is an array which is used to manage the set of
* interrupt handlers installed on each vector.
*/
POSIX_EXTERN POSIX_Interrupt_Control
_POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
/*
* _POSIX_Interrupt_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Interrupt_Manager_initialization(
unsigned32 maximum_interrupt_handlers
);
/*
* _POSIX_Interrupt_Allocate
*
* DESCRIPTION:
*
* This function allocates a interrupt handler control block from
* the inactive chain of free interrupt handler control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void );
/*
* _POSIX_Interrupt_Free
*
* DESCRIPTION:
*
* This routine frees a interrupt handler control block to the
* inactive chain of free interrupt handler control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
);
/*
* _POSIX_Interrupt_Get
*
* DESCRIPTION:
*
* This function maps interrupt handler IDs to interrupt handler control
* blocks. If ID corresponds to a local interrupt handler, then it returns
* the_intr control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_intr is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_intr is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
);
/*
* _POSIX_Interrupt_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_intr is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
);
/*
* _POSIX_Interrupt_Handler
*
* DESCRIPTION:
*
* This function XXX.
*/
void _POSIX_Interrupt_Handler(
ISR_Vector_number vector
);
#include <rtems/posix/intr.inl>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,136 @@
/* rtems/posix/key.h
*
* This include file contains all the private support information for
* POSIX key.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_KEY_h
#define __RTEMS_POSIX_KEY_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* Data Structure used to manage a POSIX key
*
* NOTE: The Values is a table indexed by the index portion of the
* ID of the currently executing thread.
*/
typedef struct {
Objects_Control Object;
boolean is_active;
void (*destructor)( void * );
void **Values[ OBJECTS_CLASSES_LAST_THREAD_CLASS + 1 ];
} POSIX_Keys_Control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
/*
* _POSIX_Keys_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Key_Manager_initialization(
unsigned32 maximum_keys
);
/*
* _POSIX_Keys_Run_destructors
*
* DESCRIPTION:
*
* This function executes all the destructors associated with the thread's
* keys. This function will execute until all values have been set to NULL.
*
* NOTE: This is the routine executed when a thread exits to
* run through all the keys and do the destructor action.
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
);
/*
* _POSIX_Keys_Allocate
*
* DESCRIPTION:
*
* This function allocates a keys control block from
* the inactive chain of free keys control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
/*
* _POSIX_Keys_Free
*
* DESCRIPTION:
*
* This routine frees a keys control block to the
* inactive chain of free keys control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
);
/*
* _POSIX_Keys_Get
*
* DESCRIPTION:
*
* This function maps key IDs to key control blocks.
* If ID corresponds to a local keys, then it returns
* the_key control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the keys ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_key is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_key is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
);
/*
* _POSIX_Keys_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_key is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
);
#include <rtems/posix/key.inl>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,186 @@
/* rtems/posix/mqueue.h
*
* This include file contains all the private support information for
* POSIX Message Queues.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
#define __RTEMS_POSIX_MESSAGE_QUEUE_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/coremsg.h>
#include <rtems/score/object.h>
/*
* Data Structure used to manage a POSIX message queue
*/
typedef struct {
Objects_Control Object;
int process_shared;
int flags;
boolean named;
boolean linked;
boolean blocking;
unsigned32 open_count;
CORE_message_queue_Control Message_queue;
struct sigevent notification;
} POSIX_Message_queue_Control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
/*
* _POSIX_Message_queue_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Message_queue_Manager_initialization(
unsigned32 maximum_message_queues
);
/*
*
* _POSIX_Message_queue_Create_support
*
* DESCRIPTION:
*
* This routine performs the creation of a message queue utilizing the
* core message queue.
*/
int _POSIX_Message_queue_Create_support(
const char *name,
int pshared,
unsigned int oflag,
struct mq_attr *attr,
POSIX_Message_queue_Control **message_queue
);
/*
*
* _POSIX_Message_queue_Send_support
*
* DESCRIPTION:
*
* This routine posts a message to a specified message queue.
*/
int _POSIX_Message_queue_Send_support(
mqd_t mqdes,
const char *msg_ptr,
unsigned32 msg_len,
Priority_Control msg_prio,
Watchdog_Interval timeout
);
/*
* _POSIX_Message_queue_Allocate
*
* DESCRIPTION:
*
* This function allocates a message queue control block from
* the inactive chain of free message queue control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
/*
* _POSIX_Message_queue_Free
*
* DESCRIPTION:
*
* This routine frees a message queue control block to the
* inactive chain of free message queue control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
);
/*
* _POSIX_Message_queue_Get
*
* DESCRIPTION:
*
* This function maps message queue IDs to message queue control blocks.
* If ID corresponds to a local message queue, then it returns
* the_mq control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the message queue ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_message queue is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_mq is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
);
/*
* _POSIX_Message_queue_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
);
/*
* _POSIX_Message_queue_Name_to_id
*
* DESCRIPTION:
*
* XXX
*/
int _POSIX_Message_queue_Name_to_id(
const char *name,
Objects_Id *id
);
/*
* _POSIX_Message_queue_Priority_to_core
*
* DESCRIPTION:
*
* XXX
*/
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
);
#include <rtems/posix/mqueue.inl>
#include <rtems/posix/mqueuemp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,161 @@
/* mqueuemp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Message Queue Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
/*
* The following enumerated type defines the list of
* remote message queue operations.
*/
typedef enum {
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3,
POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4,
POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5,
POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6,
} POSIX_Message_queue_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote message queue operations.
*/
typedef struct {
MP_packet_Prefix Prefix;
POSIX_Message_queue_MP_Remote_operations operation;
Objects_Name name;
boolean wait; /* XXX options */
Objects_Id proxy_id;
} POSIX_Message_queue_MP_Packet;
/*
* _POSIX_Message_queue_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*/
void _POSIX_Message_queue_MP_Send_process_packet (
POSIX_Message_queue_MP_Remote_operations operation,
Objects_Id mq_id,
Objects_Name name,
Objects_Id proxy_id
);
/*
* _POSIX_Message_queue_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
int _POSIX_Message_queue_MP_Send_request_packet (
POSIX_Message_queue_MP_Remote_operations operation,
Objects_Id mq_id,
boolean wait, /* XXX options */
Watchdog_Interval timeout
);
/*
* _POSIX_Message_queue_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _POSIX_Message_queue_MP_Send_response_packet (
POSIX_Message_queue_MP_Remote_operations operation,
Objects_Id mq_id,
Thread_Control *the_thread
);
/*
*
* _POSIX_Message_queue_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _POSIX_Message_queue_MP_Process_packet (
MP_packet_Prefix *the_packet_prefix
);
/*
* _POSIX_Message_queue_MP_Send_object_was_deleted
*
* DESCRIPTION:
*
* This routine is invoked indirectly by the thread queue
* when a proxy has been removed from the thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Message_queue_MP_Send_object_was_deleted (
Thread_Control *the_proxy
);
/*
* _POSIX_Message_queue_MP_Send_extract_proxy
*
* DESCRIPTION:
*
* This routine is invoked when a task is deleted and it
* has a proxy which must be removed from a thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Message_queue_MP_Send_extract_proxy (
Thread_Control *the_thread
);
/*
* _POSIX_Message_queue_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a message queue mp packet.
*/
POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -0,0 +1,120 @@
/* rtems/posix/mutex.h
*
* This include file contains all the private support information for
* POSIX mutex's.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MUTEX_h
#define __RTEMS_POSIX_MUTEX_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/coremutex.h>
#include <pthread.h>
/*
* Data Structure used to manage a POSIX mutex
*/
typedef struct {
Objects_Control Object;
int process_shared;
CORE_mutex_Control Mutex;
} POSIX_Mutex_Control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
/*
* _POSIX_Mutex_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Mutex_Manager_initialization(
unsigned32 maximum_mutexes
);
/*
* _POSIX_Mutex_Allocate
*
* DESCRIPTION:
*
* This function allocates a mutexes control block from
* the inactive chain of free mutexes control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
/*
* _POSIX_Mutex_Free
*
* DESCRIPTION:
*
* This routine frees a mutexes control block to the
* inactive chain of free mutexes control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
);
/*
* _POSIX_Mutex_Get
*
* DESCRIPTION:
*
* This function maps mutexes IDs to mutexes control blocks.
* If ID corresponds to a local mutexes, then it returns
* the_mutex control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the mutexes ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_mutex is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_mutex is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
Objects_Id *id,
Objects_Locations *location
);
/*
* _POSIX_Mutex_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_mutex is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
);
#include <rtems/posix/mutex.inl>
#include <rtems/posix/mutexmp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,161 @@
/* mutexmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Mutex Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MUTEX_MP_h
#define __RTEMS_POSIX_MUTEX_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
/*
* The following enumerated type defines the list of
* remote mutex operations.
*/
typedef enum {
POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0,
POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1,
POSIX_MUTEX_MP_EXTRACT_PROXY = 2,
POSIX_MUTEX_MP_OBTAIN_REQUEST = 3,
POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4,
POSIX_MUTEX_MP_RELEASE_REQUEST = 5,
POSIX_MUTEX_MP_RELEASE_RESPONSE = 6,
} POSIX_Mutex_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote mutex operations.
*/
typedef struct {
MP_packet_Prefix Prefix;
POSIX_Mutex_MP_Remote_operations operation;
Objects_Name name;
boolean wait; /* XXX options */
Objects_Id proxy_id;
} POSIX_Mutex_MP_Packet;
/*
* _POSIX_Mutex_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*/
void _POSIX_Mutex_MP_Send_process_packet (
POSIX_Mutex_MP_Remote_operations operation,
Objects_Id mutex_id,
Objects_Name name,
Objects_Id proxy_id
);
/*
* _POSIX_Mutex_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
int _POSIX_Mutex_MP_Send_request_packet (
POSIX_Mutex_MP_Remote_operations operation,
Objects_Id mutex_id,
boolean wait, /* XXX options */
Watchdog_Interval timeout
);
/*
* _POSIX_Mutex_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _POSIX_Mutex_MP_Send_response_packet (
POSIX_Mutex_MP_Remote_operations operation,
Objects_Id mutex_id,
Thread_Control *the_thread
);
/*
*
* _POSIX_Mutex_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _POSIX_Mutex_MP_Process_packet (
MP_packet_Prefix *the_packet_prefix
);
/*
* _POSIX_Mutex_MP_Send_object_was_deleted
*
* DESCRIPTION:
*
* This routine is invoked indirectly by the thread queue
* when a proxy has been removed from the thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Mutex_MP_Send_object_was_deleted (
Thread_Control *the_proxy
);
/*
* _POSIX_Mutex_MP_Send_extract_proxy
*
* DESCRIPTION:
*
* This routine is invoked when a task is deleted and it
* has a proxy which must be removed from a thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Mutex_MP_Send_extract_proxy (
Thread_Control *the_thread
);
/*
* _POSIX_Mutex_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a mutex mp packet.
*/
POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -0,0 +1,34 @@
/*
* POSIX API Support
*
* NOTE:
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __POSIX_API_h
#define __POSIX_API_h
#include <rtems/config.h>
/*PAGE
*
* _POSIX_API_Initialize
*
* XXX
*/
void _POSIX_API_Initialize(
rtems_configuration_table *configuration_table
);
#endif
/* end of include file */

View File

@@ -0,0 +1,38 @@
/*
*
*
* $Id$
*/
#ifndef __RTEMS_POSIX_PRIORITY_h
#define __RTEMS_POSIX_PRIORITY_h
#include <rtems/score/priority.h>
/*
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19
*
* "Numericallly higher values represent higher priorities."
*
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
*/
#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (255)
#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
);
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
);
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
);
#include <rtems/posix/priority.inl>
#endif

View File

@@ -0,0 +1,17 @@
/*
* $Id$
*/
#ifndef __POSIX_SIGNALS_h
#define __POSIX_SIGNALS_h
void _POSIX_signals_Manager_Initialization(
int maximum_queued_signals
);
void _POSIX_signals_Post_switch_extension(
Thread_Control *the_thread
);
#endif
/* end of file */

View File

@@ -0,0 +1,123 @@
/* rtems/posix/pthread.h
*
* This include file contains all the private support information for
* POSIX threads.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_THREADS_h
#define __RTEMS_POSIX_THREADS_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/posix/config.h>
#include <rtems/posix/threadsup.h>
#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2)
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
/*
* These are used to manage the user initialization threads.
*/
POSIX_EXTERN posix_initialization_threads_table
*_POSIX_Threads_User_initialization_threads;
POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads;
/*
* _POSIX_Threads_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Threads_Manager_initialization(
unsigned32 maximum_pthreads,
unsigned32 number_of_initialization_threads,
posix_initialization_threads_table *user_threads
);
/*
* _POSIX_Threads_Allocate
*
* DESCRIPTION:
*
* This function allocates a pthread control block from
* the inactive chain of free pthread control blocks.
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
/*
* _POSIX_Threads_Free
*
* DESCRIPTION:
*
* This routine frees a pthread control block to the
* inactive chain of free pthread control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
Thread_Control *the_pthread
);
/*
* _POSIX_Threads_Get
*
* DESCRIPTION:
*
* This function maps pthread IDs to pthread control blocks.
* If ID corresponds to a local pthread, then it returns
* the_pthread control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the pthread ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_pthread is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_pthread is undefined.
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
pthread_t id,
Objects_Locations *location
);
/*
* _POSIX_Threads_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_pthread is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
Thread_Control *the_pthread
);
#include <rtems/posix/pthread.inl>
#include <rtems/posix/pthreadmp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,161 @@
/* pthreadmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Threads Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_THREADS_MP_h
#define __RTEMS_POSIX_THREADS_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
/*
* The following enumerated type defines the list of
* remote pthread operations.
*/
typedef enum {
POSIX_THREADS_MP_ANNOUNCE_CREATE = 0,
POSIX_THREADS_MP_ANNOUNCE_DELETE = 1,
POSIX_THREADS_MP_EXTRACT_PROXY = 2,
POSIX_THREADS_MP_OBTAIN_REQUEST = 3,
POSIX_THREADS_MP_OBTAIN_RESPONSE = 4,
POSIX_THREADS_MP_RELEASE_REQUEST = 5,
POSIX_THREADS_MP_RELEASE_RESPONSE = 6
} POSIX_Threads_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote pthread operations.
*/
typedef struct {
MP_packet_Prefix Prefix;
POSIX_Threads_MP_Remote_operations operation;
Objects_Name name;
boolean wait;
Objects_Id proxy_id;
} POSIX_Threads_MP_Packet;
/*
* _POSIX_Threads_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*/
void _POSIX_Threads_MP_Send_process_packet (
POSIX_Threads_MP_Remote_operations operation,
Objects_Id pthread_id,
Objects_Name name,
Objects_Id proxy_id
);
/*
* _POSIX_Threads_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
int _POSIX_Threads_MP_Send_request_packet (
POSIX_Threads_MP_Remote_operations operation,
Objects_Id pthread_id,
boolean wait,
Watchdog_Interval timeout
);
/*
* _POSIX_Threads_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _POSIX_Threads_MP_Send_response_packet (
POSIX_Threads_MP_Remote_operations operation,
Objects_Id pthread_id,
Thread_Control *the_thread
);
/*
*
* _POSIX_Threads_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _POSIX_Threads_MP_Process_packet (
MP_packet_Prefix *the_packet_prefix
);
/*
* _POSIX_Threads_MP_Send_object_was_deleted
*
* DESCRIPTION:
*
* This routine is invoked indirectly by the thread queue
* when a proxy has been removed from the thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Threads_MP_Send_object_was_deleted (
Thread_Control *the_proxy
);
/*
* _POSIX_Threads_MP_Send_extract_proxy
*
* DESCRIPTION:
*
* This routine is invoked when a task is deleted and it
* has a proxy which must be removed from a thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Threads_MP_Send_extract_proxy (
Thread_Control *the_thread
);
/*
* _POSIX_Threads_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a pthread mp packet.
*/
POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -0,0 +1,135 @@
/* rtems/posix/semaphore.h
*
* This include file contains all the private support information for
* POSIX Semaphores.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_SEMAPHORE_h
#define __RTEMS_POSIX_SEMAPHORE_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/coresem.h>
/*
* Data Structure used to manage a POSIX semaphore
*/
typedef struct {
Objects_Control Object;
int process_shared;
boolean named;
boolean linked;
unsigned32 open_count;
CORE_semaphore_Control Semaphore;
} POSIX_Semaphore_Control;
/*
* The following defines the information control block used to manage
* this class of objects.
*/
POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
/*
* _POSIX_Semaphore_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _POSIX_Semaphore_Manager_initialization(
unsigned32 maximum_semaphorees
);
/*
* _POSIX_Semaphore_Allocate
*
* DESCRIPTION:
*
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
/*
* _POSIX_Semaphore_Free
*
* DESCRIPTION:
*
* This routine frees a semaphore control block to the
* inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
);
/*
* _POSIX_Semaphore_Get
*
* DESCRIPTION:
*
* This function maps semaphore IDs to semaphore control blocks.
* If ID corresponds to a local semaphore, then it returns
* the_semaphore control pointer which maps to ID and location
* is set to OBJECTS_LOCAL. if the semaphore ID is global and
* resides on a remote node, then location is set to OBJECTS_REMOTE,
* and the_semaphore is undefined. Otherwise, location is set
* to OBJECTS_ERROR and the_semaphore is undefined.
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
);
/*
* _POSIX_Semaphore_Is_null
*
* DESCRIPTION:
*
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
);
/*
* _POSIX_Semaphore_Name_to_id
*
* DESCRIPTION:
*
* XXX
*/
int _POSIX_Semaphore_Name_to_id(
const char *name,
Objects_Id *id
);
#include <rtems/posix/semaphore.inl>
#include <rtems/posix/semaphoremp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,161 @@
/* semaphoremp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Semaphore Manager.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_SEMAPHORE_MP_h
#define __RTEMS_POSIX_SEMAPHORE_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
/*
* The following enumerated type defines the list of
* remote semaphore operations.
*/
typedef enum {
POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2,
POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3,
POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5,
POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6,
} POSIX_Semaphore_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote semaphore operations.
*/
typedef struct {
MP_packet_Prefix Prefix;
POSIX_Semaphore_MP_Remote_operations operation;
Objects_Name name;
boolean wait; /* XXX options */
Objects_Id proxy_id;
} POSIX_Semaphore_MP_Packet;
/*
* _POSIX_Semaphore_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*/
void _POSIX_Semaphore_MP_Send_process_packet (
POSIX_Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
Objects_Name name,
Objects_Id proxy_id
);
/*
* _POSIX_Semaphore_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
int _POSIX_Semaphore_MP_Send_request_packet (
POSIX_Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
boolean wait, /* XXX options */
Watchdog_Interval timeout
);
/*
* _POSIX_Semaphore_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _POSIX_Semaphore_MP_Send_response_packet (
POSIX_Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
Thread_Control *the_thread
);
/*
*
* _POSIX_Semaphore_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _POSIX_Semaphore_MP_Process_packet (
MP_packet_Prefix *the_packet_prefix
);
/*
* _POSIX_Semaphore_MP_Send_object_was_deleted
*
* DESCRIPTION:
*
* This routine is invoked indirectly by the thread queue
* when a proxy has been removed from the thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Semaphore_MP_Send_object_was_deleted (
Thread_Control *the_proxy
);
/*
* _POSIX_Semaphore_MP_Send_extract_proxy
*
* DESCRIPTION:
*
* This routine is invoked when a task is deleted and it
* has a proxy which must be removed from a thread queue and
* the remote node must be informed of this.
*/
void _POSIX_Semaphore_MP_Send_extract_proxy (
Thread_Control *the_thread
);
/*
* _POSIX_Semaphore_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a semaphore mp packet.
*/
POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -0,0 +1,20 @@
/*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __POSIX_SET_ERRNO_h
#define __POSIX_SET_ERRNO_h
#define set_errno_and_return_minus_one( _error ) \
{ errno = (_error); return -1; }
#endif
/* end of include file */

View File

@@ -0,0 +1,46 @@
/* threadsup.h
*
* $Id$
*/
#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h
#define __RTEMS_POSIX_THREAD_SUPPORT_h
#include <rtems/score/coresem.h>
#include <rtems/score/tqdata.h>
typedef struct {
pthread_attr_t Attributes;
int detachstate;
Thread_queue_Control Join_List;
int schedpolicy;
struct sched_param schedparam;
int ss_high_priority;
Watchdog_Control Sporadic_timer;
sigset_t signals_blocked;
sigset_t signals_pending;
#if 0
/*
* POSIX Interrupts
*/
unsigned32 interrupts_installed;
CORE_semaphore_Control Interrupt_Semaphore;
#endif
#if 0
/*
* POSIX Cancelability
*/
int cancelability_state;
int cancelability_type;
int cancelation_requested;
Chain_Control Cancellation_Handlers;
#endif
} POSIX_API_Control;
#endif
/* end of include file */

View File

@@ -0,0 +1,50 @@
/*
*
*
* $Id$
*/
#ifndef __RTEMS_POSIX_TIME_h
#define __RTEMS_POSIX_TIME_h
#include <rtems/score/tod.h>
/*
* Seconds from January 1, 1970 to January 1, 1988. Used to account for
* differences between POSIX API and RTEMS core.
*/
#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
(((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
(4 * TOD_SECONDS_PER_DAY))
/*PAGE
*
* _POSIX_Timespec_subtract
*/
void _POSIX_Timespec_subtract(
const struct timespec *the_start,
const struct timespec *end,
struct timespec *result
);
/*
* _POSIX_Timespec_to_interval
*/
Watchdog_Interval _POSIX_Timespec_to_interval(
const struct timespec *time
);
/*PAGE
*
* _POSIX_Interval_to_timespec
*/
void _POSIX_Interval_to_timespec(
Watchdog_Interval ticks,
struct timespec *time
);
#endif

View File

@@ -0,0 +1,137 @@
/* aio.h
*
* $Id$
*/
#ifndef __POSIX_ASYNCHRONOUS_IO_h
#define __POSIX_ASYNCHRONOUS_IO_h
#include <rtems/posix/features.h>
#if defined(_POSIX_ASYNCHRONOUS_IO)
/*
* 6.7.1 Data Definitions for Asynchronous Input and Output,
* P1003.1b-1993, p. 151
*/
#include <sys/types.h>
#include <signal.h>
#include <time.h>
#include <fcntl.h>
/*
* 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
*/
#define AIO_CANCELED 0 /* all requested operations have been canceled */
#define AIO_NOTCANCELED 0 /* some of the operations could not be canceled */
/* since they are in progress */
#define AIO_ALLDONE 0 /* none of the requested operations could be */
/* canceled since they are already complete */
/* lio_listio() options */
#define LIO_WAIT 0 /* calling process is to suspend until the */
/* operation is complete */
#define LIO_NOWAIT 0 /* calling process is to continue execution while */
/* the operation is performed and no notification */
/* shall be given when the operation is completed */
#define LIO_READ 0 /* request a read() */
#define LIO_WRITE 0 /* request a write() */
#define LIO_NOP 0 /* no transfer is requested */
/*
* 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
*/
struct aiocb {
int aio_fildes; /* File descriptor */
off_t aio_offset; /* File offset */
volatile void *aio_buf; /* Location of buffer */
size_t aio_nbytes; /* Length of transfer */
int aio_reqprio; /* Request priority offset */
struct sigevent aio_sigevent; /* Signal number and value */
int aoi_lio_opcode; /* Operation to be performed */
};
/*
* 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
*/
int aio_read(
struct aiocb *aiocbp
);
/*
* 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
*/
int aio_write(
struct aiocb *aiocbp
);
/*
* 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
*/
int lio_listio(
int mode,
struct aiocb * const list[],
int nent,
struct sigevent *sig
);
/*
* 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
*/
int aio_error(
const struct aiocb *aiocbp
);
/*
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
* P1003.1b-1993, p. 162
*/
int aio_return(
const struct aiocb *aiocbp
);
/*
* 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
*/
int aio_cancel(
int filedes,
struct aiocb *aiocbp
);
/*
* 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
*/
int aio_suspend(
struct aiocb * const list[],
int nent,
const struct timespec *timeout
);
#if defined(_POSIX_SYNCHRONIZED_IO)
/*
* 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
*/
int aio_fsync(
int op,
struct aiocb *aiocbp
);
#endif /* _POSIX_SYNCHRONIZED_IO */
#endif /* _POSIX_ASYNCHRONOUS_IO */
#endif
/* end of include file */

View File

@@ -0,0 +1,30 @@
/* devctl.h
*
* $Id$
*/
#ifndef __POSIX_DEVICE_CONTROL_h
#define __POSIX_DEVICE_CONTROL_h
#include <rtems/posix/features.h>
#if defined(_POSIX_DEVICE_CONTROL)
#include <sys/types.h>
#include <unistd.h>
/*
* 21.2.1 Control a Device, P1003.4b/D8, p. 65
*/
int devctl(
int filedes,
void *dev_data_ptr,
size_t nbyte,
int *dev_info_ptr
);
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,72 @@
/* intr.h
*
* XXX: It is unclear if the type "intr_t" should be defined when
* _POSIX_INTERRUPT_CONTROL is not.
*
* $Id$
*/
#ifndef __POSIX_INTERRUPTS_h
#define __POSIX_INTERRUPTS_h
#include <rtems/posix/features.h>
#include <sys/types.h>
#include <sys/time.h>
#if defined(_POSIX_INTERRUPT_CONTROL)
/*
* 22.2 Concepts, P1003.4b/D8, p. 73
*/
typedef int intr_t;
/*
* 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
*/
/*
* Return codes from an interrupt handler
*/
#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
/* the thread that registered the */
/* ISR that the interrupt occurred. */
#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
/* do NOT perform notification. */
#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
/* let the next handler try. */
int intr_capture(
intr_t intr,
int (*intr_handler)( void *area ),
volatile void *area,
size_t areasize
);
int intr_release(
intr_t intr,
int (*intr_handler)( void *area )
);
int intr_lock(
intr_t intr
);
int intr_unlock(
intr_t intr
);
/*
* 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
*/
int intr_timed_wait(
int flags,
const struct timespec *timeout
);
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,145 @@
/* mqueue.h
*
* $Id$
*/
#ifndef __POSIX_MESSAGE_QUEUE_h
#define __POSIX_MESSAGE_QUEUE_h
#include <rtems/posix/features.h>
#if defined(_POSIX_MESSAGE_PASSING)
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
/*
* 15.1.1 Data Structures, P1003.1b-1993, p. 271
*/
typedef Objects_Id mqd_t;
struct mq_attr {
long mq_flags; /* Message queue flags */
long mq_maxmsg; /* Maximum number of messages */
long mq_msgsize; /* Maximum message size */
long mq_curmsgs; /* Number of messages currently queued */
};
/*
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
*/
mqd_t mq_open(
const char *name,
int oflag,
...
);
/*
* 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
*/
int mq_close(
mqd_t mqdes
);
/*
* 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
*/
int mq_unlink(
const char *name
);
/*
* 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
*
* NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
*/
int mq_send(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio
);
#if defined(_POSIX_TIMEOUTS)
#include <time.h>
int mq_timedsend(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
/*
* 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
*
* NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
*/
ssize_t mq_receive(
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio
);
#if defined(_POSIX_TIMEOUTS)
int mq_timedreceive( /* XXX: should this be ssize_t */
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
#if defined(_POSIX_REALTIME_SIGNALS)
/*
* 15.2.6 Notify Process that a Message is Available on a Queue,
* P1003.1b-1993, p. 280
*/
int mq_notify(
mqd_t mqdes,
const struct sigevent *notification
);
#endif /* _POSIX_REALTIME_SIGNALS */
/*
* 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
*/
int mq_setattr(
mqd_t mqdes,
const struct mq_attr *mqstat,
struct mq_attr *omqstat
);
/*
* 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
*/
int mq_getattr(
mqd_t mqdes,
struct mq_attr *mqstat
);
#endif /* _POSIX_MESSAGE_PASSING */
#endif
/* end of include file */

View File

@@ -0,0 +1,500 @@
/* pthread.h
*
* $Id$
*/
#ifndef __PTHREAD_h
#define __PTHREAD_h
#include <sys/features.h>
#if defined(_POSIX_THREADS)
#include <sys/types.h>
#include <time.h>
#include <sys/sched.h>
/*
* 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."
*/
/*
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
*/
int pthread_mutexattr_init(
pthread_mutexattr_t *attr
);
int pthread_mutexattr_destroy(
pthread_mutexattr_t *attr
);
int pthread_mutexattr_getpshared(
const pthread_mutexattr_t *attr,
int *pshared
);
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
);
/*
* 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
*/
int pthread_mutex_init(
pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr
);
int pthread_mutex_destroy(
pthread_mutex_t *mutex
);
/*
* This is used to statically initialize a pthread_mutex_t. Example:
*
* pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
*/
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
/*
* 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
);
int pthread_mutex_trylock(
pthread_mutex_t *mutex
);
int pthread_mutex_unlock(
pthread_mutex_t *mutex
);
#if defined(_POSIX_TIMEOUTS)
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *timeout
);
#endif /* _POSIX_TIMEOUTS */
/*
* 11.4.1 Condition Variable Initialization Attributes,
* P1003.1c/Draft 10, p. 96
*/
int pthread_condattr_init(
pthread_condattr_t *attr
);
int pthread_condattr_destroy(
pthread_condattr_t *attr
);
int pthread_condattr_getpshared(
const pthread_condattr_t *attr,
int *pshared
);
int pthread_condattr_setpshared(
pthread_condattr_t *attr,
int pshared
);
/*
* 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
);
int pthread_cond_destroy(
pthread_cond_t *mutex
);
/*
* This is used to statically initialize a pthread_cond_t. Example:
*
* pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
*/
#define PTHREAD_COND_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
/*
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
*/
int pthread_cond_signal(
pthread_cond_t *cond
);
int pthread_cond_broadcast(
pthread_cond_t *cond
);
/*
* 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
);
int pthread_cond_timedwait(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime
);
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
/*
* 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
*/
int pthread_attr_setscope(
pthread_attr_t *attr,
int contentionscope
);
int pthread_attr_getscope(
const pthread_attr_t *attr,
int *contentionscope
);
int pthread_attr_setinheritsched(
pthread_attr_t *attr,
int inheritsched
);
int pthread_attr_getinheritsched(
const pthread_attr_t *attr,
int *inheritsched
);
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
);
int pthread_attr_getschedpolicy(
const pthread_attr_t *attr,
int *policy
);
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
int pthread_attr_setschedparam(
pthread_attr_t *attr,
const struct sched_param *param
);
int pthread_attr_getschedparam(
const pthread_attr_t *attr,
struct sched_param *param
);
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
/*
* 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
);
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
);
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
*/
int pthread_mutexattr_setprotocol(
pthread_mutexattr_t *attr,
int protocol
);
int pthread_mutexattr_getprotocol(
const pthread_mutexattr_t *attr,
int *protocol
);
int pthread_mutexattr_setprioceiling(
pthread_mutexattr_t *attr,
int prioceiling
);
int pthread_mutexattr_getprioceiling(
const pthread_mutexattr_t *attr,
int *prioceiling
);
#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
#if defined(_POSIX_THREAD_PRIO_PROTECT)
/*
* 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
);
int pthread_mutex_getprioceiling(
pthread_mutex_t *mutex,
int *prioceiling
);
#endif /* _POSIX_THREAD_PRIO_PROTECT */
/*
* 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
*/
int pthread_attr_init(
pthread_attr_t *attr
);
int pthread_attr_destroy(
pthread_attr_t *attr
);
int pthread_attr_getstacksize(
const pthread_attr_t *attr,
size_t *stacksize
);
int pthread_attr_setstacksize(
pthread_attr_t *attr,
size_t stacksize
);
int pthread_attr_getstackaddr(
const pthread_attr_t *attr,
void **stackaddr
);
int pthread_attr_setstackaddr(
pthread_attr_t *attr,
void *stackaddr
);
int pthread_attr_getdetachstate(
const pthread_attr_t *attr,
int *detachstate
);
int pthread_attr_setdetachstate(
pthread_attr_t *attr,
int detachstate
);
/*
* 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
);
/*
* 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
*/
int pthread_join(
pthread_t thread,
void **value_ptr
);
/*
* 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
*/
int pthread_detach(
pthread_t thread
);
/*
* 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
*/
void pthread_exit(
void *value_ptr
);
/*
* 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX
*/
pthread_t pthread_self( void );
/*
* 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
*/
int pthread_equal(
pthread_t t1,
pthread_t t2
);
/*
* 16.1.8 Dynamic Package Initialization
*/
/*
* This is used to statically initialize a pthread_once_t. Example:
*
* pthread_once_t once = PTHREAD_ONCE_INIT;
*
* NOTE: This is named inconsistently -- it should be INITIALIZER.
*/
#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
);
/*
* 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 * )
);
/*
* 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
*/
int pthread_setspecific(
pthread_key_t key,
const void *value
);
void *pthread_getspecific(
pthread_key_t key
);
/*
* 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
*/
int pthread_key_delete(
pthread_key_t key
);
/*
* 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
*/
#define PTHREAD_CANCEL_ENABLE 0
#define PTHREAD_CANCEL_DISABLE 1
#define PTHREAD_CANCEL_DEFERRED 0
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
int pthread_cancel(
pthread_t thread
);
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
int pthread_setcancelstate(
int state,
int *oldstate
);
int pthread_setcanceltype(
int type,
int *oldtype
);
void pthread_testcancel( void );
/*
* 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
*/
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
);
void pthread_cleanup_pop(
int execute
);
#if defined(_POSIX_THREAD_CPUTIME)
/*
* 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58
*/
int pthread_getcpuclockid(
pthread_t thread_id,
clockid_t *clock_id
);
/*
* 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59
*/
int pthread_attr_setcputime(
pthread_attr_t *attr,
int clock_allowed
);
int pthread_attr_getcputime(
pthread_attr_t *attr,
int *clock_allowed
);
#endif /* defined(_POSIX_THREAD_CPUTIME) */
#endif /* defined(_POSIX_THREADS) */
#endif
/* end of include file */

View File

@@ -0,0 +1,88 @@
/* sched.h
*
* $Id$
*/
#ifndef __POSIX_SCHEDULING_h
#define __POSIX_SCHEDULING_h
#include <sys/features.h>
#if defined(_POSIX_PRIORITY_SCHEDULING)
#include <sys/types.h>
#include <time.h>
#include <sys/sched.h>
#include <pthread.h>
/*
* 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
*
*/
int sched_setparam(
pid_t pid,
const struct sched_param *param
);
/*
* 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
*/
int sched_getparam(
pid_t pid,
const struct sched_param *param
);
/*
* 13.3.3 Set Scheduling Policy and Scheduling Parameters,
* P1003.1b-1993, p. 254
*/
int sched_setscheduler(
pid_t pid,
int policy,
const struct sched_param *param
);
/*
* 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
*/
int sched_getscheduler(
pid_t pid
);
/*
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_max(
int policy
);
int sched_get_priority_min(
int policy
);
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
);
#endif /* _POSIX_PRIORITY_SCHEDULING */
#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
/*
* 13.3.5 Yield Processor, P1003.1b-1993, p. 257
*/
int sched_yield( void );
#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
#endif
/* end of include file */

View File

@@ -0,0 +1,108 @@
/* semaphore.h
*
* $Id$
*/
#ifndef __POSIX_SEMAPHORE_h
#define __POSIX_SEMAPHORE_h
#include <rtems/posix/features.h>
#if defined(_POSIX_SEMAPHORES)
#include <sys/time.h>
/*
* 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
*/
typedef int sem_t;
/*
* 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
*/
int sem_init(
sem_t *sem,
int pshared,
unsigned int value
);
/*
* 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
*/
int sem_destroy(
sem_t *sem
);
/*
* 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
*
* NOTE: Follows open() calling conventions.
*/
sem_t *sem_open(
const char *name,
int oflag,
...
);
/*
* 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
*/
int sem_close(
sem_t *sem
);
/*
* 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
*/
int sem_unlink(
const char *name
);
/*
* 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
*
* NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
*/
int sem_wait(
sem_t *sem
);
int sem_trywait(
sem_t *sem
);
#if defined(_POSIX_TIMEOUTS)
int sem_timedwait(
sem_t *sem,
const struct timespec *timeout
);
#endif
/*
* 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
*/
int sem_post(
sem_t *sem
);
/*
* 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
*/
int sem_getvalue(
sem_t *sem,
int *sval
);
#endif /* _POSIX_SEMAPHORES */
#endif
/* end of include file */

View File

@@ -0,0 +1,85 @@
/* unistd.h
*
* $Id$
*/
#ifndef __POSIX_UNISTD_h
#define __POSIX_UNISTD_h
#include <rtems/posix/features.h>
/*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
*
* NOTE: Table 4-2, Configurable System Variables, p. 96
*/
#define _SC_AIO_LISTIO_MAX 0
#define _SC_AIO_MAX 1
#define _SC_AIO_PRIO_DELTA_MAX 2
#define _SC_ARG_MAX 3
#define _SC_CHILD_MAX 4
#define _SC_CLK_TCK 5
#define _SC_DELAYTIMER_MAX 6
#define _SC_MQ_OPEN_MAX 7
#define _SC_MQ_PRIO_MAX 8
#define _SC_NGROUPS_MAX 9
#define _SC_OPEN_MAX 10
#define _SC_PAGESIZE 11
#define _SC_RTSIG_MAX 12
#define _SC_SEM_NSEMS_MAX 13
#define _SC_SEM_VALUE_MAX 14
#define _SC_SIGQUEUE_MAX 15
#define _SC_STREAM_MAX 16
#define _SC_TIMER_MAX 17
#define _SC_TZNAME_MAX 18
#define _SC_ASYNCHRONOUS_IO 19
#define _SC_FSYNC 20
#define _SC_JOB_CONTROL 21
#define _SC_MAPPED_FILES 22
#define _SC_MEMLOCK 23
#define _SC_MEMLOCK_RANGE 24
#define _SC_MEMORY_PROTECTION 25
#define _SC_MESSAGE_PASSING 26
#define _SC_PRIORITIZED_IO 27
#define _SC_REALTIME_SIGNALS 28
#define _SC_SAVED_IDS 29
#define _SC_SEMAPHORES 30
#define _SC_SHARED_MEMORY_OBJECTS 31
#define _SC_SYNCHRONIZED_IO 32
#define _SC_TIMERS 33
#define _SC_VERSION 34
/*
* P1003.1c/D10, p. 52 adds the following.
*/
#define _SC_GETGR_R_SIZE_MAX 35
#define _SC_GETPW_R_SIZE_MAX
#define _SC_LOGIN_NAME_MAX
#define _SC_THREAD_DESTRUCTOR_ITERATIONS
#define _SC_THREAD_KEYS_MAX
#define _SC_THREAD_STACK_MIN
#define _SC_THREAD_THREADS_MAX
#define _SC_TTY_NAME_MAX
#define _SC_THREADS
#define _SC_THREAD_ATTR_STACKADDR
#define _SC_THREAD_ATTR_STACKSIZE
#define _SC_THREAD_PRIORITY_SCHEDULING
#define _SC_THREAD_PRIO_INHERIT
#define _SC_THREAD_PRIO_CEILING
#define _SC_THREAD_PROCESS_SHARED
#define _SC_THREAD_SAGE_FUNCTIONS
/*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
*/
long sysconf(
int name
);
#endif
/* end of include */

View File

@@ -0,0 +1,76 @@
/* rtems/posix/cond.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX condition variables.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl
#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
/*PAGE
*
* _POSIX_Condition_variables_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
_Objects_Allocate( &_POSIX_Condition_variables_Information );
}
/*PAGE
*
* _POSIX_Condition_variables_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
)
{
_Objects_Free(
&_POSIX_Condition_variables_Information,
&the_condition_variable->Object
);
}
/*PAGE
*
* _POSIX_Condition_variables_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
)
{
/* XXX really should validate pointer */
return (POSIX_Condition_variables_Control *)
_Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
}
/*PAGE
*
* _POSIX_Condition_variables_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
)
{
return !the_condition_variable;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,72 @@
/* rtems/posix/intr.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Interrupt Manager
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_INTERRUPT_inl
#define __RTEMS_POSIX_INTERRUPT_inl
/*PAGE
*
* _POSIX_Interrupt_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void )
{
return (POSIX_Interrupt_Handler_control *)
_Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
}
/*PAGE
*
* _POSIX_Interrupt_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
)
{
_Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
}
/*PAGE
*
* _POSIX_Interrupt_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Interrupt_Control *)
_Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
}
/*PAGE
*
* _POSIX_Interrupt_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
)
{
return !the_intr;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,70 @@
/* rtems/posix/key.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX key's.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_KEY_inl
#define __RTEMS_POSIX_KEY_inl
/*PAGE
*
* _POSIX_Keys_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
}
/*PAGE
*
* _POSIX_Keys_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
}
/*PAGE
*
* _POSIX_Keys_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Keys_Control *)
_Objects_Get( &_POSIX_Keys_Information, id, location );
}
/*PAGE
*
* _POSIX_Keys_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
)
{
return !the_key;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,83 @@
/* rtems/posix/mqueue.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Message Queue.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl
#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
/*PAGE
*
* _POSIX_Message_queue_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
{
return (POSIX_Message_queue_Control *)
_Objects_Allocate( &_POSIX_Message_queue_Information );
}
/*PAGE
*
* _POSIX_Message_queue_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
)
{
_Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
}
/*PAGE
*
* _POSIX_Message_queue_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control *)
_Objects_Get( &_POSIX_Message_queue_Information, id, location );
}
/*PAGE
*
* _POSIX_Message_queue_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
)
{
return !the_mq;
}
/*PAGE
*
* _POSIX_Message_queue_Priority_to_core
*/
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
)
{
return priority;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,93 @@
/* rtems/posix/mutex.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX mutex's.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MUTEX_inl
#define __RTEMS_POSIX_MUTEX_inl
/*PAGE
*
* _POSIX_Mutex_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
{
return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
}
/*PAGE
*
* _POSIX_Mutex_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
)
{
_Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
}
/*PAGE
*
* _POSIX_Mutex_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
Objects_Id *id,
Objects_Locations *location
)
{
int status;
if ( !id ) {
*location = OBJECTS_ERROR;
return (POSIX_Mutex_Control *) 0;
}
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
/*
* Do an "auto-create" here.
*/
status = pthread_mutex_init( id, 0 );
if ( status ) {
*location = OBJECTS_ERROR;
return (POSIX_Mutex_Control *) 0;
}
}
/*
* Now call Objects_Get()
*/
return (POSIX_Mutex_Control *)
_Objects_Get( &_POSIX_Mutex_Information, *id, location );
}
/*PAGE
*
* _POSIX_Mutex_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
)
{
return !the_mutex;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,37 @@
/*
* $Id$
*/
#ifndef __RTEMS_POSIX_PRIORITY_inl
#define __RTEMS_POSIX_PRIORITY_inl
/*
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19
*
* "Numericallly higher values represent higher priorities."
*
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
)
{
return (boolean) (priority >= 1 && priority <= 255);
}
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (256 - priority);
}
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return 256 - priority;
}
#endif

View File

@@ -0,0 +1,70 @@
/* rtems/posix/pthread.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX threads.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_THREADS_inl
#define __RTEMS_POSIX_THREADS_inl
/*PAGE
*
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
}
/*PAGE
*
* _POSIX_Threads_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
}
/*PAGE
*
* _POSIX_Threads_Get
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
pthread_t id,
Objects_Locations *location
)
{
return (Thread_Control *)
_Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
}
/*PAGE
*
* _POSIX_Threads_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
Thread_Control *the_pthread
)
{
return !the_pthread;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,76 @@
/* rtems/posix/cond.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX condition variables.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl
#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
/*PAGE
*
* _POSIX_Condition_variables_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
_Objects_Allocate( &_POSIX_Condition_variables_Information );
}
/*PAGE
*
* _POSIX_Condition_variables_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
)
{
_Objects_Free(
&_POSIX_Condition_variables_Information,
&the_condition_variable->Object
);
}
/*PAGE
*
* _POSIX_Condition_variables_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
)
{
/* XXX really should validate pointer */
return (POSIX_Condition_variables_Control *)
_Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
}
/*PAGE
*
* _POSIX_Condition_variables_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
)
{
return !the_condition_variable;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,72 @@
/* rtems/posix/intr.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Interrupt Manager
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_INTERRUPT_inl
#define __RTEMS_POSIX_INTERRUPT_inl
/*PAGE
*
* _POSIX_Interrupt_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void )
{
return (POSIX_Interrupt_Handler_control *)
_Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
}
/*PAGE
*
* _POSIX_Interrupt_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
)
{
_Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
}
/*PAGE
*
* _POSIX_Interrupt_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Interrupt_Control *)
_Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
}
/*PAGE
*
* _POSIX_Interrupt_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
)
{
return !the_intr;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,70 @@
/* rtems/posix/key.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX key's.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_KEY_inl
#define __RTEMS_POSIX_KEY_inl
/*PAGE
*
* _POSIX_Keys_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
}
/*PAGE
*
* _POSIX_Keys_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
}
/*PAGE
*
* _POSIX_Keys_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Keys_Control *)
_Objects_Get( &_POSIX_Keys_Information, id, location );
}
/*PAGE
*
* _POSIX_Keys_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
)
{
return !the_key;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,83 @@
/* rtems/posix/mqueue.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Message Queue.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl
#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
/*PAGE
*
* _POSIX_Message_queue_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
{
return (POSIX_Message_queue_Control *)
_Objects_Allocate( &_POSIX_Message_queue_Information );
}
/*PAGE
*
* _POSIX_Message_queue_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
)
{
_Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
}
/*PAGE
*
* _POSIX_Message_queue_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control *)
_Objects_Get( &_POSIX_Message_queue_Information, id, location );
}
/*PAGE
*
* _POSIX_Message_queue_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
)
{
return !the_mq;
}
/*PAGE
*
* _POSIX_Message_queue_Priority_to_core
*/
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
)
{
return priority;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,93 @@
/* rtems/posix/mutex.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX mutex's.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_MUTEX_inl
#define __RTEMS_POSIX_MUTEX_inl
/*PAGE
*
* _POSIX_Mutex_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
{
return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
}
/*PAGE
*
* _POSIX_Mutex_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
)
{
_Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
}
/*PAGE
*
* _POSIX_Mutex_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
Objects_Id *id,
Objects_Locations *location
)
{
int status;
if ( !id ) {
*location = OBJECTS_ERROR;
return (POSIX_Mutex_Control *) 0;
}
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
/*
* Do an "auto-create" here.
*/
status = pthread_mutex_init( id, 0 );
if ( status ) {
*location = OBJECTS_ERROR;
return (POSIX_Mutex_Control *) 0;
}
}
/*
* Now call Objects_Get()
*/
return (POSIX_Mutex_Control *)
_Objects_Get( &_POSIX_Mutex_Information, *id, location );
}
/*PAGE
*
* _POSIX_Mutex_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
)
{
return !the_mutex;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,37 @@
/*
* $Id$
*/
#ifndef __RTEMS_POSIX_PRIORITY_inl
#define __RTEMS_POSIX_PRIORITY_inl
/*
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19
*
* "Numericallly higher values represent higher priorities."
*
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
)
{
return (boolean) (priority >= 1 && priority <= 255);
}
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (256 - priority);
}
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return 256 - priority;
}
#endif

View File

@@ -0,0 +1,70 @@
/* rtems/posix/pthread.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX threads.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_THREADS_inl
#define __RTEMS_POSIX_THREADS_inl
/*PAGE
*
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
}
/*PAGE
*
* _POSIX_Threads_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
}
/*PAGE
*
* _POSIX_Threads_Get
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
pthread_t id,
Objects_Locations *location
)
{
return (Thread_Control *)
_Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
}
/*PAGE
*
* _POSIX_Threads_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
Thread_Control *the_pthread
)
{
return !the_pthread;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,71 @@
/* rtems/posix/semaphore.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Semaphores.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_SEMAPHORE_inl
#define __RTEMS_POSIX_SEMAPHORE_inl
/*PAGE
*
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
}
/*PAGE
*
* _POSIX_Semaphore_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
}
/*PAGE
*
* _POSIX_Semaphore_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
_Objects_Get( &_POSIX_Semaphore_Information, *id, location );
}
/*PAGE
*
* _POSIX_Semaphore_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
)
{
return !the_semaphore;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,71 @@
/* rtems/posix/semaphore.inl
*
* This include file contains the static inline implementation of the private
* inlined routines for POSIX Semaphores.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_POSIX_SEMAPHORE_inl
#define __RTEMS_POSIX_SEMAPHORE_inl
/*PAGE
*
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
}
/*PAGE
*
* _POSIX_Semaphore_Free
*/
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
}
/*PAGE
*
* _POSIX_Semaphore_Get
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
_Objects_Get( &_POSIX_Semaphore_Information, *id, location );
}
/*PAGE
*
* _POSIX_Semaphore_Is_null
*/
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
)
{
return !the_semaphore;
}
#endif
/* end of include file */

View File

@@ -0,0 +1,28 @@
/*
* $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;
}

111
c/src/exec/posix/src/aio.c Normal file
View File

@@ -0,0 +1,111 @@
/*
* $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();
}

View File

@@ -0,0 +1,228 @@
/*
* $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 );
}

497
c/src/exec/posix/src/cond.c Normal file
View File

@@ -0,0 +1,497 @@
/*
* $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, &current_time );
/* XXX probably some error checking should go here */
_POSIX_Timespec_subtract( &current_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
);
}

View File

@@ -0,0 +1,22 @@
/*
* $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();
}

340
c/src/exec/posix/src/intr.c Normal file
View File

@@ -0,0 +1,340 @@
/*
* 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!!!
*/
}

262
c/src/exec/posix/src/key.c Normal file
View File

@@ -0,0 +1,262 @@
/*
* $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;
}
}

View File

@@ -0,0 +1,710 @@
/*
* 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();
}

View File

@@ -0,0 +1,683 @@
/*
* $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();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
/*
* $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();
}

View File

@@ -0,0 +1,153 @@
/*
* $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;
}

View File

@@ -0,0 +1,571 @@
/*
* $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();
}

390
c/src/exec/posix/src/time.c Normal file
View File

@@ -0,0 +1,390 @@
/*
* $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();
}

View File

@@ -0,0 +1,222 @@
/*
* $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
*/

View File

@@ -0,0 +1,41 @@
/*
* $Id$
*/
#include <time.h>
#include <unistd.h>
#include <rtems/system.h>
/*
* 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
*/
unsigned int sleep(
unsigned int seconds
)
{
/* XXX can we get away with this implementation? */
struct timespec tp;
struct timespec tm;
tp.tv_sec = seconds;
tp.tv_nsec = 0;
nanosleep( &tp, &tm );
return tm.tv_sec; /* seconds remaining */
}
/*PAGE
*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
*/
long sysconf(
int name
)
{
return POSIX_NOT_IMPLEMENTED();
}

View File

@@ -0,0 +1,57 @@
/*
* $Id$
*/
#include <stdio.h>
#include <string.h>
#include <sys/utsname.h>
#include <rtems/system.h>
#include <rtems/score/system.h>
#include <rtems/score/object.h>
/*PAGE
*
* 4.4.1 Get System Name, P1003.1b-1993, p. 90
*/
int uname(
struct utsname *name
)
{
/* XXX: Here is what Solaris returns...
sysname = SunOS
nodename = node_name
release = 5.3
version = Generic_101318-12
machine = sun4m
*/
strcpy( name->sysname, "RTEMS" );
sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
/* XXX release string is in BAD format for this routine!!! */
strcpy( name->release, "3.2.0" );
/* XXX does this have any meaning for RTEMS */
strcpy( name->release, "" );
sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
return 0;
}
/*PAGE
*
* 4.5.2 Get Process Times, P1003.1b-1993, p. 92
*/
clock_t times(
struct tms *buffer
)
{
return POSIX_NOT_IMPLEMENTED();
}

View File

@@ -0,0 +1,49 @@
/* sys/utsname.h
*
* $Id$
*/
#ifndef __POSIX_SYS_UTSNAME_h
#define __POSIX_SYS_UTSNAME_h
#include <sys/times.h>
#include <sys/types.h>
/*
* 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
*
* NOTE: The lengths of the strings in this structure are
* just long enough to reliably contain the RTEMS information.
* For example, the fields are not long enough to support
* Internet hostnames.
*/
struct utsname {
char sysname[ 32 ]; /* Name of this implementation of the operating system */
char nodename[ 32 ]; /* Name of this node within an implementation */
/* specified communication network */
char release[ 32 ]; /* Current release level of this implementation */
char version[ 32 ]; /* Current version level of this release */
char machine[ 32 ]; /* Name of the hardware type on which the system */
/* is running */
};
/*
* 4.4.1 Get System Name, P1003.1b-1993, p. 90
*/
int uname(
struct utsname *name
);
/*
* 4.5.2 Get Process Times, P1003.1b-1993, p. 92
*/
clock_t times(
struct tms *buffer
);
#endif
/* end of include file */

View File

@@ -28,7 +28,7 @@
* This routine initializes the given RTEMS_ASR information record.
*/
STATIC INLINE void _ASR_Initialize (
RTEMS_INLINE_ROUTINE void _ASR_Initialize (
ASR_Information *information
)
{
@@ -51,7 +51,7 @@ STATIC INLINE void _ASR_Initialize (
* way that the RTEMS_ASR disable/enable flag changes.
*/
STATIC INLINE void _ASR_Swap_signals (
RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
ASR_Information *information
)
{
@@ -75,7 +75,7 @@ STATIC INLINE void _ASR_Swap_signals (
* FALSE otherwise.
*/
STATIC INLINE boolean _ASR_Is_null_handler (
RTEMS_INLINE_ROUTINE boolean _ASR_Is_null_handler (
rtems_asr_entry asr_handler
)
{
@@ -92,7 +92,7 @@ STATIC INLINE boolean _ASR_Is_null_handler (
* given RTEMS_ASR information record and FALSE otherwise.
*/
STATIC INLINE boolean _ASR_Are_signals_pending (
RTEMS_INLINE_ROUTINE boolean _ASR_Are_signals_pending (
ASR_Information *information
)
{
@@ -111,7 +111,7 @@ STATIC INLINE boolean _ASR_Are_signals_pending (
* NOTE: This must be implemented as a macro.
*/
STATIC INLINE void _ASR_Post_signals(
RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
rtems_signal_set signals,
rtems_signal_set *signal_set
)

View File

@@ -27,7 +27,7 @@
* passed in. The result is returned to the user.
*/
STATIC INLINE rtems_attribute _Attributes_Set (
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
rtems_attribute new_attributes,
rtems_attribute attribute_set
)
@@ -45,7 +45,7 @@ STATIC INLINE rtems_attribute _Attributes_Set (
* passed in. The result is returned to the user.
*/
STATIC INLINE rtems_attribute _Attributes_Clear (
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
rtems_attribute attribute_set,
rtems_attribute mask
)
@@ -63,7 +63,7 @@ STATIC INLINE rtems_attribute _Attributes_Clear (
* enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_floating_point(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point(
rtems_attribute attribute_set
)
{
@@ -80,7 +80,7 @@ STATIC INLINE boolean _Attributes_Is_floating_point(
* enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_global(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global(
rtems_attribute attribute_set
)
{
@@ -97,7 +97,7 @@ STATIC INLINE boolean _Attributes_Is_global(
* enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_priority(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority(
rtems_attribute attribute_set
)
{
@@ -114,7 +114,7 @@ STATIC INLINE boolean _Attributes_Is_priority(
* enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_binary_semaphore(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore(
rtems_attribute attribute_set
)
{
@@ -131,7 +131,7 @@ STATIC INLINE boolean _Attributes_Is_binary_semaphore(
* is enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_inherit_priority(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority(
rtems_attribute attribute_set
)
{
@@ -148,7 +148,7 @@ STATIC INLINE boolean _Attributes_Is_inherit_priority(
* is enabled in the attribute_set and FALSE otherwise.
*/
STATIC INLINE boolean _Attributes_Is_priority_ceiling(
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
rtems_attribute attribute_set
)
{

View File

@@ -28,7 +28,7 @@
* of free port control blocks.
*/
STATIC INLINE Dual_ported_memory_Control
RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
*_Dual_ported_memory_Allocate ( void )
{
return (Dual_ported_memory_Control *)
@@ -45,7 +45,7 @@ STATIC INLINE Dual_ported_memory_Control
* of free port control blocks.
*/
STATIC INLINE void _Dual_ported_memory_Free (
RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
Dual_ported_memory_Control *the_port
)
{
@@ -66,7 +66,7 @@ STATIC INLINE void _Dual_ported_memory_Free (
* undefined.
*/
STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -84,7 +84,7 @@ STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
* This function returns TRUE if the_port is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Dual_ported_memory_Is_null(
RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
Dual_ported_memory_Control *the_port
)
{

View File

@@ -26,7 +26,7 @@
* and FALSE otherwise.
*/
STATIC INLINE boolean _Event_sets_Is_empty(
RTEMS_INLINE_ROUTINE boolean _Event_sets_Is_empty(
rtems_event_set the_event_set
)
{
@@ -43,7 +43,7 @@ STATIC INLINE boolean _Event_sets_Is_empty(
* passed in. The result is returned to the user in event_set.
*/
STATIC INLINE void _Event_sets_Post(
RTEMS_INLINE_ROUTINE void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
@@ -61,7 +61,7 @@ STATIC INLINE void _Event_sets_Post(
* set in event_set.
*/
STATIC INLINE rtems_event_set _Event_sets_Get(
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
@@ -79,7 +79,7 @@ STATIC INLINE rtems_event_set _Event_sets_Get(
* passed in. The result is returned to the user in event_set.
*/
STATIC INLINE rtems_event_set _Event_sets_Clear(
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)

View File

@@ -29,7 +29,7 @@
* messages on the_message_queue.
*/
STATIC INLINE boolean _Message_queue_Is_null (
RTEMS_INLINE_ROUTINE boolean _Message_queue_Is_null (
Message_queue_Control *the_message_queue
)
{
@@ -47,7 +47,7 @@ STATIC INLINE boolean _Message_queue_Is_null (
* the inactive chain of free message queue control blocks.
*/
STATIC INLINE void _Message_queue_Free (
RTEMS_INLINE_ROUTINE void _Message_queue_Free (
Message_queue_Control *the_message_queue
)
{
@@ -70,7 +70,7 @@ STATIC INLINE void _Message_queue_Free (
* the_message_queue is undefined.
*/
STATIC INLINE Message_queue_Control *_Message_queue_Get (
RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)

View File

@@ -27,7 +27,7 @@
* are set in mode_set, and FALSE otherwise.
*/
STATIC INLINE boolean _Modes_Mask_changed (
RTEMS_INLINE_ROUTINE boolean _Modes_Mask_changed (
Modes_Control mode_set,
Modes_Control masks
)
@@ -45,7 +45,7 @@ STATIC INLINE boolean _Modes_Mask_changed (
* Signal Processing is disabled, and FALSE otherwise.
*/
STATIC INLINE boolean _Modes_Is_asr_disabled (
RTEMS_INLINE_ROUTINE boolean _Modes_Is_asr_disabled (
Modes_Control mode_set
)
{
@@ -62,7 +62,7 @@ STATIC INLINE boolean _Modes_Is_asr_disabled (
* is enabled, and FALSE otherwise.
*/
STATIC INLINE boolean _Modes_Is_preempt (
RTEMS_INLINE_ROUTINE boolean _Modes_Is_preempt (
Modes_Control mode_set
)
{
@@ -79,7 +79,7 @@ STATIC INLINE boolean _Modes_Is_preempt (
* is enabled, and FALSE otherwise.
*/
STATIC INLINE boolean _Modes_Is_timeslice (
RTEMS_INLINE_ROUTINE boolean _Modes_Is_timeslice (
Modes_Control mode_set
)
{
@@ -95,7 +95,7 @@ STATIC INLINE boolean _Modes_Is_timeslice (
* This function returns the interrupt level portion of the mode_set.
*/
STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
@@ -112,7 +112,7 @@ STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
* in the mode_set.
*/
STATIC INLINE void _Modes_Set_interrupt_level (
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
@@ -131,7 +131,7 @@ STATIC INLINE void _Modes_Set_interrupt_level (
* is returned in changed.
*/
STATIC INLINE void _Modes_Change (
RTEMS_INLINE_ROUTINE void _Modes_Change (
Modes_Control old_mode_set,
Modes_Control new_mode_set,
Modes_Control mask,

View File

@@ -27,7 +27,7 @@
* option_set, and FALSE otherwise.
*/
STATIC INLINE boolean _Options_Is_no_wait (
RTEMS_INLINE_ROUTINE boolean _Options_Is_no_wait (
rtems_option option_set
)
{
@@ -44,7 +44,7 @@ STATIC INLINE boolean _Options_Is_no_wait (
* OPTION_SET, and FALSE otherwise.
*/
STATIC INLINE boolean _Options_Is_any (
RTEMS_INLINE_ROUTINE boolean _Options_Is_any (
rtems_option option_set
)
{

View File

@@ -28,7 +28,7 @@
* Otherwise, it returns NULL.
*/
STATIC INLINE void *_Partition_Allocate_buffer (
RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer (
Partition_Control *the_partition
)
{
@@ -44,7 +44,7 @@ STATIC INLINE void *_Partition_Allocate_buffer (
* This routine frees the_buffer to the_partition.
*/
STATIC INLINE void _Partition_Free_buffer (
RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
Partition_Control *the_partition,
Chain_Node *the_buffer
)
@@ -62,7 +62,7 @@ STATIC INLINE void _Partition_Free_buffer (
* boundary for the_partition, and FALSE otherwise.
*/
STATIC INLINE boolean _Partition_Is_buffer_on_boundary (
RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_on_boundary (
void *the_buffer,
Partition_Control *the_partition
)
@@ -87,7 +87,7 @@ STATIC INLINE boolean _Partition_Is_buffer_on_boundary (
* the_partition, otherwise FALSE is returned.
*/
STATIC INLINE boolean _Partition_Is_buffer_valid (
RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_valid (
Chain_Node *the_buffer,
Partition_Control *the_partition
)
@@ -115,7 +115,7 @@ STATIC INLINE boolean _Partition_Is_buffer_valid (
* properly aligned, and FALSE otherwise.
*/
STATIC INLINE boolean _Partition_Is_buffer_size_aligned (
RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_size_aligned (
unsigned32 buffer_size
)
{
@@ -132,7 +132,7 @@ STATIC INLINE boolean _Partition_Is_buffer_size_aligned (
* the inactive chain of free partition control blocks.
*/
STATIC INLINE Partition_Control *_Partition_Allocate ( void )
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
{
return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
}
@@ -147,7 +147,7 @@ STATIC INLINE Partition_Control *_Partition_Allocate ( void )
* inactive chain of free partition control blocks.
*/
STATIC INLINE void _Partition_Free (
RTEMS_INLINE_ROUTINE void _Partition_Free (
Partition_Control *the_partition
)
{
@@ -169,7 +169,7 @@ STATIC INLINE void _Partition_Free (
* to OBJECTS_ERROR and the_partition is undefined.
*/
STATIC INLINE Partition_Control *_Partition_Get (
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -188,7 +188,7 @@ STATIC INLINE Partition_Control *_Partition_Get (
* and FALSE otherwise.
*/
STATIC INLINE boolean _Partition_Is_null (
RTEMS_INLINE_ROUTINE boolean _Partition_Is_null (
Partition_Control *the_partition
)
{

View File

@@ -27,7 +27,7 @@
* the inactive chain of free period control blocks.
*/
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
{
return (Rate_monotonic_Control *)
_Objects_Allocate( &_Rate_monotonic_Information );
@@ -43,7 +43,7 @@ STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
* the inactive chain of free period control blocks.
*/
STATIC INLINE void _Rate_monotonic_Free (
RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
Rate_monotonic_Control *the_period
)
{
@@ -63,7 +63,7 @@ STATIC INLINE void _Rate_monotonic_Free (
* to OBJECTS_ERROR and the_period is undefined.
*/
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Get (
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -82,7 +82,7 @@ STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Get (
* and FALSE otherwise.
*/
STATIC INLINE boolean _Rate_monotonic_Is_active (
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
Rate_monotonic_Control *the_period
)
{
@@ -99,7 +99,7 @@ STATIC INLINE boolean _Rate_monotonic_Is_active (
* and FALSE otherwise.
*/
STATIC INLINE boolean _Rate_monotonic_Is_inactive (
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
Rate_monotonic_Control *the_period
)
{
@@ -116,7 +116,7 @@ STATIC INLINE boolean _Rate_monotonic_Is_inactive (
* and FALSE otherwise.
*/
STATIC INLINE boolean _Rate_monotonic_Is_expired (
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
Rate_monotonic_Control *the_period
)
{
@@ -132,7 +132,7 @@ STATIC INLINE boolean _Rate_monotonic_Is_expired (
* This function returns TRUE if the_period is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Rate_monotonic_Is_null (
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
Rate_monotonic_Control *the_period
)
{

View File

@@ -27,7 +27,7 @@
* the inactive chain of free region control blocks.
*/
STATIC INLINE Region_Control *_Region_Allocate( void )
RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
{
return (Region_Control *) _Objects_Allocate( &_Region_Information );
}
@@ -42,7 +42,7 @@ STATIC INLINE Region_Control *_Region_Allocate( void )
* inactive chain of free region control blocks.
*/
STATIC INLINE void _Region_Free (
RTEMS_INLINE_ROUTINE void _Region_Free (
Region_Control *the_region
)
{
@@ -62,7 +62,7 @@ STATIC INLINE void _Region_Free (
* to OBJECTS_ERROR and the_region is undefined.
*/
STATIC INLINE Region_Control *_Region_Get (
RTEMS_INLINE_ROUTINE Region_Control *_Region_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -82,7 +82,7 @@ STATIC INLINE Region_Control *_Region_Get (
* Otherwise, it returns NULL.
*/
STATIC INLINE void *_Region_Allocate_segment (
RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
Region_Control *the_region,
unsigned32 size
)
@@ -99,7 +99,7 @@ STATIC INLINE void *_Region_Allocate_segment (
* This function frees the_segment to the_region.
*/
STATIC INLINE boolean _Region_Free_segment (
RTEMS_INLINE_ROUTINE boolean _Region_Free_segment (
Region_Control *the_region,
void *the_segment
)
@@ -116,7 +116,7 @@ STATIC INLINE boolean _Region_Free_segment (
* This function returns TRUE if the_region is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Region_Is_null (
RTEMS_INLINE_ROUTINE boolean _Region_Is_null (
Region_Control *the_region
)
{

View File

@@ -27,7 +27,7 @@
* the inactive chain of free semaphore control blocks.
*/
STATIC INLINE Semaphore_Control *_Semaphore_Allocate( void )
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
{
return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
}
@@ -42,7 +42,7 @@ STATIC INLINE Semaphore_Control *_Semaphore_Allocate( void )
* inactive chain of free semaphore control blocks.
*/
STATIC INLINE void _Semaphore_Free (
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
@@ -64,7 +64,7 @@ STATIC INLINE void _Semaphore_Free (
* to OBJECTS_ERROR and the_semaphore is undefined.
*/
STATIC INLINE Semaphore_Control *_Semaphore_Get (
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -82,7 +82,7 @@ STATIC INLINE Semaphore_Control *_Semaphore_Get (
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Semaphore_Is_null (
RTEMS_INLINE_ROUTINE boolean _Semaphore_Is_null (
Semaphore_Control *the_semaphore
)
{

View File

@@ -27,7 +27,7 @@
* and FALSE otherwise.
*/
STATIC INLINE boolean rtems_is_status_successful(
RTEMS_INLINE_ROUTINE boolean rtems_is_status_successful(
rtems_status_code code
)
{
@@ -44,7 +44,7 @@ STATIC INLINE boolean rtems_is_status_successful(
* and FALSE otherwise.
*/
STATIC INLINE boolean rtems_are_statuses_equal(
RTEMS_INLINE_ROUTINE boolean rtems_are_statuses_equal(
rtems_status_code code1,
rtems_status_code code2
)

View File

@@ -26,7 +26,7 @@
* This function returns TRUE if the name is valid, and FALSE otherwise.
*/
STATIC INLINE rtems_boolean rtems_is_name_valid (
RTEMS_INLINE_ROUTINE rtems_boolean rtems_is_name_valid (
rtems_name name
)
{
@@ -43,7 +43,7 @@ STATIC INLINE rtems_boolean rtems_is_name_valid (
* characters C1, C2, C3, and C4.
*/
STATIC INLINE void rtems_name_to_characters(
RTEMS_INLINE_ROUTINE void rtems_name_to_characters(
rtems_name name,
char *c1,
char *c2,

View File

@@ -27,7 +27,7 @@
* the inactive chain of free task control blocks.
*/
STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void )
RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
}
@@ -42,7 +42,7 @@ STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void )
* inactive chain of free task control blocks.
*/
STATIC INLINE void _RTEMS_tasks_Free (
RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
Thread_Control *the_task
)
{
@@ -61,7 +61,7 @@ STATIC INLINE void _RTEMS_tasks_Free (
* This function converts an RTEMS API priority into a core priority.
*/
STATIC INLINE Priority_Control _RTEMS_tasks_Priority_to_Core(
RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core(
rtems_task_priority priority
)
{
@@ -78,7 +78,7 @@ STATIC INLINE Priority_Control _RTEMS_tasks_Priority_to_Core(
* and FALSE otherwise.
*/
STATIC INLINE boolean _RTEMS_tasks_Priority_is_valid (
RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{

View File

@@ -27,7 +27,7 @@
* the inactive chain of free timer control blocks.
*/
STATIC INLINE Timer_Control *_Timer_Allocate( void )
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
{
return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
}
@@ -42,7 +42,7 @@ STATIC INLINE Timer_Control *_Timer_Allocate( void )
* inactive chain of free timer control blocks.
*/
STATIC INLINE void _Timer_Free (
RTEMS_INLINE_ROUTINE void _Timer_Free (
Timer_Control *the_timer
)
{
@@ -62,7 +62,7 @@ STATIC INLINE void _Timer_Free (
* to OBJECTS_ERROR and the returned value is undefined.
*/
STATIC INLINE Timer_Control *_Timer_Get (
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -81,7 +81,7 @@ STATIC INLINE Timer_Control *_Timer_Get (
* timer, and FALSE otherwise.
*/
STATIC INLINE boolean _Timer_Is_interval_class (
RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
Timer_Classes the_class
)
{
@@ -98,7 +98,7 @@ STATIC INLINE boolean _Timer_Is_interval_class (
* timer, and FALSE otherwise.
*/
STATIC INLINE boolean _Timer_Is_timer_of_day_class (
RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
Timer_Classes the_class
)
{
@@ -115,7 +115,7 @@ STATIC INLINE boolean _Timer_Is_timer_of_day_class (
* timer, and FALSE otherwise.
*/
STATIC INLINE boolean _Timer_Is_dormant_class (
RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
Timer_Classes the_class
)
{
@@ -131,7 +131,7 @@ STATIC INLINE boolean _Timer_Is_dormant_class (
* This function returns TRUE if the_timer is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Timer_Is_null (
RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
Timer_Control *the_timer
)
{

View File

@@ -57,7 +57,7 @@ void _MPCI_Initialization ( void )
}
void _MPCI_Register_packet_processor(
Objects_Classes the_class,
MP_packet_Classes the_class,
MPCI_Packet_processor the_packet_processor
)

View File

@@ -48,14 +48,14 @@ rtems_status_code rtems_clock_get(
switch ( option ) {
case RTEMS_CLOCK_GET_TOD:
if ( !_TOD_Is_set() )
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_time_of_day *)time_buffer = _TOD_Current;
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
if ( !_TOD_Is_set() )
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
@@ -70,7 +70,7 @@ rtems_status_code rtems_clock_get(
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TIME_VALUE:
if ( !_TOD_Is_set() )
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
_ISR_Disable( level );

View File

@@ -1034,7 +1034,7 @@ rtems_time_of_day *time_buffer
{
Watchdog_Interval seconds;
if ( !_TOD_Is_set() )
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
time_buffer->ticks = 0;

View File

@@ -277,7 +277,7 @@ rtems_status_code rtems_timer_fire_when(
Objects_Locations location;
rtems_interval seconds;
if ( !_TOD_Is_set() )
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !_TOD_Validate( wall_time ) )

View File

@@ -62,7 +62,7 @@ const rtems_multiprocessing_table
*/
const char _RTEMS_version[] =
"RTEMS RELEASE V3.5.17 snapshot (" CPU_NAME "/" CPU_MODEL_NAME ")";
"RTEMS RELEASE V3.6.0 (" CPU_NAME "/" CPU_MODEL_NAME ")";
/*

View File

@@ -27,7 +27,7 @@
* the inactive chain of free extension control blocks.
*/
STATIC INLINE Extension_Control *_Extension_Allocate( void )
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
{
return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
}
@@ -42,7 +42,7 @@ STATIC INLINE Extension_Control *_Extension_Allocate( void )
* inactive chain of free extension control blocks.
*/
STATIC INLINE void _Extension_Free (
RTEMS_INLINE_ROUTINE void _Extension_Free (
Extension_Control *the_extension
)
{
@@ -62,7 +62,7 @@ STATIC INLINE void _Extension_Free (
* to OBJECTS_ERROR and the returned value is undefined.
*/
STATIC INLINE Extension_Control *_Extension_Get (
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -80,7 +80,7 @@ STATIC INLINE Extension_Control *_Extension_Get (
* This function returns TRUE if the_extension is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _Extension_Is_null (
RTEMS_INLINE_ROUTINE boolean _Extension_Is_null (
Extension_Control *the_extension
)
{

View File

@@ -29,11 +29,13 @@
#include <sys/types.h>
#include <rtems/config.h>
#include <rtems/score/object.h>
#include <rtems/posix/cond.h>
#include <rtems/posix/config.h>
#include <rtems/posix/key.h>
#include <rtems/posix/mutex.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/psignal.h>
#include <rtems/posix/pthread.h>
#include <rtems/posix/time.h>
@@ -44,20 +46,39 @@
* XXX
*/
posix_api_configuration_table _POSIX_Default_configuration = {
0, /* maximum_threads */
0, /* maximum_mutexes */
0, /* maximum_condition_variables */
0, /* maximum_keys */
0, /* maximum_queued_signals */
0, /* number_of_initialization_threads */
NULL /* User_initialization_threads_table */
};
void _POSIX_API_Initialize(
rtems_configuration_table *configuration_table
)
{
posix_api_configuration_table *api_configuration;
api_configuration = configuration_table->POSIX_api_configuration;
/* XXX need to assert here based on size assumptions */
assert( api_configuration );
assert( sizeof(pthread_t) == sizeof(Objects_Id) );
api_configuration = configuration_table->POSIX_api_configuration;
if ( !api_configuration )
api_configuration = &_POSIX_Default_configuration;
_POSIX_signals_Manager_Initialization(
api_configuration->maximum_queued_signals
);
_POSIX_Threads_Manager_initialization(
api_configuration->maximum_threads,
api_configuration->number_of_initialization_tasks,
api_configuration->User_initialization_tasks_table
api_configuration->number_of_initialization_threads,
api_configuration->User_initialization_threads_table
);
_POSIX_Condition_variables_Manager_initialization(

View File

@@ -0,0 +1,75 @@
/* a29k.h
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*
*/
/* @(#)a29k.h 09/12/96 1.2 */
#ifndef _INCLUDE_A29K_h
#define _INCLUDE_A29K_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following define the CPU Family and Model within the family
*
* NOTE: The string "REPLACE_THIS_WITH_THE_CPU_MODEL" is replaced
* with the name of the appropriate macro for this target CPU.
*/
#ifdef a29k
#undef a29k
#endif
#define a29k
#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
#undef REPLACE_THIS_WITH_THE_CPU_MODEL
#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
#ifdef REPLACE_THIS_WITH_THE_BSP
#undef REPLACE_THIS_WITH_THE_BSP
#endif
#define REPLACE_THIS_WITH_THE_BSP
/*
* This file contains the information required to build
* RTEMS for a particular member of the "no cpu"
* family when executing in protected mode. It does
* this by setting variables to indicate which implementation
* dependent features are present in a particular member
* of the family.
*/
#if defined(a29205)
#define CPU_MODEL_NAME "a29205"
#define A29K_HAS_FPU 0
#else
#error "Unsupported CPU Model"
#endif
/*
* Define the name of the CPU family.
*/
#define CPU_NAME "AMD 29K"
#ifdef __cplusplus
}
#endif
#endif /* ! _INCLUDE_A29K_h */
/* end of include file */

View File

@@ -0,0 +1,57 @@
/* no_cputypes.h
*
* This include file contains type definitions pertaining to the Intel
* no_cpu processor family.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __NO_CPU_TYPES_h
#define __NO_CPU_TYPES_h
#ifndef ASM
#ifdef __cplusplus
extern "C" {
#endif
/*
* This section defines the basic types for this processor.
*/
typedef unsigned char unsigned8; /* unsigned 8-bit integer */
typedef unsigned short unsigned16; /* unsigned 16-bit integer */
typedef unsigned int unsigned32; /* unsigned 32-bit integer */
typedef unsigned long unsigned64; /* unsigned 64-bit integer */
typedef unsigned16 Priority_Bit_map_control;
typedef signed char signed8; /* 8-bit signed integer */
typedef signed short signed16; /* 16-bit signed integer */
typedef signed int signed32; /* 32-bit signed integer */
typedef signed long signed64; /* 64 bit signed integer */
typedef unsigned32 boolean; /* Boolean value */
typedef float single_precision; /* single precision float */
typedef double double_precision; /* double precision float */
typedef void no_cpu_isr;
typedef void ( *no_cpu_isr_entry )( void );
#ifdef __cplusplus
}
#endif
#endif /* !ASM */
#endif
/* end of include file */

View File

@@ -0,0 +1,531 @@
; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialization values for registers after RESET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
' /* $Id */
;* File information and includes.
.file "amd.ah"
.ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI"
;
;* AMD PROCESSOR SPECIFIC VALUES...
;
;
;* Processor revision levels...
;
; PRL values: 31-28 27-24
; Am29000 0 x
; Am29005 1 x
; Am29050 2 x
; Am29035 3 x
; Am29030 4 x
; Am29200 5 x
; Am29205 5 1x
; Am29240 6 0
; Manx 7 0
; Cougar 8 0
.equ AM29000_PRL, 0x00
.equ AM29005_PRL, 0x10
.equ AM29050_PRL, 0x20
.equ AM29035_PRL, 0x30
.equ AM29030_PRL, 0x40
.equ AM29200_PRL, 0x50
.equ AM29205_PRL, 0x58
.equ AM29240_PRL, 0x60
.equ AM29040_PRL, 0x70
.equ MANX_PRL, 0x70
.equ COUGAR_PRL, 0x80
;
;* data structures sizes.
;
.equ CFGINFO_SIZE, 16*4
.equ PGMINFO_SIZE, 16*4
.equ VARARGS_SPACE, 16*4
.equ WINDOWSIZE, 0x80
;
;* Am29027 Mode registers
;
.equ Am29027Mode1, 0x0fc00820
.equ Am29027Mode2, 0x00001375
;* Processor Based Equates and Defines
.equ SIG_SYNC, -1
.equ ENABLE, (SM)
.equ DISABLE, (ENABLE | DI | DA)
.equ DISABLE_FZ, (FZ | ENABLE | DI | DA)
.equ CLR_TRAP, (FZ | DA)
.equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA)
.equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA)
.equ InitCPS1, (TD | SM | (0<<IMShift) | DI )
.equ CPS_TMR, (SM | (0<<IMShift) | DI)
.equ CPS_INT0, (TD | SM | (0<<IMShift))
.equ CPS_TMRINT0, (SM | (0<<IMShift))
.equ InitCFG, 0x0
.equ InitRBP, (B0|B1|B2|B3|B4|B5)
.equ TMC_VALUE, 0xFFFFFF
.equ TMR_VALUE, (IE | TMC_VALUE)
;* 29205 specific (internal) peripheral initialization constants.
; Current Processor Status (CPS) Register.
; Old Processor Status Register (OPS).
.equ DA, 0x00001
.equ DI, 0x00002
.equ IMShift,0x2
.equ SM, 0x00010
.equ PI, 0x00020
.equ PD, 0x00040
.equ WM, 0x00080
.equ RE, 0x00100
.equ LK, 0x00200
.equ FZ, 0x00400
.equ TU, 0x00800
.equ TP, 0x01000
.equ TE, 0x02000
.equ IP, 0x04000
.equ CA, 0x08000
.equ MM, 0x10000
.equ TD, 0x20000
; Configuration Register (CFG)
.equ CD, 0x01
.equ CP, 0x02
.equ BO, 0x04
.equ RV, 0x08
.equ VF, 0x10
.equ DW, 0x20
.equ CO, 0x40
.equ EE, 0x80
.equ IDShift, 8
.equ CFG_ID, 0x100
.equ ILShift, 9
.equ CFG_ILMask, 0x600
.equ DDShift, 11
.equ CFG_DD, 0x800
.equ DLShift, 12
.equ CFG_DLMask, 0x3000
.equ PCEShift, 14
.equ CFG_PCE, 0x4000
.equ PMBShift, 16
.equ D16, 0x8000
.equ TBOShift, 23
.equ PRLShift, 24
; Channel Control Register (CHC)
.equ CV, 0x1
.equ NN, 0x2
.equ TRShift, 2
.equ TF, 0x400
.equ PER, 0x800
.equ LA, 0x1000
.equ ST, 0x2000
.equ ML, 0x4000
.equ LS, 0x8000
.equ CRShift, 16
.equ CNTLShift, 24
.equ CEShift, 31
.equ WBERShift, 31
; Register Bank Protect (RBP)
.equ B0, 0x1
.equ B1, 0x2
.equ B2, 0x4
.equ B3, 0x8
.equ B4, 0x10
.equ B5, 0x20
.equ B6, 0x40
.equ B7, 0x80
.equ B8, 0x100
.equ B9, 0x200
.equ B10, 0x400
.equ B11, 0x800
.equ B12, 0x1000
.equ B13, 0x2000
.equ B14, 0x4000
.equ B15, 0x8000
; Timer Counter
.equ TCVMask, 0xffffff
; Timer Reload Register
.equ IE, 0x1000000
.equ IN, 0x2000000
.equ OV, 0x4000000
.equ TRVMAsk, 0xffffff
; MMU Configuration
.equ PSShift, 8
.equ PS0Shift, 8
.equ PS1Shift, 12
; LRU Recommendation (LRU)
.equ LRUMask, 0xff
; Reason Vector (RSN)
.equ RSNMask, 0xff
; Region Mapping Address (RMA0 | RMA1)
.equ PBAMask,0xffff
.equ VBAShift, 16
; Region Mapping Control (RMC0 | RMC1)
.equ TIDMask, 0xff
.equ RMC_UE, 0x100
.equ RMC_UW, 0x200
.equ RMC_UR, 0x400
.equ RMC_SE, 0x800
.equ RMC_SW, 0x1000
.equ RMC_SR, 0x2000
.equ RMC_VE, 0x4000
.equ RMC_IO, 0x10000
.equ RGSShift, 17
.equ RMC_PGMShift, 22
; Instruction breakpoint Control (IBC0 | IBC1)
.equ BPIDMask, 0xff
.equ BTE, 0x100
.equ BRM, 0x200
.equ IBC_BSY, 0x400
.equ BEN, 0x800
.equ BHO, 0x1000
; Cache Data Register (CDR)
.equ CDR_US, 0x1
.equ P, 0x2
.equ CDR_V, 0x4
.equ IATAGShift, 20
; Cache Interface Register (CIR)
.equ CPTRShift, 2
.equ CIR_RW, 0x1000000
.equ FSELShift, 28
; Indirect Pointer A, B, C (IPA, IPB, IPC)
.equ IPShift, 2
; ALU Status (ALU)
.equ FCMask, 0x1F
.equ BPShift, 5
.equ C, 0x80
.equ Z, 0x100
.equ N, 0x200
.equ ALU_V, 0x400
.equ DF, 0x800
; Byte Pointer
.equ BPMask, 0x3
; Load/Store Count Remaining (CR)
.equ CRMask, 0xff
; Floating Point Environment (FPE)
.equ NM, 0x1
.equ RM, 0x2
.equ VM, 0x4
.equ UM, 0x8
.equ XM, 0x10
.equ DM, 0x20
.equ FRMShift, 6
.equ FF, 0x100
.equ ACFShift, 9
; Integer Environment (INTE)
.equ MO, 0x1
.equ DO, 0x2
; Floating Point Status (FPS)
.equ NS, 0x1
.equ RS, 0x2
.equ VS, 0x4
.equ FPS_US, 0x8
.equ XS, 0x10
.equ DS, 0x20
.equ NT, 0x100
.equ RT, 0x200
.equ VT, 0x400
.equ UT, 0x800
.equ XT, 0x1000
.equ DT, 0x2000
; Exception Opcode (EXOP)
.equ IOPMask, 0xff
; TLB Entry Word 0
; .equ TIDMask, 0xff already defined above
.equ TLB_UE, 0x100
.equ TLB_UW, 0x200
.equ TLB_UR, 0x400
.equ TLB_SE, 0x800
.equ TLB_SW, 0x1000
.equ TLB_SR, 0x2000
.equ TLB_VE, 0x4000
.equ VTAGShift, 15
; TLB Entry Word 1
.equ TLB_IO, 0x1
.equ U, 0x2
.equ TLB_PGMShift, 6
.equ RPNShift, 10
; Am29200 ROM Control bits.
.equ RMCT_DW0Shift, 29
.equ RMCT_DW1Shift, 21
.equ RMCT_DW2Shift, 13
.equ RMCT_DW3Shift, 5
; Am29200 DRAM Control bits.
.equ DW3, (1<<18)
.equ DW2, (1<<22)
.equ DW1, (1<<26)
.equ DW0, (1<<30)
; Internal peripheral address assignments.
.equ RMCT, 0x80000000
.equ RMCF, 0x80000004
.equ DRCT, 0x80000008
.equ DRCF, 0x8000000C
.equ DRM0, 0x80000010
.equ DRM1, 0x80000014
.equ DRM2, 0x80000018
.equ DRM3, 0x8000001C
.equ PIACT0, 0x80000020
.equ PIACT1, 0x80000020
.equ ICT, 0x80000028
.equ DMCT0, 0x80000030
.equ DMAD0, 0x80000034
.ifdef revA
.equ TAD0, 0x80000036
.equ TCN0, 0x8000003A
.else
.equ TAD0, 0x80000070 ; default
.equ TCN0, 0x8000003C ; default
.endif
.equ DMCN0, 0x80000038
.equ DMCT1, 0x80000040
.equ DMAD1, 0x80000044
.equ DMCN1, 0x80000048
.equ SPCT, 0x80000080
.equ SPST, 0x80000084
.equ SPTH, 0x80000088
.equ SPRB, 0x8000008C
.equ BAUD, 0x80000090
.equ PPCT, 0x800000C0
.equ PPST, 0x800000C1
.equ PPDT, 0x800000C4
.equ POCT, 0x800000D0
.equ PIN, 0x800000D4
.equ POUT, 0x800000D8
.equ POEN, 0x800000DC
.equ VCT, 0x800000E0
.equ TOP, 0x800000E4
.equ SIDE, 0x800000E8
.equ VDT, 0x800000EC
; Interrupt Controller Register bits.
.equ TXDI, (1<<5)
.equ RXDI, (1<<6)
.equ RXSI, (1<<7)
.equ PPI, (1<<11)
.equ DMA1I, (1<<13)
.equ DMA0I, (1<<14)
.equ IOPIMask, (0xFF<<16)
.equ VDI, (1<<27)
.equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
.equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
; Serial port Initialization bits
.equ NO_PARITY, 0
; SPST bits
.equ THREShift, 22
;* REGISTER Addresses
.equ ROMCntlRegAddr, 0x80000000
.equ ROMCfgRegAddr, 0x80000004
.equ DRAMCntlRegAddr, 0x80000008
.equ DRAMCfgRegAddr, 0x8000000C
.equ DRAMMap0RegAddr, 0x80000010
.equ DRAMMap1RegAddr, 0x80000014
.equ DRAMMap2RegAddr, 0x80000018
.equ DRAMMap3RegAddr, 0x8000001C
.equ PIACntl0RegAddr, 0x80000020
.equ PIACntl1RegAddr, 0x80000024
.equ INTRCntlRegAddr, 0x80000028
.equ DMACntl0RegAddr, 0x80000030
.equ DMACntl1RegAddr, 0x80000040
.equ SERPortCntlRegAddr, 0x80000080
.equ SERPortStatRegAddr, 0x80000084
.equ SERPortTHLDRegAddr, 0x80000088
.equ SERPortRbufRegAddr, 0x8000008C
.equ SERPortBaudRegAddr, 0x80000090
.equ PARPortCntlRegAddr, 0x800000C0
.equ PIOCntlRegAddr, 0x800000D0
.equ PIOInpRegAddr, 0x800000D4
.equ PIOOutRegAddr, 0x800000D8
.equ PIOOutEnaRegAddr, 0x800000DC
.equ VCTCntlRegAddr, 0x800000E0
;
;* Control constants
;
;* AM29030 Timer related constants.
.equ TMR_IE, 0x01000000
.equ TMR_IN, 0x02000000
.equ TMR_OV, 0x04000000
.equ TMC_INITCNT, 1613
;
;* System initialization values.
;
.equ __os_version, 0x0001 ;
.equ STACKSize, 0x8000 ;
.equ PGMExecMode, 0x0000 ;
.equ TSTCK_OFST, 28 * 4
.equ CSTCK_OFST, 29 * 4
.equ TMSTCK_OFST, 30 * 4
.equ CMSTCK_OFST, 31 * 4
.equ CTXSW_OK, 0xA55A ; ctx switch ok
.set NV_STARTOFST, 0x20 ; 32 bytes
.set NV_BAUDOFST, 0x00 ; 00 bytes
.set reg_cir, 29
.set reg_cdr, 30
.equ MSG_BUFSIZE, 0x1000 ; serial buffer size
.equ ILLOPTRAP, 0
.equ UATRAP, 1
.equ PVTRAP, 5
.equ UITLBMISSTRAP, 8
.equ UDTLBMISSTRAP, 9
.equ TIMERTRAP, 14
.equ TRACETRAP, 15
.equ XLINXTRAP, 16
.equ SERIALTRAP, 17
.equ SLOWTMRTRAP, 18
.equ PORTTRAP, 19
.equ SVSCTRAP, 80
.equ SVSCTRAP1, 81
.equ V_CACHETRAP, 66 ;
.equ V_SETSERVICE, 67 ;
.equ INIT_TIMER, 100
.equ DISABLE_TIMER, 101
.equ GET_TIMER, 102
.equ CLEAR_TIMER, 103
.equ V_SPILL, 64
.equ V_FILL, 65
.equ SIGDFL, 105

View File

@@ -0,0 +1,98 @@
/* asm.h
*
* This include file attempts to address the problems
* caused by incompatible flavors of assemblers and
* toolsets. It primarily addresses variations in the
* use of leading underscores on symbols and the requirement
* that register names be preceded by a %.
*
*
* NOTE: The spacing in the use of these macros
* is critical to them working as advertised.
*
* COPYRIGHT:
*
* This file is based on similar code found in newlib available
* from ftp.cygnus.com. The file which was used had no copyright
* notice. This file is freely distributable as long as the source
* of the file is noted. This file is:
*
* COPYRIGHT (c) 1994.
* On-Line Applications Research Corporation (OAR).
*
* $Id$
*/
#ifndef __NO_CPU_ASM_h
#define __NO_CPU_ASM_h
/*
* Indicate we are in an assembly file and get the basic CPU definitions.
*/
#define ASM
#include <rtems/score/no_cpu.h>
/*
* Recent versions of GNU cpp define variables which indicate the
* need for underscores and percents. If not using GNU cpp or
* the version does not support this, then you will obviously
* have to define these as appropriate.
*/
#ifndef __USER_LABEL_PREFIX__
#define __USER_LABEL_PREFIX__ _
#endif
#ifndef __REGISTER_PREFIX__
#define __REGISTER_PREFIX__
#endif
/* ANSI concatenation macros. */
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
/* Use the right prefix for global labels. */
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
/* Use the right prefix for registers. */
#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
/*
* define macros for all of the registers on this CPU
*
* EXAMPLE: #define d0 REG (d0)
*/
/*
* Define macros to handle section beginning and ends.
*/
#define BEGIN_CODE_DCL .text
#define END_CODE_DCL
#define BEGIN_DATA_DCL .data
#define END_DATA_DCL
#define BEGIN_CODE .text
#define END_CODE
#define BEGIN_DATA
#define END_DATA
#define BEGIN_BSS
#define END_BSS
#define END
/*
* Following must be tailor for a particular flavor of the C compiler.
* They may need to put underscores in front of the symbols.
*/
#define PUBLIC(sym) .globl SYM (sym)
#define EXTERN(sym) .globl SYM (sym)
#endif
/* end of include file */

Some files were not shown because too many files have changed in this diff Show More