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
1480 changed files with 19787 additions and 147890 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:

View File

@@ -1,32 +0,0 @@
#
# $Id$
#
Misc. support tools for RTEMS workspaces.
More will be added later as they are converted from Teamware
to CVS.
install-if-change
Smart install script that also can append suffixes as it
installs (suffixes used for debug and profile variants).
Requires bash or ksh.
rcs-clean
deletes all files from the current directory that can be
re-created from RCS. Careful to not delete locked files.
May be used by 'gmake clobber'
lock-directory
unlock-directory
traverse a directory structure making it unwritable.
Useful to keep people from accidentally overwriting
"released" trees if they get confused about which
module they have loaded.
rtems-glom
glom together all the rtems libraries in order to simplify
the link line used by applications.
Produces rtems.rel.
Not used by the RTEMS src tree at all.
Strictly optional.

View File

@@ -1,364 +0,0 @@
/*
* cklength - check the length of lines in a file
*
* This program check to see if the files passed to it on the command line
* contain a line which exceeds the maximum allowable length. The default
* maximum line length is 80.
*
* usage: cklength [ -v ] [ arg ... ] files...
* -l length -- maximum line length
* -v -- verbose
*
* $Id$
*/
#define GETOPTARGS "l:nNv"
char *USAGE = "\
usage: cklength [ -v ] [ arg ... ] files... \n\
-l length -- maximum line length\n\
-n -- report line numbers for offending lines\n\
-N -- report line numbers and length for offending lines\n\
-v -- verbose\n\
\n\
Print the name of files which have at least 1 line which exceeds the\n\
maximum line length. The default maximum line length is 80.\n\
";
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <memory.h>
#include <stdarg.h>
#define BUFFER_SIZE 512
#define SUCCESS 0
#define FAILURE -1
#define Failed(x) (((int) (x)) == FAILURE)
#define TRUE 1
#define FALSE 0
#define STREQ(a,b) (strcmp(a,b) == 0)
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
/*
* Definitions for unsigned "ints"; especially for use in data structures
* that will be shared among (potentially) different cpu's (we punt on
* byte ordering problems tho)
*/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
/*
* vars controlled by command line options
*/
int verbose = FALSE; /* be verbose */
int report_line_numbers = FALSE; /* report line numbers of offenders */
int report_line_length = FALSE; /* report line length of offenders */
int line_length = 80; /* maximum allowable line length */
extern char *optarg; /* getopt(3) control vars */
extern int optind, opterr;
extern int errno;
char *progname; /* for error() */
int process(char *arg);
void error(int errn, ...);
long getparm(char *s, long min, long max, char *msg);
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
#define stol(p) strtol(p, (char **) NULL, 0)
int Open(), Read(), Write();
int
main(int argc, char **argv, char **env)
{
register int c;
int showusage = FALSE; /* usage error? */
int rc = 0;
/*
* figure out invocation leaf-name
*/
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
progname = argv[0];
else
progname++;
argv[0] = progname; /* for getopt err reporting */
/*
* Check options and arguments.
*/
opterr = 0; /* we'll report all errors */
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
switch (c)
{
case 'l': /* line length */
line_length = atoi( optarg );
if ( line_length < 0 || line_length > BUFFER_SIZE )
error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
break;
case 'n': /* toggle report_line_numbers */
report_line_numbers = ! report_line_numbers;
break;
case 'N': /* toggle both reports */
report_line_numbers = ! report_line_numbers;
report_line_length = ! report_line_length;
break;
case 'v': /* toggle verbose */
verbose = ! verbose;
break;
case '?':
showusage = TRUE;
}
if (showusage)
{
(void) fprintf(stderr, "%s", USAGE);
exit(1);
}
/*
* traverse and process the arguments
*/
for ( ; argv[optind]; optind++)
if (Failed(process(argv[optind])))
rc = FAILURE;
return rc;
}
/*
* process(arg)
*/
int
process(char *arg)
{
FILE *in;
char *bptr;
char buffer[ BUFFER_SIZE ];
int line_number;
int length;
int count;
int rc = SUCCESS; /* succeed by default */
in = fopen( arg, "r" );
if (!in)
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
count = 0;
for ( line_number=1 ; ; line_number++ ) {
bptr = fgets( buffer, BUFFER_SIZE, in );
if (!bptr)
break;
/*
* Don't count the carriage return.
*/
length = strlen( buffer ) - 1;
if ( length <= line_length )
continue;
if ( count == 0 ) {
fprintf( stderr, "%s\n", arg );
if ( !report_line_numbers )
break;
}
if ( verbose )
fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
if ( report_line_numbers ) {
if ( report_line_length )
fprintf( stderr, "%d: %d\n" , line_number, length );
else
fprintf( stderr, "%d\n" , line_number );
}
count++;
}
fclose( in );
return rc;
}
/*
* error(errn, arglist)
* report an error to stderr using printf(3) conventions.
* Any output is preceded by '<progname>: '
*
* Uses ERR_FATAL bit to request exit(errn)
* ERR_ABORT to request abort()
* ERR_ERRNO to indicate use of errno instead of argument.
*
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
* associated error message is appended to the output.
*/
/*VARARGS*/
void
error(int error_flag, ...)
{
va_list arglist;
register char *format;
extern char *sys_errlist[];
extern int sys_nerr;
int local_errno;
extern int errno;
(void) fflush(stdout); /* in case stdout/stderr same */
local_errno = error_flag & ~ERR_MASK;
if (error_flag & ERR_ERRNO) /* use errno? */
local_errno = errno;
va_start(arglist, error_flag);
format = va_arg(arglist, char *);
(void) fprintf(stderr, "%s: ", progname);
(void) vfprintf(stderr, format, arglist);
va_end(arglist);
if (local_errno)
if ((local_errno > 0) && (local_errno < sys_nerr))
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
else
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
else
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
if (error_flag & (ERR_FATAL | ERR_ABORT))
{
if (error_flag & ERR_FATAL)
{
error(0, "fatal error, exiting");
exit(local_errno ? local_errno : 1);
}
else
{
error(0, "fatal error, aborting");
abort();
}
}
}
long
getparm(char *s,
long min,
long max,
char *msg)
{
long val;
if ( ! strchr("0123456789-", *s))
{
error(ERR_FATAL, "'%s' is not a number", s);
return min;
}
val = strtol(s, (char **) NULL, 0);
if ((val < min) || (val > max))
{
if (min == max)
error(ERR_FATAL, "%s can only be %ld", s, min);
else
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
}
return val;
}
/*
* Open()
* Perform open(2), returning the file descriptor. Prints
* error message if open fails.
*/
int
Open(char *file,
int oflag,
int mode)
{
int O_fd;
if (Failed(O_fd = open(file, oflag, mode)))
error(
ERR_ERRNO | ERR_FATAL,
"open('%s', 0x%x, 0%o) failed", file, oflag, mode
);
return O_fd;
}
/*
* Read()
* Perform read(2); prints error message if fails.
*/
int
Read(int file,
char *buffer,
unsigned int count)
{
int nbytes;
if (Failed(nbytes = read(file, buffer, count)))
error(
ERR_ERRNO | ERR_FATAL,
"read(%d, 0x%x, %d) failed", file, buffer, count
);
return nbytes;
}
/*
* Write()
* Perform write(2); prints error message if fails.
*/
int
Write(int file,
char *buffer,
unsigned int count)
{
int nbytes;
if (Failed(nbytes = write(file, buffer, count)))
error(
ERR_ERRNO | ERR_FATAL,
"write(%d, 0x%x, %d) failed", file, buffer, count
);
return nbytes;
}

View File

@@ -1,351 +0,0 @@
/*
* eolstrip - strip white space from end of lines
*
* This program strips the white space from the end of every line in the
* specified program.
*
* usage: eolstrip [ -v ] [ arg ... ] files...
* -v -- verbose
*
* $Id$
*/
#define GETOPTARGS "vt"
char *USAGE = "\
usage: cklength [ -v ] [ arg ... ] files... \n\
-v -- verbose\n\
-t -- test only .. DO NOT OVERWRITE FILE!!!\n\
\n\
Strip the white space from the end of every line on the list of files.\n\
";
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <memory.h>
#include <stdarg.h>
#define BUFFER_SIZE 2048
#define MAX_PATH 2048
#define SUCCESS 0
#define FAILURE -1
#define Failed(x) (((int) (x)) == FAILURE)
#define TRUE 1
#define FALSE 0
#define STREQ(a,b) (strcmp(a,b) == 0)
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
/*
* Definitions for unsigned "ints"; especially for use in data structures
* that will be shared among (potentially) different cpu's (we punt on
* byte ordering problems tho)
*/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
/*
* vars controlled by command line options
*/
int verbose = FALSE; /* be verbose */
int test_only = FALSE; /* test only */
extern char *optarg; /* getopt(3) control vars */
extern int optind, opterr;
extern int errno;
char *progname; /* for error() */
int process(char *arg);
void error(int errn, ...);
long getparm(char *s, long min, long max, char *msg);
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
#define stol(p) strtol(p, (char **) NULL, 0)
int Open(), Read(), Write();
int
main(int argc, char **argv, char **env)
{
register int c;
int showusage = FALSE; /* usage error? */
int rc = 0;
/*
* figure out invocation leaf-name
*/
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
progname = argv[0];
else
progname++;
argv[0] = progname; /* for getopt err reporting */
/*
* Check options and arguments.
*/
opterr = 0; /* we'll report all errors */
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
switch (c)
{
case 't': /* toggle test only mode */
test_only = ! test_only;
break;
case 'v': /* toggle verbose */
verbose = ! verbose;
break;
case '?':
showusage = TRUE;
}
if (showusage)
{
(void) fprintf(stderr, "%s", USAGE);
exit(1);
}
/*
* traverse and process the arguments
*/
for ( ; argv[optind]; optind++)
if (Failed(process(argv[optind])))
rc = FAILURE;
return rc;
}
/*
* process(arg)
*/
int
process(char *arg)
{
FILE *in;
FILE *out = (FILE *) 0;
char outname[ MAX_PATH ];
char *bptr;
char buffer[ BUFFER_SIZE ];
int length;
int line_number;
int rc = SUCCESS; /* succeed by default */
in = fopen( arg, "r" );
if (!in)
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
if ( !test_only ) {
sprintf( outname, "%s.eoltmp", arg );
out = fopen( outname, "w" );
if (!out)
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
}
if ( verbose )
fprintf( stderr, "Processing %s\n", arg );
for ( line_number=1 ; ; line_number++ ) {
bptr = fgets( buffer, BUFFER_SIZE, in );
if (!bptr)
break;
/*
* Don't count the carriage return.
*/
length = strlen( buffer ) - 1;
if ( buffer[ length ] != '\n' )
error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
while ( isspace( buffer[ length ] ) )
buffer[ length-- ] = '\0';
if ( test_only ) {
fprintf( stderr, "%s\n", arg );
break;
}
fprintf( out, "%s\n", buffer );
}
fclose( in );
if ( !test_only ) {
fclose( out );
rename( outname, arg );
}
return rc;
}
/*
* error(errn, arglist)
* report an error to stderr using printf(3) conventions.
* Any output is preceded by '<progname>: '
*
* Uses ERR_FATAL bit to request exit(errn)
* ERR_ABORT to request abort()
* ERR_ERRNO to indicate use of errno instead of argument.
*
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
* associated error message is appended to the output.
*/
/*VARARGS*/
void
error(int error_flag, ...)
{
va_list arglist;
register char *format;
extern char *sys_errlist[];
extern int sys_nerr;
int local_errno;
extern int errno;
(void) fflush(stdout); /* in case stdout/stderr same */
local_errno = error_flag & ~ERR_MASK;
if (error_flag & ERR_ERRNO) /* use errno? */
local_errno = errno;
va_start(arglist, error_flag);
format = va_arg(arglist, char *);
(void) fprintf(stderr, "%s: ", progname);
(void) vfprintf(stderr, format, arglist);
va_end(arglist);
if (local_errno)
if ((local_errno > 0) && (local_errno < sys_nerr))
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
else
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
else
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
if (error_flag & (ERR_FATAL | ERR_ABORT))
{
if (error_flag & ERR_FATAL)
{
error(0, "fatal error, exiting");
exit(local_errno ? local_errno : 1);
}
else
{
error(0, "fatal error, aborting");
abort();
}
}
}
long
getparm(char *s,
long min,
long max,
char *msg)
{
long val;
if ( ! strchr("0123456789-", *s))
{
error(ERR_FATAL, "'%s' is not a number", s);
return min;
}
val = strtol(s, (char **) NULL, 0);
if ((val < min) || (val > max))
{
if (min == max)
error(ERR_FATAL, "%s can only be %ld", s, min);
else
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
}
return val;
}
/*
* Open()
* Perform open(2), returning the file descriptor. Prints
* error message if open fails.
*/
int
Open(char *file,
int oflag,
int mode)
{
int O_fd;
if (Failed(O_fd = open(file, oflag, mode)))
error(
ERR_ERRNO | ERR_FATAL,
"open('%s', 0x%x, 0%o) failed", file, oflag, mode
);
return O_fd;
}
/*
* Read()
* Perform read(2); prints error message if fails.
*/
int
Read(int file,
char *buffer,
unsigned int count)
{
int nbytes;
if (Failed(nbytes = read(file, buffer, count)))
error(
ERR_ERRNO | ERR_FATAL,
"read(%d, 0x%x, %d) failed", file, buffer, count
);
return nbytes;
}
/*
* Write()
* Perform write(2); prints error message if fails.
*/
int
Write(int file,
char *buffer,
unsigned int count)
{
int nbytes;
if (Failed(nbytes = write(file, buffer, count)))
error(
ERR_ERRNO | ERR_FATAL,
"write(%d, 0x%x, %d) failed", file, buffer, count
);
return nbytes;
}

View File

@@ -1,513 +0,0 @@
/***** P A C K H E X . C ************************************************
*
* Packhex is a hex-file compaction utility. It attempts to concatenate
* hex records to produce more size-efficient packaging.
*
* Limitations: Input files must be correctly formatted. This utility
* is not robust enough to detect hex-record formatting
* errors.
*
* Published: 5/93 Embedded Systems magazine
*
* Compiler: Microsoft C 6.0
* cl /F 1000 packhex.c
*
*
* $Id$
*
**************************************************************************/
/* #define SMALLER_RECORDS */
#ifdef SMALLER_RECORDS
#define MAX_LEN_S1_RECS 128
#define MAX_LEN_S2_RECS 128
#define MAX_LEN_S3_RECS 128
#else
#define MAX_LEN_S1_RECS 252
#define MAX_LEN_S2_RECS 251
#define MAX_LEN_S3_RECS 250
#endif
/*--------------------------------- includes ---------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(__unix__) && !defined(EXIT_FAILURE)
#define EXIT_FAILURE -1
#define EXIT_SUCCESS 0
#endif
/*--------------------------------- defines ----------------------------------*/
#define YES 1
#define MAX_LINE_SIZE 600
#define EOS '\0'
/*---------------------------------- macros ----------------------------------*/
/* Convert ASCII hexadecimal digit to value. */
#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
/*--------------------------------- typedefs ---------------------------------*/
typedef unsigned char Boolean;
typedef unsigned char Uchar;
typedef unsigned int Uint;
typedef unsigned long Ulong;
typedef struct /* Functions and constant returning Hex-record vital stats. */
{
Boolean ( *is_data_record )( char * );
Ulong ( *get_address )( char * );
Uint ( *get_data_count )( char * );
const Uint max_data_count;
char *( *get_data_start )( char * );
void ( *put_data_record )( Uint, Ulong, char * );
} Rec_vitals;
/*--------------------------- function prototypes ----------------------------*/
Rec_vitals * identify_first_data_record( char * );
Ulong get_ndigit_hex( char *, int );
/*----------------------------- Intel Hex format -----------------------------*/
/*
* Intel Hex data-record layout
*
* :aabbbbccd...dee
*
* : - header character
* aa - record data byte count, a 2-digit hex value
* bbbb - record address, a 4-digit hex value
* cc - record type, a 2-digit hex value:
* "00" is a data record
* "01" is an end-of-data record
* "02" is an extended-address record
* "03" is a start record
* d...d - data (always an even number of chars)
* ee - record checksum, a 2-digit hex value
* checksum = 2's complement
* [ (sum of bytes: aabbbbccd...d) modulo 256 ]
*/
Boolean is_intel_data_rec( char * rec_str )
{
return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
}
Uint get_intel_rec_data_count( char * rec_str )
{
return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
}
Ulong get_intel_rec_address( char * rec_str )
{
return( get_ndigit_hex( rec_str + 3, 4 ) );
}
char * get_intel_rec_data_start( char * rec_str )
{
return( rec_str + 9 );
}
void put_intel_data_rec( Uint count, Ulong address, char * data_str )
{
char *ptr;
Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
printf(
":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
);
}
Rec_vitals intel_hex =
{
is_intel_data_rec,
get_intel_rec_address,
get_intel_rec_data_count,
255, /* Maximum data bytes in a record. */
get_intel_rec_data_start,
put_intel_data_rec
};
/*------------------------- Motorola S1-record format ------------------------*/
/*
* Motorola S-record data-record layout
*
* Sabbc...cd...dee
*
* S - header character
* a - record type, a 1-digit value:
* "0" is a header record
* "1" is a 2-byte-address data record
* "2" is a 3-byte-address data record
* "3" is a 4-byte-address data record
* "7" is a 4-byte-address end-of-data record
* "8" is a 3-byte-address end-of-data record
* "9" is a 2-byte-address end-of-data record
* bb - record length in bytes, a 2-digit hex value
* (record length doesn't count the header/type
* chars and checksum byte)
* c...c - record address, a 4-, 6-, or 8-digit value,
* depending on record type
* d...d - data (always an even number of chars)
* ee - record checksum, a 2-digit hex value
* checksum = 1's complement
* [ (sum of all bytes: bbc..cd...d) modulo 256 ]
*/
#define S1_COUNT_OFFSET 3
Boolean is_moto_s1_data_rec( char * rec_str )
{
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
}
Uint get_moto_s1_rec_data_count( char * rec_str )
{
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
}
Ulong get_moto_s1_rec_address( char * rec_str )
{
return( get_ndigit_hex( rec_str + 4, 4 ) );
}
char * get_moto_s1_rec_data_start( char * rec_str )
{
return( rec_str + 8 );
}
void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
{
char *ptr;
Uint sum = S1_COUNT_OFFSET + count +
( address >> 8 & 0xff ) + ( address & 0xff );
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
printf(
"S1%02X%04lX%s%02X\n",
count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
);
}
Rec_vitals motorola_s1_rec =
{
is_moto_s1_data_rec,
get_moto_s1_rec_address,
get_moto_s1_rec_data_count,
MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
get_moto_s1_rec_data_start,
put_moto_s1_data_rec
};
/*------------------------- Motorola S2-record format ------------------------*/
#define S2_COUNT_OFFSET 4
Boolean is_moto_s2_data_rec( char * rec_str )
{
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
}
Uint get_moto_s2_rec_data_count( char * rec_str )
{
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
}
Ulong get_moto_s2_rec_address( char * rec_str )
{
return( get_ndigit_hex( rec_str + 4, 6 ) );
}
char * get_moto_s2_rec_data_start( char * rec_str )
{
return( rec_str + 10 );
}
void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
{
char *ptr;
Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
( address >> 8 & 0xff ) +
( address & 0xff );
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
printf(
"S2%02X%06lX%s%02X\n",
count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
);
}
Rec_vitals motorola_s2_rec =
{
is_moto_s2_data_rec,
get_moto_s2_rec_address,
get_moto_s2_rec_data_count,
MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
get_moto_s2_rec_data_start,
put_moto_s2_data_rec
};
/*------------------------- Motorola S3-record format ------------------------*/
#define S3_COUNT_OFFSET 5
Boolean is_moto_s3_data_rec( char * rec_str )
{
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
}
Uint get_moto_s3_rec_data_count( char * rec_str )
{
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
}
Ulong get_moto_s3_rec_address( char * rec_str )
{
return( get_ndigit_hex( rec_str + 4, 8 ) );
}
char * get_moto_s3_rec_data_start( char * rec_str )
{
return( rec_str + 12 );
}
void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
{
char *ptr;
Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
( address >> 16 & 0xff ) +
( address >> 8 & 0xff ) +
( address & 0xff );
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
printf(
"S3%02X%08lX%s%02X\n",
count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
);
}
Rec_vitals motorola_s3_rec =
{
is_moto_s3_data_rec,
get_moto_s3_rec_address,
get_moto_s3_rec_data_count,
MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
get_moto_s3_rec_data_start,
put_moto_s3_data_rec
};
/*-------------------- Put your favorite hex format here ---------------------*/
/*
* * * * The following is a template for an additional hex format: * * *
*
*
* Boolean is_X_data_rec( char * rec_str ) {}
*
* Uint get_X_rec_data_count( char * rec_str ) {}
*
* Ulong get_X_rec_address( char * rec_str ) {}
*
* char * get_X_rec_data_start( char * rec_str ) {}
*
* void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
*
* Rec_vitals X_rec =
* {
* is_X_data_rec,
* get_X_rec_address,
* get_X_rec_data_count,
* MAXIMUM DATA BYTES IN A RECORD,
* get_X_rec_data_start,
* put_X_data_rec
* };
*
*/
/*----------------------------------------------------------------------------*/
/*
* Put address of additional Rec_vitals structures
* in this array, before the NULL entry.
*/
Rec_vitals *formats[] =
{
&intel_hex,
&motorola_s1_rec,
&motorola_s2_rec,
&motorola_s3_rec,
( Rec_vitals * ) NULL
};
/**** main *****************************************************************
*
*
* Expects: Nothing (no command-line parameters).
*
* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
*
* Reads hex records on the standard input and attempts to
* splice adjacent data fields together. Results appear on
* the standard output.
*
*******************************************************************************/
void main( void )
{
char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
char *in_dptr, *out_dptr;
int d_total, d_count, d_excess, n;
Ulong in_rec_addr, out_rec_addr = 0;
Rec_vitals *rptr;
/* Sift through file until first hex record is identified. */
if ( ( rptr = identify_first_data_record( inbuff ) ) == NULL )
{
fputs( "No hex records found.\n", stderr );
exit( EXIT_FAILURE );
}
/* Attempt data-record splicing until end-of-file is reached. */
d_total = 0;
do
{
if ( rptr->is_data_record( inbuff ) == YES )
{ /* Input record is a data record. */
d_count = rptr->get_data_count( inbuff );
in_rec_addr = rptr->get_address( inbuff );
in_dptr = rptr->get_data_start( inbuff );
if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
{ /* Begin a new output record. */
if ( d_total != 0 )
rptr->put_data_record( d_total, out_rec_addr, outbuff );
out_dptr = outbuff;
n = d_total = d_count;
out_rec_addr = in_rec_addr;
}
else if
( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
{ /* Output a maximum-length record, then start a new record. */
strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
rptr->put_data_record(
rptr->max_data_count, out_rec_addr, outbuff
);
in_dptr += 2 * ( d_count - d_excess );
out_dptr = outbuff;
n = d_total = d_excess;
out_rec_addr += rptr->max_data_count;
}
else
{ /* Append input record's data field with accumulated data. */
out_dptr = outbuff + ( 2 * d_total );
d_total += n = d_count;
}
strncpy( out_dptr, in_dptr, 2 * n );
out_dptr[ 2 * n ] = EOS;
}
else
{ /* Not a data record;
* flush accumulated data then echo non-data record.
*/
if ( d_total != 0 )
{
rptr->put_data_record( d_total, out_rec_addr, outbuff );
d_total = 0;
}
puts( inbuff );
}
} while ( gets( inbuff ) != NULL );
exit( EXIT_SUCCESS );
}
/**** identify_first_data_record *******************************************
*
* Expects: Pointer to hex-record line buffer.
*
* Returns: Pointer to hex-record structure (NULL if no match found).
*
* Reads the standard input, line by line, searching for a valid
* record header character. If a valid header is found, a pointer
* to the hex-record's type structure is returned, otherwise NULL.
*
* The input-stream pointer is left pointing to the first valid hex record.
*
*******************************************************************************/
Rec_vitals * identify_first_data_record( char * buff_ptr )
{
Rec_vitals ** ptr;
while ( gets( buff_ptr ) != NULL )
{
for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
return( *ptr ); /* Successful return. */
puts( buff_ptr ); /* Echo non-hex-record line. */
}
return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
}
/**** get_ndigit_hex *******************************************************
*
* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
*
* Returns: Value of hexadecimal string as an unsigned long.
*
*******************************************************************************/
Ulong get_ndigit_hex( char * cptr, int digits )
{
Ulong value;
for ( value = 0 ; --digits >= 0 ; cptr++ )
value = ( value * 16L ) + HEX_DIGIT( *cptr );
return( value );
}

View File

@@ -1,725 +0,0 @@
/*
* unhex
* convert a hex file to binary equivalent. If more than one file name
* is given, then the output will be logically concatenated together.
* stdin and stdout are defaults. Verbose will enable checksum output.
*
* Supported input formats are Intel hex, Motorola S records, and TI 'B'
* records.
*
* Intel hex input format is
* Byte
* 1 Colon :
* 2..3 Record length, eg: "20"
* 4..7 load address nibbles
* 8..9 record type: "00" (data) or "02" base addr
* 10..x data bytes in ascii-hex
* x+1..x+2 cksum (2's compl of (len+addr+data))
* x+3 \n -- newline
*
* $Id$
*/
char *USAGE = "\
usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
-v -- verbose\n\
-a base -- 1st byte of output corresponds to this address\n\
-l -- linear, just writes data out\n\
-o file -- output file; must not be input file\n\
-F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
up to \"k_bits\" * 1024 bits\n\
";
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#define OK 0
#define FAILURE (-1)
#define Failed(x) ((x) == FAILURE)
#define TRUE 1
#define FALSE 0
typedef char bool;
#define STREQ(a,b) (strcmp(a,b) == 0)
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
/*
* Pick out designated bytes
*/
#define B0(x) ((x) & 0xff)
#define B1(x) B0((x) >> 8)
#define B2(x) B0((x) >> 16)
#define B3(x) B0((x) >> 24)
typedef struct buffer_rec {
u32 dl_destaddr;
u32 dl_jumpaddr;
int dl_count;
u8 dl_buf[512];
} buffer_rec;
/*
* vars controlled by command line options
*/
bool verbose = FALSE; /* be verbose */
bool linear = FALSE; /* just write out linear data */
char *outfilename = "-"; /* default output is stdout */
u32 base = 0L; /* base address */
u32 FFfill = 0L; /* how far to fill w 0xFF's */
extern char *optarg; /* getopt(3) control vars */
extern int optind;
extern int errno;
char *progname; /* for error() */
void error(int errn, ...);
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
#if (defined(sparc) && (sunos < 500))
#define stol(p) strtol(p, (char **) NULL, 0) /* Sunos */
#else
#define stol(p) strtoul(p, (char **) NULL, 0) /* Solaris */
#endif
int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
void write_record(buffer_rec *tb, FILE *fp);
int getnibble(char **p);
int getbyte(char **p);
long getNbytes(char **p, int n);
void badformat(char *s, char *fname, char *msg);
#define get1bytes(p) ((int) getbyte(p))
#define get2bytes(p) ((int) getNbytes(p, 2))
#define get3bytes(p) getNbytes(p, 3)
#define get4bytes(p) getNbytes(p, 4)
char *BADADDR = "Invalid record address";
char *BADLEN = "Invalid record length";
char *BADBASE = "Bad base or starting address";
char *BADFMT = "Unrecognized record type";
char *BADDATA = "Invalid data byte";
char *BADCSUM = "Invalid checksum";
char *MISCSUM = "Checksum mismatch";
char *BADTYPE = "Unrecognized record type";
char *MISTYPE = "Incompatible record types";
int
main(argc, argv)
int argc;
char **argv;
{
register int c;
bool showusage = FALSE; /* usage error? */
int rc = 0;
FILE *outfp, *infp;
/*
* figure out invocation leaf-name
*/
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
progname = argv[0];
else
progname++;
argv[0] = progname; /* for getopt err reporting */
/*
* Check options and arguments.
*/
progname = argv[0];
while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
switch (c)
{
case 'a': /* base address */
base = stol(optarg);
break;
case 'l': /* linear output */
linear = TRUE;
break;
case 'v': /* toggle verbose */
verbose = ! verbose;
break;
case 'o': /* output file */
outfilename = optarg;
break;
case 'F': /* 0xFF fill amount (bytes) */
FFfill = stol(optarg) * 1024L / 8L;
break;
case '?':
showusage = TRUE;
}
if (showusage)
{
(void) fprintf(stderr, "%s", USAGE);
exit(1);
}
if (linear && (base != 0))
{
error(0, "-l and -a may not be specified in combination");
exit(1);
}
if (STREQ(outfilename, "-"))
{
outfp = stdout;
outfilename = "stdout";
}
else
if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
{
error(-1, "couldn't open '%s' for output", outfilename);
exit(1);
}
/*
* Now process the input files (or stdin, if none specified)
*/
if (argv[optind] == (char *) NULL) /* just stdin */
exit(unhex(stdin, "stdin", outfp, outfilename));
else
for (; (optarg = argv[optind]); optind++)
{
if (STREQ(optarg, "-"))
rc += unhex(stdin, "stdin", outfp, outfilename);
else
{
if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
{
error(-1, "couldn't open '%s' for input", optarg);
exit(1);
}
rc += unhex(infp, optarg, outfp, outfilename);
}
}
return(rc);
}
u16 filesum;
int
unhex(FILE *ifp,
char *inm,
FILE *ofp,
char *onm)
{
int c;
filesum = 0;
/*
* Make sure holes will be filled with 0xFF's if requested. We
* do this the easy way by just filling the file with FF's before
* getting started. To do it more optimally would be quite a bit
* more difficult since the user can skip around as much as he/she
* likes in the input hex file addressing.
*
* We'll clean this up later (after this program has run) with
* 'stripffs'
*/
if (FFfill)
{
(void) fseek(ofp, 0, 0);
for (c = FFfill; c > 0; c--)
(void) fputc(0xFF, ofp);
}
/*
* Read the first char from file and determine record types
*/
if ((c = getc(ifp)) != EOF)
{
ungetc(c, ifp);
switch(c)
{
case 'S':
convert_S_records(ifp, inm, ofp, onm);
break;
case ':':
convert_Intel_records(ifp, inm, ofp, onm);
break;
case '9':
case 'B':
convert_TI_records(ifp, inm, ofp, onm);
break;
default:
{
char tmp[2];
tmp[0] = c; tmp[1] = 0;
badformat(tmp, inm, BADFMT);
}
}
}
if (verbose)
fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
return 0;
}
int
convert_Intel_records(
FILE *ifp,
char *inm,
FILE *ofp,
char *onm)
{
char buff[512];
char *p;
u8 cksum;
int incksum;
int c;
int rectype; /* record type */
int len; /* data length of current line */
u32 addr;
u32 base_address = 0;
bool endrecord = FALSE;
buffer_rec tb;
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
{
p = &buff[0];
if (p[strlen(p)-1] == '\n') /* get rid of newline */
p[strlen(p)-1] = '\0';
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
p[strlen(p)-1] = '\0';
tb.dl_count = 0;
if (*p != ':')
badformat(p, inm, BADFMT);
p++;
if ((len = getbyte(&p)) == -1) /* record len */
badformat(buff, inm, BADLEN);
if ((addr = get2bytes(&p)) == -1L) /* record addr */
badformat(buff, inm, BADADDR);
rectype = getbyte(&p);
cksum = len + B0(addr) + B1(addr) + rectype;
switch (rectype)
{
case 0x00: /* normal data record */
tb.dl_destaddr = base_address + addr;
while (len--)
{
if ((c = getbyte(&p)) == -1)
badformat(buff, inm, BADDATA);
cksum += c;
filesum += c;
tb.dl_buf[tb.dl_count++] = c;
}
break;
case 0x01: /* execution start address */
base_address = addr;
endrecord = TRUE;
break;
case 0x02: /* new base */
if ((base_address = get2bytes(&p)) == -1L)
badformat(buff, inm, BADBASE);
cksum += B0(base_address) + B1(base_address);
base_address <<= 4;
break;
case 0x03: /* seg/off execution start address */
{
u32 seg, off;
seg = get2bytes(&p);
off = get2bytes(&p);
if ((seg == -1L) || (off == -1L))
badformat(buff, inm, BADADDR);
cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
tb.dl_jumpaddr = (seg << 4) + off;
break;
}
default:
error(0, "unknown Intel-hex record type: 0x%02x", rectype);
badformat(buff, inm, BADTYPE);
}
/*
* Verify checksums are correct in file.
*/
cksum = (-cksum) & 0xff;
if ((incksum = getbyte(&p)) == -1)
badformat(buff, inm, BADCSUM);
if (((u8) incksum) != cksum)
badformat(buff, inm, MISCSUM);
if (tb.dl_count)
write_record(&tb, ofp);
}
return 0;
}
int
convert_S_records(
FILE *ifp,
char *inm,
FILE *ofp,
char *onm)
{
char buff[512];
char *p;
u8 cksum;
int incksum;
int c;
int len; /* data length of current line */
int rectype; /* record type */
u32 addr;
bool endrecord = FALSE;
buffer_rec tb;
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
{
p = &buff[0];
if (p[strlen(p)-1] == '\n') /* get rid of newline */
p[strlen(p)-1] = '\0';
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
p[strlen(p)-1] = '\0';
tb.dl_count = 0;
if (*p != 'S')
badformat(p, inm, BADFMT);
p++;
if ((rectype = getnibble(&p)) == -1) /* record type */
badformat(buff, inm, BADTYPE);
if ((len = getbyte(&p)) == -1) /* record len */
badformat(buff, inm, BADLEN);
cksum = len;
switch (rectype)
{
case 0x00: /* comment field, ignored */
goto write_it;
case 0x01: /* data record, 16 bit addr */
if ((addr = get2bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
len -= 3;
goto doit;
case 0x02: /* ... 24 bit addr */
if ((addr = get3bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
len -= 4;
goto doit;
case 0x03: /* ... 32 bit addr */
if ((addr = get4bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
len -= 5;
doit:
cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
tb.dl_destaddr = addr;
while (len--)
{
if ((c = getbyte(&p)) == -1)
badformat(buff, inm, BADDATA);
cksum += c;
filesum += c;
tb.dl_buf[tb.dl_count++] = c;
}
break;
case 0x07: /* 32 bit end record */
if ((addr = get4bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
goto end_rec;
case 0x08: /* 24 bit end record */
if ((addr = get3bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
goto end_rec;
case 0x09: /* 16 bit end record */
if ((addr = get2bytes(&p)) == -1L)
badformat(buff, inm, BADADDR);
end_rec:
cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
tb.dl_jumpaddr = addr;
break;
default:
error(0, "unknown Motorola-S record type: 0x%02x", rectype);
badformat(buff, inm, BADTYPE);
break;
}
/*
* Verify checksums are correct in file.
*/
cksum = (~cksum) & 0xff;
if ((incksum = getbyte(&p)) == -1)
badformat(buff, inm, BADCSUM);
if (((u8) incksum) != cksum)
badformat(buff, inm, MISCSUM);
write_it:
if (tb.dl_count)
write_record(&tb, ofp);
}
return 0;
}
int
convert_TI_records(
FILE *ifp,
char *inm,
FILE *ofp,
char *onm)
{
char buff[512];
char *p;
int c;
bool endrecord = FALSE;
bool eol;
buffer_rec tb;
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
{
if (p[strlen(p)-1] == '\n') /* get rid of newline */
p[strlen(p)-1] = '\0';
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
p[strlen(p)-1] = '\0';
tb.dl_count = 0;
p = &buff[0];
eol = FALSE;
while ( ! eol && ! endrecord)
{
switch (*p++)
{
case '9':
if (tb.dl_count)
write_record(&tb, ofp);
tb.dl_destaddr = get2bytes(&p);
break;
case 'B':
c = getbyte(&p);
filesum += c;
tb.dl_buf[tb.dl_count++] = c;
c = getbyte(&p);
filesum += c;
tb.dl_buf[tb.dl_count++] = c;
break;
case 'F':
eol = TRUE;
break;
case ':':
endrecord = TRUE;
break;
default:
badformat(p, inm, BADFMT);
}
}
if (tb.dl_count)
write_record(&tb, ofp);
}
return 0;
}
void
write_record(buffer_rec *tb,
FILE *fp)
{
if ( ! linear)
{
if (tb->dl_destaddr < base)
error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
tb->dl_destaddr, base);
(void) fseek(fp, tb->dl_destaddr - base, 0);
}
(void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
tb->dl_destaddr += tb->dl_count;
tb->dl_count = 0;
}
int
getnibble(char **p)
{
register int val;
**p = toupper(**p);
switch (**p)
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
val = **p - '0';
break;
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
val = 10 + (**p - 'A');
break;
default:
return(-1);
}
*p += 1;
return(val & 0x0f);
}
int
getbyte(char **p)
{
int n0, n1;
if ((n0 = getnibble(p)) == -1)
return(-1);
if ((n1 = getnibble(p)) == -1)
return(-1);
return(((n0 << 4) + n1) & 0xff);
}
long
getNbytes(char **p,
int n)
{
int t;
u32 val = 0;
while (n--)
{
if ((t = getbyte(p)) == -1)
return(-1L);
val <<= 8;
val += t;
}
return(val);
}
void
badformat(char *s,
char *fname,
char *msg)
{
if (s[strlen(s)-1] == '\n') /* get rid of newline */
s[strlen(s)-1] = '\0';
error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
exit(1);
}
/*
* error(errn, arglist)
* report an error to stderr using printf(3) conventions.
* Any output is preceded by '<progname>: '
*
* Uses ERR_EXIT bit to request exit(errn)
* ERR_ABORT to request abort()
* ERR_ERRNO to indicate use of errno instead of argument.
*
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
* associated error message is appended to the output.
*/
/*VARARGS*/
void
error(int error_flag, ...)
{
va_list arglist;
register char *format;
extern char *sys_errlist[];
extern int sys_nerr;
int local_errno;
extern int errno;
(void) fflush(stdout); /* in case stdout/stderr same */
local_errno = error_flag & ~ERR_MASK;
if (error_flag & ERR_ERRNO) /* use errno? */
local_errno = errno;
va_start(arglist, error_flag);
format = va_arg(arglist, char *);
(void) fprintf(stderr, "%s: ", progname);
(void) vfprintf(stderr, format, arglist);
va_end(arglist);
if (local_errno)
if ((local_errno > 0) && (local_errno < sys_nerr))
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
else
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
else
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
if (error_flag & (ERR_FATAL | ERR_ABORT))
{
if (error_flag & ERR_FATAL)
{
error(0, "fatal error, exiting");
exit(local_errno ? local_errno : 1);
}
else
{
error(0, "fatal error, aborting");
abort();
}
}
}

View File

@@ -1,51 +0,0 @@
/* clock.h
*
* This file describes the Clock Driver for all boards.
*
* 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 __CLOCK_DRIVER_h
#define __CLOCK_DRIVER_h
#ifdef __cplusplus
extern "C" {
#endif
/* variables */
extern volatile rtems_unsigned32 Clock_driver_ticks;
extern rtems_device_major_number rtems_clock_major;
extern rtems_device_minor_number rtems_clock_minor;
/* default clock driver entry */
#define CLOCK_DRIVER_TABLE_ENTRY \
{ Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
rtems_device_driver Clock_initialize(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver Clock_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,69 +0,0 @@
/* console.h
*
* This file describes the Console Device Driver for all boards.
* This driver provides support for the standard C Library.
*
* 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 _CONSOLE_DRIVER_h
#define _CONSOLE_DRIVER_h
#ifdef __cplusplus
extern "C" {
#endif
#define CONSOLE_DRIVER_TABLE_ENTRY \
{ console_initialize, console_open, console_close, \
console_read, console_write, console_control }
rtems_device_driver console_initialize(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver console_open(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver console_close(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver console_read(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver console_write(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver console_control(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,44 +0,0 @@
/* iosupp.h
*
* 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 __IOSUPP_h
#define __IOSUPP_h
#ifdef __cplusplus
extern "C" {
#endif
/* character constants */
#define BS 0x08 /* backspace */
#define LF 0x0a /* line feed */
#define CR 0x0d /* carriage return */
#define XON 0x11 /* control-Q */
#define XOFF 0x13 /* control-S */
/* structures */
#ifdef IOSUPP_INIT
#define IOSUPP_EXTERN
#else
#undef IOSUPP_EXTERN
#define IOSUPP_EXTERN extern
#endif
/* functions */
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,53 +0,0 @@
/*
* ringbuf.h
*
* This file provides simple ring buffer functionality.
*
* $Id$
*/
#ifndef __RINGBUF_H__
#define __RINGBUF_H__
#ifndef RINGBUF_QUEUE_LENGTH
#define RINGBUF_QUEUE_LENGTH 128
#endif
typedef struct {
char buffer[RINGBUF_QUEUE_LENGTH];
volatile int head;
volatile int tail;
} Ring_buffer_t;
#define Ring_buffer_Initialize( _buffer ) \
do { \
(_buffer)->head = (_buffer)->tail = 0; \
} while ( 0 )
#define Ring_buffer_Is_empty( _buffer ) \
( (_buffer)->head == (_buffer)->tail )
#define Ring_buffer_Is_full( _buffer ) \
( (_buffer)->head == ((_buffer)->tail + 1) % RINGBUF_QUEUE_LENGTH )
#define Ring_buffer_Add_character( _buffer, _ch ) \
do { \
rtems_unsigned32 isrlevel; \
\
rtems_interrupt_disable( isrlevel ); \
(_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
(_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
rtems_interrupt_enable( isrlevel ); \
} while ( 0 )
#define Ring_buffer_Remove_character( _buffer, _ch ) \
do { \
rtems_unsigned32 isrlevel; \
\
rtems_interrupt_disable( isrlevel ); \
(_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
(_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
rtems_interrupt_enable( isrlevel ); \
} while ( 0 )
#endif

View File

@@ -1,42 +0,0 @@
/*
*
* Rtems associativity routines. Mainly used to convert a value from
* one space to another (eg: our errno's to host errno's and v.v)
*
*
* $Id$
*/
#ifndef _INCLUDE_ASSOC_H
#define _INCLUDE_ASSOC_H
typedef struct {
const char *name;
unsigned32 local_value;
unsigned32 remote_value;
} rtems_assoc_t;
/*
* Flag/marker for optional default value in each table
*/
#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
#endif /* ! _INCLUDE_ASSOC_H */

View File

@@ -1,33 +0,0 @@
/*
* Defines and externs for rtems error reporting
*
* $Id$
*/
#ifndef __RTEMS_ERROR_h
#define __RTEMS_ERROR_h
/*
* rtems_error() and rtems_panic() support
*/
#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
RTEMS_ERROR_PANIC) /* all */
const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...);
#ifdef __GNUC__
void rtems_panic(const char *printf_format, ...)
__attribute__ ((__noreturn__));
#else
void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress;
#endif
/* end of include file */

View File

@@ -1,42 +0,0 @@
/* libcsupport.h
*
* This include file contains the information regarding the
* RTEMS specific support for the standard C library.
*
* 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 __LIBC_SUPPORT_h
#define __LIBC_SUPPORT_h
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
void RTEMS_Malloc_Initialize(
void *start,
size_t length,
size_t sbrk_amount
);
extern void malloc_dump(void);
extern void libc_init(int reentrant);
extern int host_errno(void);
extern void fix_syscall_errno(void);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,98 +0,0 @@
/*
* General purpose communication channel for RTEMS to allow UNIX/POSIX
* system call behavior on top of RTEMS IO devices.
*
* TODO
* stat(2)
* unlink(2)
* rename(2)
*
* $Id$
*/
#ifndef _RTEMS_LIBIO_H
#define _RTEMS_LIBIO_H
typedef unsigned32 rtems_libio_offset_t;
/*
* An open file data structure, indexed by 'fd'
* TODO:
* should really have a separate per/file data structure that this
* points to (eg: size, offset, driver, pathname should be in that)
*/
typedef struct {
rtems_driver_name_t *driver;
rtems_libio_offset_t size; /* size of file */
rtems_libio_offset_t offset; /* current offset into the file */
unsigned32 flags;
char *pathname; /* opened pathname */
Objects_Id sem;
unsigned32 data0; /* private to "driver" */
unsigned32 data1; /* ... */
} rtems_libio_t;
/*
* param block for read/write
* Note: it must include 'offset' instead of using iop's offset since
* we can have multiple outstanding i/o's on a device.
*/
typedef struct {
rtems_libio_t *iop;
rtems_libio_offset_t offset;
unsigned8 *buffer;
unsigned32 count;
unsigned32 flags;
unsigned32 bytes_moved;
} rtems_libio_rw_args_t;
/*
* param block for open/close
*/
typedef struct {
rtems_libio_t *iop;
unsigned32 flags;
unsigned32 mode;
} rtems_libio_open_close_args_t;
/*
* param block for ioctl
*/
typedef struct {
rtems_libio_t *iop;
unsigned32 command;
void *buffer;
unsigned32 ioctl_return;
} rtems_libio_ioctl_args_t;
/*
* Values for 'flag'
*/
#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
#define LIBIO_FLAGS_READ 0x0002 /* reading */
#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
#define LIBIO_FLAGS_LINE_BUFFERED 0x0008 /* line buffered io (^h, ^u, etc) */
#define LIBIO_FLAGS_OPEN 0x0100 /* device is open */
#define LIBIO_FLAGS_APPEND 0x0200 /* all writes append */
#define LIBIO_FLAGS_CREATE 0x0400 /* create file */
#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
void rtems_libio_config(rtems_configuration_table *config, unsigned32 max_fds);
void rtems_libio_init(void);
int __open(const char *pathname, unsigned32 flag, unsigned32 mode);
int __close(int fd);
int __read(int fd, void *buffer, unsigned32 count);
int __write(int fd, const void *buffer, unsigned32 count);
int __ioctl(int fd, unsigned32 command, void *buffer);
int __lseek(int fd, rtems_libio_offset_t offset, int whence);
#endif /* _RTEMS_LIBIO_H */

View File

@@ -1,38 +0,0 @@
/* spurious.h
*
* This file describes the Spurious Interrupt Driver for all boards.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
* 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$
*/
#ifndef __SPURIOUS_h
#define __SPURIOUS_h
#ifdef __cplusplus
extern "C" {
#endif
#define SPURIOUS_DRIVER_TABLE_ENTRY \
{ Spurious_Initialize, NULL, NULL, NULL, NULL, NULL }
rtems_device_driver Spurious_Initialize(
rtems_device_major_number,
rtems_device_minor_number,
void *,
rtems_id,
rtems_unsigned32 *
);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

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

@@ -1,40 +0,0 @@
/* timerdrv.h
*
* This file describes the Timer Driver for all boards.
*
* 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 __TIMER_DRIVER_h
#define __TIMER_DRIVER_h
#ifdef __cplusplus
extern "C" {
#endif
/* functions */
void Timer_initialize( void );
rtems_unsigned32 Read_timer( void );
rtems_status_code Empty_function( void );
void Set_find_average_overhead(
rtems_boolean find_flag
);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,58 +0,0 @@
/*
* vmeintr.h
*
* This file is the specification for the VMEbus interface library
* which should be provided by all BSPs for VMEbus Single Board
* Computers but currently only a few do so.
*
* 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 __VME_INTERRUPT_h
#define __VME_INTERRUPT_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* This defines the mask which is used to determine which
* interrupt levels are affected by a call to this package.
* The LSB corresponds to VME interrupt 0 and the MSB
* to VME interrupt 7.
*
*/
typedef rtems_unsigned8 VME_interrupt_Mask;
/*
* VME_interrupt_Disable
*
*/
void VME_interrupt_Disable (
VME_interrupt_Mask mask /* IN */
);
/*
* VME_interrupt_Disable
*
*/
void VME_interrupt_Enable (
VME_interrupt_Mask mask /* IN */
);
#ifdef __cplusplus
}
#endif
#endif /* end of include file */

View File

@@ -1,37 +0,0 @@
--
-- $Id$
--
Overview of newlib support (newlib is from CYGNUS)
Each task can have its own libc state including:
open stdio files
strtok
multi precision arithmetic state
etc.
This is implemented by a reentrancy data structure for each task.
When a task is "started" (in RTEMS sense) the reentrancy structure
is allocated. Its address is stored in notepad[NOTEPAD_LAST].
When task is switched to, the value of global variable _impure_ptr
is changed to the value of the new tasks reentrancy structure.
When a task is deleted
atexit() processing (for that task) happens
task's stdio buffers are flushed
When exit(3) is called
calling task's atexit processing done
global libc state atexit processing done
(this will include any atexit routines installed by drivers)
executive is shutdown
causes a context switch back to bsp land
NOTE:
libc extension are installed by bsp_libc_init()
iff we are using clock interrupts.
This hack is necessary to allow the tmtests to avoid
timing the extensions.

View File

@@ -1,44 +0,0 @@
#if !defined(RTEMS_UNIX)
/*
* RTEMS "Broken" __brk/__sbrk Implementation
*
* NOTE: sbrk is BSP provided.
*
*
* 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$
*/
#include <rtems.h>
#include <signal.h>
#include <errno.h>
#include <sys/types.h>
#ifdef RTEMS_NEWLIB
#include <reent.h>
#endif
#include <unistd.h>
/* we use RTEMS for memory management. We don't need sbrk */
void * __sbrk(int incr)
{
errno = EINVAL;
return (void *)0;
}
int __brk( const void *endds )
{
errno = EINVAL;
return -1;
}
#endif

View File

@@ -1,103 +0,0 @@
#if !defined(RTEMS_UNIX)
/*
* RTEMS gettimeofday Implementation
*
*
* 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$
*/
#include <rtems.h>
#ifdef RTEMS_NEWLIB
#include <sys/reent.h>
#endif
#include <time.h>
#include <sys/time.h>
#include <errno.h>
#include <assert.h>
/*
* NOTE: The solaris gettimeofday does not have a second parameter.
*/
int gettimeofday(
struct timeval *tp,
struct timezone *tzp
)
{
rtems_status_code status;
rtems_clock_time_value time;
if ( !tp ) {
errno = EFAULT;
return -1;
}
/* "POSIX" does not seem to allow for not having a TOD */
status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &time );
if ( status != RTEMS_SUCCESSFUL ) {
assert( 0 );
return -1;
}
tp->tv_sec = time.seconds;
tp->tv_usec = time.microseconds;
/*
* newlib does not have timezone and daylight savings time
* yet. When it does this needs to be fixed.
*/
#if 0
if ( tzp ) {
tzp->tz_minuteswest = 0; /* at UTC */
tzp->tz_dsttime = 0; /* no daylight savings */
tzp->minuteswest = timezone / 60; /* from seconds to minutes */
tzp->dsttime = daylight;
}
#endif
return 0;
}
#if defined(RTEMS_NEWLIB)
#if 0
/*
* "Reentrant" version
*/
int _gettimeofday_r(
struct _reent *ignored_reentrancy_stuff,
struct timeval *tp,
struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
}
#endif
/*
* "System call" version
*/
int _gettimeofday(
struct timeval *tp,
struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
}
#endif /* defined(RTEMS_NEWLIB) */
#endif

View File

@@ -1,65 +0,0 @@
/*
* RTEMS _times Implementation
*
*
* 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$
*/
#include <rtems.h>
#include <sys/times.h>
#include <time.h>
#include <sys/time.h>
#include <errno.h>
#include <assert.h>
clock_t _times(
struct tms *ptms
)
{
rtems_status_code status;
rtems_interval ticks_since_boot;
if ( !ptms ) {
errno = EFAULT;
return -1;
}
/* "POSIX" does not seem to allow for not having a TOD */
status = rtems_clock_get(
RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
&ticks_since_boot
);
if ( status != RTEMS_SUCCESSFUL ) {
assert( 0 );
return -1;
}
/*
* RTEMS has no notion of system versus user time and does
* not (as of 3.2.0) keep track of CPU usage on a per task basis.
*/
ptms->tms_utime = ticks_since_boot;
ptms->tms_stime = 0;
ptms->tms_cutime = 0;
ptms->tms_cstime = 0;
return 0;
}
clock_t times(
struct tms *ptms
)
{
return _times( ptms );
}

View File

@@ -1,260 +0,0 @@
/*
* assoc.c
* rtems assoc routines
*
* $Id$
*/
#include <rtems.h>
#include "assoc.h"
#include <stdio.h> /* sprintf */
#include <string.h> /* strcat, strcmp */
#define STREQ(a,b) (strcmp((a), (b)) == 0)
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
const rtems_assoc_t *
rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (strcmp(ap->name, name) == 0)
return ap;
return default_ap;
}
const rtems_assoc_t *
rtems_assoc_ptr_by_local(
const rtems_assoc_t *ap,
unsigned32 local_value
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->local_value == local_value)
return ap;
return default_ap;
}
const rtems_assoc_t *
rtems_assoc_ptr_by_remote(
const rtems_assoc_t *ap,
unsigned32 remote_value
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->remote_value == remote_value)
return ap;
return default_ap;
}
/*
* Get values
*/
unsigned32
rtems_assoc_remote_by_local(
const rtems_assoc_t *ap,
unsigned32 local_value
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_local(ap, local_value);
if (nap)
return nap->remote_value;
return 0;
}
unsigned32
rtems_assoc_local_by_remote(
const rtems_assoc_t *ap,
unsigned32 remote_value
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_remote(ap, remote_value);
if (nap)
return nap->local_value;
return 0;
}
unsigned32
rtems_assoc_remote_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_name(ap, name);
if (nap)
return nap->remote_value;
return 0;
}
unsigned32
rtems_assoc_local_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_name(ap, name);
if (nap)
return nap->local_value;
return 0;
}
/*
* what to return if a value is not found
* this is not reentrant, but it really shouldn't be invoked anyway
*/
const char *
rtems_assoc_name_bad(
unsigned32 bad_value
)
{
#ifdef RTEMS_DEBUG
static char bad_buffer[32];
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
#else
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
#endif
return bad_buffer;
}
const char *
rtems_assoc_name_by_local(
const rtems_assoc_t *ap,
unsigned32 local_value
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_local(ap, local_value);
if (nap)
return nap->name;
return rtems_assoc_name_bad(local_value);
}
const char *
rtems_assoc_name_by_remote(
const rtems_assoc_t *ap,
unsigned32 remote_value
)
{
const rtems_assoc_t *nap;
nap = rtems_assoc_ptr_by_remote(ap, remote_value);
if (nap)
return nap->name;
return rtems_assoc_name_bad(remote_value);
}
/*
* Bitfield functions assume just 1 bit set in each of remote and local
* entries; they do not check for this.
*/
unsigned32 rtems_assoc_remote_by_local_bitfield(
const rtems_assoc_t *ap,
unsigned32 local_value
)
{
unsigned32 b;
unsigned32 remote_value = 0;
for (b = 1; b; b <<= 1)
if (b & local_value)
remote_value |= rtems_assoc_remote_by_local(ap, b);
return remote_value;
}
unsigned32 rtems_assoc_local_by_remote_bitfield(
const rtems_assoc_t *ap,
unsigned32 remote_value
)
{
unsigned32 b;
unsigned32 local_value = 0;
for (b = 1; b; b <<= 1)
if (b & remote_value)
local_value |= rtems_assoc_local_by_remote(ap, b);
return local_value;
}
char *
rtems_assoc_name_by_remote_bitfield(
const rtems_assoc_t *ap,
unsigned32 value,
char *buffer
)
{
unsigned32 b;
*buffer = 0;
for (b = 1; b; b <<= 1)
if (b & value)
{
if (*buffer)
strcat(buffer, " ");
strcat(buffer, rtems_assoc_name_by_remote(ap, b));
}
return buffer;
}
char *
rtems_assoc_name_by_local_bitfield(
const rtems_assoc_t *ap,
unsigned32 value,
char *buffer
)
{
unsigned32 b;
*buffer = 0;
for (b = 1; b; b <<= 1)
if (b & value)
{
if (*buffer)
strcat(buffer, " ");
strcat(buffer, rtems_assoc_name_by_local(ap, b));
}
return buffer;
}

View File

@@ -1,209 +0,0 @@
/*
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
* $Id$
*/
/*
* These routines provide general purpose error reporting.
* rtems_error reports an error to stderr and allows use of
* printf style formatting. A newline is appended to all messages.
*
* error_flag can be specified as any of the following:
*
* RTEMS_ERROR_ERRNO -- include errno text in output
* RTEMS_ERROR_PANIC -- halts local system after output
* RTEMS_ERROR_ABORT -- abort after output
*
* It can also include a rtems_status value which can be OR'd
* with the above flags. *
*
* EXAMPLE
* #include <rtems.h>
* #include <rtems/error.h>
* rtems_error(0, "stray interrupt %d", intr);
*
* EXAMPLE
* if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
* {
* rtems_error(status | RTEMS_ERROR_ABORT,
* "could not create task");
* }
*
* EXAMPLE
* if ((fd = open(pathname, O_RDNLY)) < 0)
* {
* rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
* goto failed;
* }
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include "error.h"
#include <rtems/assoc.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> /* _exit() */
/* bug in hpux <errno.h>: no prototypes unless you are C++ */
#ifdef hpux9
char *strerror(int);
#endif
extern char *rtems_progname;
int rtems_panic_in_progress;
rtems_assoc_t rtems_status_assoc[] = {
{ "successful completion", RTEMS_SUCCESSFUL, },
{ "returned from a thread", RTEMS_TASK_EXITTED, },
{ "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
{ "invalid object name", RTEMS_INVALID_NAME, },
{ "invalid object id", RTEMS_INVALID_ID, },
{ "too many", RTEMS_TOO_MANY, },
{ "timed out waiting", RTEMS_TIMEOUT, },
{ "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
{ "specified size was invalid", RTEMS_INVALID_SIZE, },
{ "address specified is invalid", RTEMS_INVALID_ADDRESS, },
{ "number was invalid", RTEMS_INVALID_NUMBER, },
{ "item has not been initialized", RTEMS_NOT_DEFINED, },
{ "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
{ "request not satisfied", RTEMS_UNSATISFIED, },
{ "thread is in wrong state", RTEMS_INCORRECT_STATE, },
{ "thread already in state", RTEMS_ALREADY_SUSPENDED, },
{ "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
{ "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
{ "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
{ "invalid thread priority", RTEMS_INVALID_PRIORITY, },
{ "invalid date/time", RTEMS_INVALID_CLOCK, },
{ "invalid node id", RTEMS_INVALID_NODE, },
{ "directive not configured", RTEMS_NOT_CONFIGURED, },
{ "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
{ "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
{ "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
{ "could not get enough memory", RTEMS_NO_MEMORY, },
{ "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
{ 0, 0, 0 },
};
const char *
rtems_status_text(
rtems_status_code status
)
{
return rtems_assoc_name_by_local(rtems_status_assoc, status);
}
static int rtems_verror(
unsigned32 error_flag,
const char *printf_format,
va_list arglist
)
{
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC)
{
rtems_panic_in_progress++;
/* disable task switches */
_Thread_Disable_dispatch();
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
local_errno = errno;
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
if (rtems_progname && *rtems_progname)
chars_written += fprintf(stderr, "%s: ", rtems_progname);
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno)
if ((local_errno > 0) && *strerror(local_errno))
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
chars_written += fprintf(stderr, "\n");
(void) fflush(stderr);
if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
{
if (error_flag & RTEMS_ERROR_PANIC)
{
rtems_error(0, "fatal error, exiting");
_exit(local_errno);
}
else
{
rtems_error(0, "fatal error, aborting");
abort();
}
}
return chars_written;
}
/*
* Report an error.
* error_flag is as above; printf_format is a normal
* printf(3) format string, with its concommitant arguments.
*
* Returns the number of characters written.
*/
int rtems_error(
int error_flag,
const char *printf_format,
...
)
{
va_list arglist;
int chars_written;
va_start(arglist, printf_format);
chars_written = rtems_verror(error_flag, printf_format, arglist);
va_end(arglist);
return chars_written;
}
/*
* rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
*/
void rtems_panic(
const char *printf_format,
...
)
{
va_list arglist;
va_start(arglist, printf_format);
(void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
va_end(arglist);
}

View File

@@ -1,43 +0,0 @@
/*
* Routines to access a host errno
*
* 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$
*/
#include <rtems.h>
#include <errno.h>
int host_errno(void);
/*
* copy host errno, if any to thread aware errno, if any
*/
void fix_syscall_errno(void)
{
errno = host_errno();
}
/*
* Get the host system errno, if any
* When using newlib (or possibly other libc's) on top of UNIX
* the errno returned by system calls may be unavailable due
* to trickery of making errno thread aware.
* This provides a kludge of getting at it.
*/
#undef errno
extern int errno;
int host_errno(void)
{
return errno;
}

View File

@@ -1,444 +0,0 @@
/*
* Provide UNIX/POSIX-like io system calls for RTEMS using the
* RTEMS IO manager
*
* $Id$
*/
#include <rtems.h>
#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
#include <stdio.h> /* O_RDONLY, et.al. */
#include <fcntl.h> /* O_RDONLY, et.al. */
#if ! defined(O_NDELAY)
# if defined(solaris2)
# define O_NDELAY O_NONBLOCK
# elif defined(RTEMS_NEWLIB)
# define O_NDELAY _FNBIO
# endif
#endif
#include <errno.h>
#include <string.h> /* strcmp */
#include <unistd.h>
#include <stdlib.h> /* calloc() */
#include "libio.h" /* libio.h not pulled in by rtems */
/*
* Semaphore to protect the io table
*/
Objects_Id rtems_libio_semaphore;
#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
unsigned32 rtems_libio_number_iops;
rtems_libio_t *rtems_libio_iops;
rtems_libio_t *rtems_libio_last_iop;
#define rtems_libio_iop(fd) ((((unsigned32)(fd)) < rtems_libio_number_iops) ? \
&rtems_libio_iops[fd] : 0)
#define rtems_libio_check_fd(fd) \
do { \
if ((fd) >= rtems_libio_number_iops) \
{ \
errno = EBADF; \
return -1; \
} \
} while (0)
#define rtems_libio_check_buffer(buffer) \
do { \
if ((buffer) == 0) \
{ \
errno = EINVAL; \
return -1; \
} \
} while (0)
#define rtems_libio_check_count(count) \
do { \
if ((count) == 0) \
{ \
return 0; \
} \
} while (0)
#define rtems_libio_check_permissions(iop, flag) \
do { \
if (((iop)->flags & (flag)) == 0) \
{ \
errno = EINVAL; \
return -1; \
} \
} while (0)
void
rtems_libio_config(
rtems_configuration_table *config,
unsigned32 max_fds
)
{
rtems_libio_number_iops = max_fds;
/*
* tweak config to reflect # of semaphores we will need
*/
/* one for iop table */
config->RTEMS_api_configuration->maximum_semaphores += 1;
config->RTEMS_api_configuration->maximum_semaphores += max_fds;
}
/*
* Called by bsp startup code to init the libio area.
*/
void
rtems_libio_init(void)
{
rtems_status_code rc;
if (rtems_libio_number_iops > 0)
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
rtems_libio_last_iop = rtems_libio_iops + (rtems_libio_number_iops - 1);
}
rc = rtems_semaphore_create(
RTEMS_LIBIO_SEM,
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if (rc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(rc);
}
/*
* Convert RTEMS status to a UNIX errno
*/
rtems_assoc_t errno_assoc[] = {
{ "OK", RTEMS_SUCCESSFUL, 0 },
{ "TIMEOUT", RTEMS_TIMEOUT, ETIME },
{ "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM },
{ 0, 0, 0 },
};
static unsigned32
rtems_libio_errno(rtems_status_code code)
{
int rc;
if ((rc = rtems_assoc_remote_by_local(errno_assoc, (unsigned32) code)))
{
errno = rc;
return -1;
}
return 0;
}
/*
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
*/
rtems_assoc_t access_modes_assoc[] = {
{ "READ", LIBIO_FLAGS_READ, O_RDONLY },
{ "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
{ "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
{ 0, 0, 0 },
};
rtems_assoc_t status_flags_assoc[] = {
{ "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
{ "APPEND", LIBIO_FLAGS_APPEND, O_APPEND },
{ "CREATE", LIBIO_FLAGS_CREATE, O_CREAT },
{ 0, 0, 0 },
};
static unsigned32
rtems_libio_fcntl_flags(unsigned32 fcntl_flags)
{
unsigned32 flags = 0;
unsigned32 access_modes;
/*
* Access mode is a small integer
*/
access_modes = fcntl_flags & O_ACCMODE;
fcntl_flags &= ~O_ACCMODE;
flags = rtems_assoc_local_by_remote(access_modes_assoc, access_modes);
/*
* Everything else is single bits
*/
flags |= rtems_assoc_local_by_remote_bitfield(status_flags_assoc, fcntl_flags);
return flags;
}
static rtems_libio_t *
rtems_libio_allocate(void)
{
rtems_libio_t *iop;
rtems_status_code rc;
rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
for (iop = rtems_libio_iops; iop <= rtems_libio_last_iop; iop++)
if ((iop->flags & LIBIO_FLAGS_OPEN) == 0)
{
/*
* Got one; create a semaphore for it
*/
rc = rtems_semaphore_create(
RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&iop->sem
);
if (rc != RTEMS_SUCCESSFUL)
goto failed;
iop->flags = LIBIO_FLAGS_OPEN;
goto done;
}
failed:
iop = 0;
done:
rtems_semaphore_release(rtems_libio_semaphore);
return iop;
}
static void
rtems_libio_free(rtems_libio_t *iop)
{
rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (iop->sem)
rtems_semaphore_delete(iop->sem);
(void) memset(iop, 0, sizeof(*iop));
rtems_semaphore_release(rtems_libio_semaphore);
}
int
__open(
const char *pathname,
unsigned32 flag,
unsigned32 mode)
{
rtems_status_code rc;
rtems_libio_t *iop = 0;
rtems_driver_name_t *np;
rtems_libio_open_close_args_t args;
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
goto done;
iop = rtems_libio_allocate();
if (iop == 0)
{
rc = RTEMS_TOO_MANY;
goto done;
}
iop->driver = np;
iop->pathname = (char *) pathname;
iop->flags |= rtems_libio_fcntl_flags(flag);
args.iop = iop;
args.flags = iop->flags;
args.mode = mode;
rc = rtems_io_open(np->major, np->minor, (void *) &args);
done:
if (rc != RTEMS_SUCCESSFUL)
{
if (iop)
rtems_libio_free(iop);
return rtems_libio_errno(rc);
}
return iop - rtems_libio_iops;
}
int
__close(
int fd
)
{
rtems_status_code rc;
rtems_driver_name_t *np;
rtems_libio_t *iop = rtems_libio_iop(fd);
rtems_libio_open_close_args_t args;
rtems_libio_check_fd(fd);
np = iop->driver;
args.iop = iop;
args.flags = 0;
args.mode = 0;
rc = rtems_io_close(np->major, np->minor, (void *) &args);
if (rc != RTEMS_SUCCESSFUL)
return rtems_libio_errno(rc);
return 0;
}
int
__read(
int fd,
void * buffer,
unsigned32 count
)
{
rtems_status_code rc;
rtems_driver_name_t *np;
rtems_libio_t *iop = rtems_libio_iop(fd);
rtems_libio_rw_args_t args;
rtems_libio_check_fd(fd);
rtems_libio_check_buffer(buffer);
rtems_libio_check_count(count);
rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
np = iop->driver;
args.iop = iop;
args.offset = iop->offset;
args.buffer = buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
rc = rtems_io_read(np->major, np->minor, (void *) &args);
iop->offset += args.bytes_moved;
if (rc != RTEMS_SUCCESSFUL)
return rtems_libio_errno(rc);
return args.bytes_moved;
}
int
__write(
int fd,
const void *buffer,
unsigned32 count
)
{
rtems_status_code rc;
rtems_driver_name_t *np;
rtems_libio_t *iop = rtems_libio_iop(fd);
rtems_libio_rw_args_t args;
rtems_libio_check_fd(fd);
rtems_libio_check_buffer(buffer);
rtems_libio_check_count(count);
rtems_libio_check_permissions(iop, LIBIO_FLAGS_WRITE);
np = iop->driver;
args.iop = iop;
args.offset = iop->offset;
args.buffer = (void *) buffer;
args.count = count;
args.flags = iop->flags;
args.bytes_moved = 0;
rc = rtems_io_write(np->major, np->minor, (void *) &args);
iop->offset += args.bytes_moved;
if (rc != RTEMS_SUCCESSFUL)
return rtems_libio_errno(rc);
return args.bytes_moved;
}
int
__ioctl(
int fd,
unsigned32 command,
void * buffer)
{
rtems_status_code rc;
rtems_driver_name_t *np;
rtems_libio_t *iop = rtems_libio_iop(fd);
rtems_libio_ioctl_args_t args;
rtems_libio_check_fd(fd);
np = iop->driver;
args.iop = iop;
args.command = command;
args.buffer = buffer;
rc = rtems_io_control(np->major, np->minor, (void *) &args);
if (rc != RTEMS_SUCCESSFUL)
return rtems_libio_errno(rc);
return args.ioctl_return;
}
/*
* internal only??
*/
int
__lseek(
int fd,
rtems_libio_offset_t offset,
int whence
)
{
rtems_libio_t *iop = rtems_libio_iop(fd);
rtems_libio_check_fd(fd);
switch (whence)
{
case SEEK_SET:
iop->offset = offset;
break;
case SEEK_CUR:
iop->offset += offset;
break;
case SEEK_END:
iop->offset = iop->size - offset;
break;
default:
errno = EINVAL;
return -1;
}
return 0;
}

View File

@@ -1,369 +0,0 @@
/*
* RTEMS Malloc Family Implementation
*
*
* 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$
*/
#include <rtems.h>
#include "libcsupport.h"
#ifdef RTEMS_NEWLIB
#include <sys/reent.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <unistd.h> /* sbrk(2) */
rtems_id RTEMS_Malloc_Heap;
size_t RTEMS_Malloc_Sbrk_amount;
#ifdef RTEMS_DEBUG
#define MALLOC_STATS
#define MALLOC_DIRTY
#endif
#ifdef MALLOC_STATS
#define MSBUMP(f,n) malloc_stats.f += (n)
struct {
unsigned32 space_available; /* current size of malloc area */
unsigned32 malloc_calls; /* # calls to malloc */
unsigned32 free_calls;
unsigned32 realloc_calls;
unsigned32 calloc_calls;
unsigned32 max_depth; /* most ever malloc'd at 1 time */
unsigned64 lifetime_allocated;
unsigned64 lifetime_freed;
} malloc_stats;
#else /* No malloc_stats */
#define MSBUMP(f,n)
#endif
void RTEMS_Malloc_Initialize(
void *start,
size_t length,
size_t sbrk_amount
)
{
rtems_status_code status;
void *starting_address;
rtems_unsigned32 old_address;
rtems_unsigned32 u32_address;
/*
* If the starting address is 0 then we are to attempt to
* get length worth of memory using sbrk. Make sure we
* align the address that we get back.
*/
starting_address = start;
RTEMS_Malloc_Sbrk_amount = sbrk_amount;
if (!starting_address) {
u32_address = (unsigned int)sbrk(length);
if (u32_address == -1) {
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
/* DOES NOT RETURN!!! */
}
if (u32_address & (CPU_ALIGNMENT-1)) {
old_address = u32_address;
u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
/*
* adjust the length by whatever we aligned by
*/
length -= u32_address - old_address;
}
starting_address = (void *)u32_address;
}
/*
* Unfortunately we cannot use assert if this fails because if this
* has failed we do not have a heap and if we do not have a heap
* STDIO cannot work because there will be no buffers.
*/
status = rtems_region_create(
rtems_build_name( 'H', 'E', 'A', 'P' ),
starting_address,
length,
CPU_ALIGNMENT,
RTEMS_DEFAULT_ATTRIBUTES,
&RTEMS_Malloc_Heap
);
if ( status != RTEMS_SUCCESSFUL )
rtems_fatal_error_occurred( status );
#ifdef MALLOC_STATS
/* zero all the stats */
(void) memset(&malloc_stats, 0, sizeof(malloc_stats));
#endif
MSBUMP(space_available, length);
}
void *malloc(
size_t size
)
{
void *return_this;
void *starting_address;
rtems_unsigned32 the_size;
rtems_unsigned32 sbrk_amount;
rtems_status_code status;
MSBUMP(malloc_calls, 1);
if ( !size )
return (void *) 0;
/*
* Try to give a segment in the current region if there is not
* enough space then try to grow the region using rtems_region_extend().
* If this fails then return a NULL pointer.
*/
status = rtems_region_get_segment(
RTEMS_Malloc_Heap,
size,
RTEMS_NO_WAIT,
RTEMS_NO_TIMEOUT,
&return_this
);
if ( status != RTEMS_SUCCESSFUL ) {
/*
* Round to the "requested sbrk amount" so hopefully we won't have
* to grow again for a while. This effectively does sbrk() calls
* in "page" amounts.
*/
sbrk_amount = RTEMS_Malloc_Sbrk_amount;
if ( sbrk_amount == 0 )
return (void *) 0;
the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
if (((rtems_unsigned32)starting_address = sbrk(the_size)) == -1)
return (void *) 0;
status = rtems_region_extend(
RTEMS_Malloc_Heap,
starting_address,
the_size
);
if ( status != RTEMS_SUCCESSFUL ) {
sbrk(-the_size);
errno = ENOMEM;
return (void *) 0;
}
MSBUMP(space_available, the_size);
status = rtems_region_get_segment(
RTEMS_Malloc_Heap,
size,
RTEMS_NO_WAIT,
RTEMS_NO_TIMEOUT,
&return_this
);
if ( status != RTEMS_SUCCESSFUL ) {
errno = ENOMEM;
return (void *) 0;
}
}
#ifdef MALLOC_STATS
if (return_this)
{
unsigned32 actual_size;
unsigned32 current_depth;
status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
MSBUMP(lifetime_allocated, actual_size);
current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
if (current_depth > malloc_stats.max_depth)
malloc_stats.max_depth = current_depth;
}
#endif
#ifdef MALLOC_DIRTY
(void) memset(return_this, 0xCF, size);
#endif
return return_this;
}
void *calloc(
size_t nelem,
size_t elsize
)
{
register char *cptr;
int length;
MSBUMP(calloc_calls, 1);
length = nelem * elsize;
cptr = malloc( length );
if ( cptr )
memset( cptr, '\0', length );
MSBUMP(malloc_calls, -1); /* subtract off the malloc */
return cptr;
}
void *realloc(
void *ptr,
size_t size
)
{
rtems_unsigned32 old_size;
rtems_status_code status;
char *new_area;
MSBUMP(realloc_calls, 1);
if ( !ptr )
return malloc( size );
if ( !size ) {
free( ptr );
return (void *) 0;
}
new_area = malloc( size );
MSBUMP(malloc_calls, -1); /* subtract off the malloc */
if ( !new_area ) {
free( ptr );
return (void *) 0;
}
status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
if ( status != RTEMS_SUCCESSFUL ) {
errno = EINVAL;
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
void free(
void *ptr
)
{
rtems_status_code status;
MSBUMP(free_calls, 1);
if ( !ptr )
return;
#ifdef MALLOC_STATS
{
unsigned32 size;
status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
if ( status == RTEMS_SUCCESSFUL ) {
MSBUMP(lifetime_freed, size);
}
}
#endif
status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
if ( status != RTEMS_SUCCESSFUL ) {
errno = EINVAL;
assert( 0 );
}
}
#ifdef MALLOC_STATS
/*
* Dump the malloc statistics
* May be called via atexit() (installable by our bsp) or
* at any time by user
*/
void malloc_dump(void)
{
unsigned32 allocated = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
printf("Malloc stats\n");
printf(" avail:%uk allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
(unsigned int) malloc_stats.space_available / 1024,
(unsigned int) allocated / 1024,
/* avoid float! */
(allocated * 100) / malloc_stats.space_available,
(unsigned int) malloc_stats.max_depth / 1024,
(malloc_stats.max_depth * 100) / malloc_stats.space_available,
(unsigned long long) malloc_stats.lifetime_allocated / 1024,
(unsigned long long) malloc_stats.lifetime_freed / 1024);
printf(" Call counts: malloc:%d free:%d realloc:%d calloc:%d\n",
malloc_stats.malloc_calls,
malloc_stats.free_calls,
malloc_stats.realloc_calls,
malloc_stats.calloc_calls);
}
#endif
/*
* "Reentrant" versions of the above routines implemented above.
*/
#ifdef RTEMS_NEWLIB
void *malloc_r(
struct _reent *ignored,
size_t size
)
{
return malloc( size );
}
void *calloc_r(
size_t nelem,
size_t elsize
)
{
return calloc( nelem, elsize );
}
void *realloc_r(
void *ptr,
size_t size
)
{
return realloc_r( ptr, size );
}
void free_r(
void *ptr
)
{
free( ptr );
}
#endif

View File

@@ -1,403 +0,0 @@
#if defined(RTEMS_NEWLIB)
/*
* COPYRIGHT (c) 1994 by Division Incorporated
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of Division Incorporated not be
* used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
* Division Incorporated makes no representations about the
* suitability of this software for any purpose.
*
* Description:
* Implementation of hooks for the CYGNUS newlib libc
* These hooks set things up so that:
* '_REENT' is switched at task switch time.
*
*
* TODO:
*
* NOTE:
*
* $Id$
*
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <libcsupport.h>
#include <stdlib.h> /* for free() */
#include <string.h> /* for memset() */
#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
#include <errno.h>
/*
* NOTE: When using RTEMS fake stat, fstat, and isatty, all output
* is line buffered so this setvbuf is not necessary. This
* setvbuf insures that we can redirect the output of a test
* on the UNIX simulator and it is in the same order as for a
* real target.
* NOTE:
* There is some problem with doing this on the hpux version
* of the UNIX simulator (symptom is printf core dumps), so
* we just don't for now.
* Not sure if this is a problem with hpux, newlib, or something else.
*/
#if defined(RTEMS_UNIX) && !defined(hpux)
#define NEED_SETVBUF
#endif
#ifdef NEED_SETVBUF
#include <stdio.h>
#endif
#include "internal.h"
#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
int libc_reentrant; /* do we think we are reentrant? */
struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);;
/*
* CYGNUS newlib routine that does atexit() processing and flushes
* stdio streams
* undocumented
*/
extern void _wrapup_reent(struct _reent *);
extern void _reclaim_reent(struct _reent *);
void
libc_wrapup(void)
{
_wrapup_reent(0);
if (_REENT != &libc_global_reent)
{
_wrapup_reent(&libc_global_reent);
#if 0
/* don't reclaim this one, just in case we do printfs */
/* on our way out to ROM */
_reclaim_reent(&libc_global_reent);
#endif
_REENT = &libc_global_reent;
}
}
rtems_boolean
libc_create_hook(rtems_tcb *current_task,
rtems_tcb *creating_task)
{
MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
return TRUE;
}
/*
* Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
*/
rtems_extension
libc_start_hook(rtems_tcb *current_task,
rtems_tcb *starting_task)
{
struct _reent *ptr;
/* NOTE: our malloc is reentrant without a reent ptr since
* it is based on region manager
*/
ptr = (struct _reent *) malloc(sizeof(struct _reent));
/* GCC extension: structure constants */
*ptr = (struct _reent) _REENT_INIT((*ptr));
MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
}
/*
* Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
*
* NOTE: When using RTEMS fake stat, fstat, and isatty, all output
* is line buffered so this setvbuf is not necessary. This
* setvbuf insures that we can redirect the output of a test
* on the UNIX simulator and it is in the same order as for a
* real target.
*/
#ifdef NEED_SETVBUF
rtems_extension
libc_begin_hook(rtems_tcb *current_task)
{
setvbuf( stdout, NULL, _IOLBF, BUFSIZ );
}
#endif
rtems_extension
libc_switch_hook(rtems_tcb *current_task,
rtems_tcb *heir_task)
{
rtems_unsigned32 impure_value;
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
* tid of 0, which is treated specially (optimized, actually)
* by rtems_task_set_note
*
* NOTE: The above comment is no longer true and we need to use
* the extension data areas added about the same time.
*/
/*
* Don't touch the outgoing task if it has been deleted.
*/
if ( !_States_Is_transient( current_task->current_state ) ) {
impure_value = (rtems_unsigned32) _REENT;
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
}
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
}
/*
* Function: libc_delete_hook
* Created: 94/12/10
*
* Description:
* Called when a task is deleted.
* Must restore the new lib reentrancy state for the new current
* task.
*
* Parameters:
*
*
* Returns:
*
*
* Side Effects:
*
* Notes:
*
*
* Deficiencies/ToDo:
*
*
*/
rtems_extension
libc_delete_hook(rtems_tcb *current_task,
rtems_tcb *deleted_task)
{
struct _reent *ptr;
/*
* The reentrancy structure was allocated by newlib using malloc()
*/
if (current_task == deleted_task)
{
ptr = _REENT;
}
else
{
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
}
/* if (ptr) */
if (ptr && ptr != &libc_global_reent)
{
_wrapup_reent(ptr);
_reclaim_reent(ptr);
free(ptr);
}
MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
/*
* Require the switch back to another task to install its own
*/
if (current_task == deleted_task)
{
_REENT = 0;
}
}
/*
* Function: libc_init
* Created: 94/12/10
*
* Description:
* Init libc for CYGNUS newlib
* Set up _REENT to use our global libc_global_reent.
* (newlib provides a global of its own, but we prefer our
* own name for it)
*
* If reentrancy is desired (which it should be), then
* we install the task extension hooks to maintain the
* newlib reentrancy global variable _REENT on task
* create, delete, switch, exit, etc.
*
* Parameters:
* reentrant non-zero if reentrant library desired.
*
* Returns:
*
* Side Effects:
* installs libc extensions if reentrant.
*
* Notes:
*
*
* Deficiencies/ToDo:
*
*/
void
libc_init(int reentrant)
{
rtems_extensions_table libc_extension;
rtems_id extension_id;
rtems_status_code rc;
_REENT = &libc_global_reent;
if (reentrant)
{
memset(&libc_extension, 0, sizeof(libc_extension));
libc_extension.thread_create = libc_create_hook;
libc_extension.thread_start = libc_start_hook;
#ifdef NEED_SETVBUF
libc_extension.thread_begin = libc_begin_hook;
#endif
libc_extension.thread_switch = libc_switch_hook;
libc_extension.thread_delete = libc_delete_hook;
rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
&libc_extension, &extension_id);
if (rc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(rc);
libc_reentrant = reentrant;
}
}
/*
* Routines required by the gnat runtime.
*/
int get_errno()
{
return errno;
}
/*
* Function: _exit
* Created: 94/12/10
*
* Description:
* Called from exit() after it does atexit() processing and stdio fflush's
*
* called from bottom of exit() to really delete the task.
* If we are using reentrant libc, then let the delete extension
* do all the work, otherwise if a shutdown is in progress,
* then just do it.
*
* Parameters:
* exit status
*
* Returns:
* does not return
*
* Side Effects:
*
* Notes:
*
*
* Deficiencies/ToDo:
*
*
*/
#if !defined(RTEMS_UNIX) && !defined(__GO32__)
void _exit(int status)
{
rtems_shutdown_executive(status);
}
#else
void exit(int status)
{
libc_wrapup();
rtems_shutdown_executive(status);
}
#endif
/*
* These are directly supported (and completely correct) in the posix api.
*/
#if !defined(__RTEMS_POSIX_API__)
pid_t __getpid(void)
{
return 0;
}
#endif
#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__)
pid_t getpid(void)
{
return __getpid();
}
#endif
#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__)
int kill( pid_t pid, int sig )
{
return 0;
}
#endif
int __kill( pid_t pid, int sig )
{
return 0;
}
unsigned int sleep(
unsigned int seconds
)
{
rtems_status_code status;
rtems_interval ticks_per_second;
rtems_interval ticks;
status = rtems_clock_get(
RTEMS_CLOCK_GET_TICKS_PER_SECOND,
&ticks_per_second
);
ticks = seconds * ticks_per_second;
status = rtems_task_wake_after( ticks );
/*
* Returns the "unslept" amount of time. In RTEMS signals are not
* interruptable, so tasks really sleep all of the requested time.
*/
return 0;
}
#endif

View File

@@ -1,45 +0,0 @@
#if !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
/* no_libc.h
*
* This file contains stubs for the reentrancy hooks when
* an unknown C library is used.
*
* 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$
*/
#include <rtems.h>
#include "libcsupport.h"
#include "internal.h"
#include <stdlib.h> /* for free() */
void
libc_init(int reentrant)
{
}
void libc_suspend_main(void)
{
}
void libc_global_exit(rtems_unsigned32 code)
{
}
void _exit(int status)
{
}
#endif

View File

@@ -1,11 +0,0 @@
/*
* $Id$
*/
#if defined(RTEMS_UNIXLIB)
void libc_init(int reentrant)
{
}
#endif

View File

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

@@ -24,6 +24,13 @@ extern "C" {
#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
*/
@@ -63,7 +70,7 @@ void _POSIX_Condition_variables_Manager_initialization(
* the inactive chain of free condition variable control blocks.
*/
STATIC INLINE POSIX_Condition_variables_Control *
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
_POSIX_Condition_variables_Allocate( void );
/*
@@ -75,7 +82,7 @@ STATIC INLINE POSIX_Condition_variables_Control *
* inactive chain of free condition variable control blocks.
*/
STATIC INLINE void _POSIX_Condition_variables_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
);
@@ -93,7 +100,7 @@ STATIC INLINE void _POSIX_Condition_variables_Free (
* to OBJECTS_ERROR and the_condition variable is undefined.
*/
STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
);
@@ -107,7 +114,7 @@ STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get
* and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Condition_variables_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
);

View File

@@ -84,7 +84,7 @@ void _POSIX_Interrupt_Manager_initialization(
* the inactive chain of free interrupt handler control blocks.
*/
STATIC INLINE POSIX_Interrupt_Handler_control *
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void );
/*
@@ -96,7 +96,7 @@ STATIC INLINE POSIX_Interrupt_Handler_control *
* inactive chain of free interrupt handler control blocks.
*/
STATIC INLINE void _POSIX_Interrupt_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
);
@@ -114,7 +114,7 @@ STATIC INLINE void _POSIX_Interrupt_Free (
* to OBJECTS_ERROR and the_intr is undefined.
*/
STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
);
@@ -127,7 +127,7 @@ STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
* This function returns TRUE if the_intr is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Interrupt_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
);

View File

@@ -79,7 +79,7 @@ void _POSIX_Keys_Run_destructors(
* the inactive chain of free keys control blocks.
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
/*
* _POSIX_Keys_Free
@@ -90,7 +90,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
* inactive chain of free keys control blocks.
*/
STATIC INLINE void _POSIX_Keys_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
);
@@ -108,7 +108,7 @@ STATIC INLINE void _POSIX_Keys_Free (
* to OBJECTS_ERROR and the_key is undefined.
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
);
@@ -121,7 +121,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
* This function returns TRUE if the_key is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Keys_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
);

View File

@@ -103,7 +103,7 @@ int _POSIX_Message_queue_Send_support(
* the inactive chain of free message queue control blocks.
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
/*
* _POSIX_Message_queue_Free
@@ -114,7 +114,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
* inactive chain of free message queue control blocks.
*/
STATIC INLINE void _POSIX_Message_queue_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
);
@@ -132,7 +132,7 @@ STATIC INLINE void _POSIX_Message_queue_Free (
* to OBJECTS_ERROR and the_mq is undefined.
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
);
@@ -145,7 +145,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
* This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Message_queue_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
);
@@ -170,7 +170,7 @@ int _POSIX_Message_queue_Name_to_id(
* XXX
*/
STATIC INLINE Priority_Control _POSIX_Message_queue_Priority_to_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
);

View File

@@ -62,7 +62,7 @@ void _POSIX_Mutex_Manager_initialization(
* the inactive chain of free mutexes control blocks.
*/
STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
/*
* _POSIX_Mutex_Free
@@ -73,7 +73,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
* inactive chain of free mutexes control blocks.
*/
STATIC INLINE void _POSIX_Mutex_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
);
@@ -91,7 +91,7 @@ STATIC INLINE void _POSIX_Mutex_Free (
* to OBJECTS_ERROR and the_mutex is undefined.
*/
STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
Objects_Id *id,
Objects_Locations *location
);
@@ -104,7 +104,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
* This function returns TRUE if the_mutex is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Mutex_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
);

View File

@@ -21,15 +21,15 @@
#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
STATIC INLINE boolean _POSIX_Priority_Is_valid(
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
);
STATIC INLINE Priority_Control _POSIX_Priority_To_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
);
STATIC INLINE int _POSIX_Priority_From_core(
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
);

View File

@@ -24,6 +24,8 @@ extern "C" {
#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.
@@ -63,7 +65,7 @@ void _POSIX_Threads_Manager_initialization(
* the inactive chain of free pthread control blocks.
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void );
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
/*
* _POSIX_Threads_Free
@@ -74,7 +76,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void );
* inactive chain of free pthread control blocks.
*/
STATIC INLINE void _POSIX_Threads_Free(
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
Thread_Control *the_pthread
);
@@ -92,7 +94,7 @@ STATIC INLINE void _POSIX_Threads_Free(
* to OBJECTS_ERROR and the_pthread is undefined.
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Get(
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
pthread_t id,
Objects_Locations *location
);
@@ -105,7 +107,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Get(
* This function returns TRUE if the_pthread is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Threads_Is_null(
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
Thread_Control *the_pthread
);

View File

@@ -64,7 +64,7 @@ void _POSIX_Semaphore_Manager_initialization(
* the inactive chain of free semaphore control blocks.
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
/*
* _POSIX_Semaphore_Free
@@ -75,7 +75,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
* inactive chain of free semaphore control blocks.
*/
STATIC INLINE void _POSIX_Semaphore_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
);
@@ -93,7 +93,7 @@ STATIC INLINE void _POSIX_Semaphore_Free (
* to OBJECTS_ERROR and the_semaphore is undefined.
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
);
@@ -106,7 +106,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
*/
STATIC INLINE boolean _POSIX_Semaphore_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
);

View File

@@ -15,6 +15,7 @@ typedef struct {
Thread_queue_Control Join_List;
int schedpolicy;
struct sched_param schedparam;
int ss_high_priority;
Watchdog_Control Sporadic_timer;
sigset_t signals_blocked;

View File

@@ -18,6 +18,17 @@
(((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
*/

View File

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

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

View File

@@ -1,123 +0,0 @@
/* 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>
/*
* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,162 +0,0 @@
/* condmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Condition Variable Manager.
*
* COPYRIGHT (c) 1989, 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

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

@@ -1,154 +0,0 @@
/* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,136 +0,0 @@
/* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,186 +0,0 @@
/* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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
*/
STATIC INLINE 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

@@ -1,161 +0,0 @@
/* mqueuemp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Message Queue Manager.
*
* COPYRIGHT (c) 1989, 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

@@ -1,120 +0,0 @@
/* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,161 +0,0 @@
/* mutexmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Mutex Manager.
*
* COPYRIGHT (c) 1989, 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

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

@@ -1,38 +0,0 @@
/*
*
*
* $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)
STATIC INLINE boolean _POSIX_Priority_Is_valid(
int priority
);
STATIC INLINE Priority_Control _POSIX_Priority_To_core(
int priority
);
STATIC INLINE int _POSIX_Priority_From_core(
Priority_Control priority
);
#include <rtems/posix/priority.inl>
#endif

View File

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

@@ -1,121 +0,0 @@
/* 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>
/*
* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,161 +0,0 @@
/* pthreadmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Threads Manager.
*
* COPYRIGHT (c) 1989, 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

@@ -1,135 +0,0 @@
/* 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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.
*/
STATIC INLINE 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

@@ -1,161 +0,0 @@
/* semaphoremp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the POSIX Semaphore Manager.
*
* COPYRIGHT (c) 1989, 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

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

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

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

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

@@ -22,7 +22,7 @@
* _POSIX_Condition_variables_Allocate
*/
STATIC INLINE POSIX_Condition_variables_Control
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
@@ -34,7 +34,7 @@ STATIC INLINE POSIX_Condition_variables_Control
* _POSIX_Condition_variables_Free
*/
STATIC INLINE void _POSIX_Condition_variables_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
)
{
@@ -49,7 +49,7 @@ STATIC INLINE void _POSIX_Condition_variables_Free (
* _POSIX_Condition_variables_Get
*/
STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
)
@@ -64,7 +64,7 @@ STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get
* _POSIX_Condition_variables_Is_null
*/
STATIC INLINE boolean _POSIX_Condition_variables_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Interrupt_Allocate
*/
STATIC INLINE POSIX_Interrupt_Handler_control *
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void )
{
return (POSIX_Interrupt_Handler_control *)
@@ -34,7 +34,7 @@ STATIC INLINE POSIX_Interrupt_Handler_control *
* _POSIX_Interrupt_Free
*/
STATIC INLINE void _POSIX_Interrupt_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
)
{
@@ -46,7 +46,7 @@ STATIC INLINE void _POSIX_Interrupt_Free (
* _POSIX_Interrupt_Get
*/
STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -60,7 +60,7 @@ STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
* _POSIX_Interrupt_Is_null
*/
STATIC INLINE boolean _POSIX_Interrupt_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Keys_Allocate
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
* _POSIX_Keys_Free
*/
STATIC INLINE void _POSIX_Keys_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
@@ -44,7 +44,7 @@ STATIC INLINE void _POSIX_Keys_Free (
* _POSIX_Keys_Get
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -58,7 +58,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
* _POSIX_Keys_Is_null
*/
STATIC INLINE boolean _POSIX_Keys_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Message_queue_Allocate
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
{
return (POSIX_Message_queue_Control *)
_Objects_Allocate( &_POSIX_Message_queue_Information );
@@ -33,7 +33,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
* _POSIX_Message_queue_Free
*/
STATIC INLINE void _POSIX_Message_queue_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
)
{
@@ -45,7 +45,7 @@ STATIC INLINE void _POSIX_Message_queue_Free (
* _POSIX_Message_queue_Get
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -59,7 +59,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
* _POSIX_Message_queue_Is_null
*/
STATIC INLINE boolean _POSIX_Message_queue_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
)
{
@@ -71,7 +71,7 @@ STATIC INLINE boolean _POSIX_Message_queue_Is_null (
* _POSIX_Message_queue_Priority_to_core
*/
STATIC INLINE Priority_Control _POSIX_Message_queue_Priority_to_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Mutex_Allocate
*/
STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
{
return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
* _POSIX_Mutex_Free
*/
STATIC INLINE void _POSIX_Mutex_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
)
{
@@ -44,13 +44,18 @@ STATIC INLINE void _POSIX_Mutex_Free (
* _POSIX_Mutex_Get
*/
STATIC INLINE POSIX_Mutex_Control *_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.
@@ -76,7 +81,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
* _POSIX_Mutex_Is_null
*/
STATIC INLINE boolean _POSIX_Mutex_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
)
{

View File

@@ -13,21 +13,21 @@
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
*/
STATIC INLINE boolean _POSIX_Priority_Is_valid(
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
)
{
return (boolean) (priority >= 1 && priority <= 255);
}
STATIC INLINE Priority_Control _POSIX_Priority_To_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (256 - priority);
}
STATIC INLINE int _POSIX_Priority_From_core(
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Threads_Allocate
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void )
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void )
* _POSIX_Threads_Free
*/
STATIC INLINE void _POSIX_Threads_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
@@ -44,7 +44,7 @@ STATIC INLINE void _POSIX_Threads_Free (
* _POSIX_Threads_Get
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Get (
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
pthread_t id,
Objects_Locations *location
)
@@ -58,7 +58,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Get (
* _POSIX_Threads_Is_null
*/
STATIC INLINE boolean _POSIX_Threads_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
Thread_Control *the_pthread
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Condition_variables_Allocate
*/
STATIC INLINE POSIX_Condition_variables_Control
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
@@ -34,7 +34,7 @@ STATIC INLINE POSIX_Condition_variables_Control
* _POSIX_Condition_variables_Free
*/
STATIC INLINE void _POSIX_Condition_variables_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
POSIX_Condition_variables_Control *the_condition_variable
)
{
@@ -49,7 +49,7 @@ STATIC INLINE void _POSIX_Condition_variables_Free (
* _POSIX_Condition_variables_Get
*/
STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
Objects_Id *id,
Objects_Locations *location
)
@@ -64,7 +64,7 @@ STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get
* _POSIX_Condition_variables_Is_null
*/
STATIC INLINE boolean _POSIX_Condition_variables_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
POSIX_Condition_variables_Control *the_condition_variable
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Interrupt_Allocate
*/
STATIC INLINE POSIX_Interrupt_Handler_control *
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
_POSIX_Interrupt_Allocate( void )
{
return (POSIX_Interrupt_Handler_control *)
@@ -34,7 +34,7 @@ STATIC INLINE POSIX_Interrupt_Handler_control *
* _POSIX_Interrupt_Free
*/
STATIC INLINE void _POSIX_Interrupt_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
POSIX_Interrupt_Handler_control *the_intr
)
{
@@ -46,7 +46,7 @@ STATIC INLINE void _POSIX_Interrupt_Free (
* _POSIX_Interrupt_Get
*/
STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -60,7 +60,7 @@ STATIC INLINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
* _POSIX_Interrupt_Is_null
*/
STATIC INLINE boolean _POSIX_Interrupt_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
POSIX_Interrupt_Handler_control *the_intr
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Keys_Allocate
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
* _POSIX_Keys_Free
*/
STATIC INLINE void _POSIX_Keys_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
@@ -44,7 +44,7 @@ STATIC INLINE void _POSIX_Keys_Free (
* _POSIX_Keys_Get
*/
STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -58,7 +58,7 @@ STATIC INLINE POSIX_Keys_Control *_POSIX_Keys_Get (
* _POSIX_Keys_Is_null
*/
STATIC INLINE boolean _POSIX_Keys_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
POSIX_Keys_Control *the_key
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Message_queue_Allocate
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
{
return (POSIX_Message_queue_Control *)
_Objects_Allocate( &_POSIX_Message_queue_Information );
@@ -33,7 +33,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
* _POSIX_Message_queue_Free
*/
STATIC INLINE void _POSIX_Message_queue_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
POSIX_Message_queue_Control *the_mq
)
{
@@ -45,7 +45,7 @@ STATIC INLINE void _POSIX_Message_queue_Free (
* _POSIX_Message_queue_Get
*/
STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)
@@ -59,7 +59,7 @@ STATIC INLINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
* _POSIX_Message_queue_Is_null
*/
STATIC INLINE boolean _POSIX_Message_queue_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
POSIX_Message_queue_Control *the_mq
)
{
@@ -71,7 +71,7 @@ STATIC INLINE boolean _POSIX_Message_queue_Is_null (
* _POSIX_Message_queue_Priority_to_core
*/
STATIC INLINE Priority_Control _POSIX_Message_queue_Priority_to_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
unsigned int priority
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Mutex_Allocate
*/
STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
{
return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
* _POSIX_Mutex_Free
*/
STATIC INLINE void _POSIX_Mutex_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
POSIX_Mutex_Control *the_mutex
)
{
@@ -44,13 +44,18 @@ STATIC INLINE void _POSIX_Mutex_Free (
* _POSIX_Mutex_Get
*/
STATIC INLINE POSIX_Mutex_Control *_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.
@@ -76,7 +81,7 @@ STATIC INLINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
* _POSIX_Mutex_Is_null
*/
STATIC INLINE boolean _POSIX_Mutex_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
POSIX_Mutex_Control *the_mutex
)
{

View File

@@ -13,21 +13,21 @@
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
*/
STATIC INLINE boolean _POSIX_Priority_Is_valid(
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
int priority
)
{
return (boolean) (priority >= 1 && priority <= 255);
}
STATIC INLINE Priority_Control _POSIX_Priority_To_core(
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (256 - priority);
}
STATIC INLINE int _POSIX_Priority_From_core(
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Threads_Allocate
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void )
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
}
@@ -32,7 +32,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Allocate( void )
* _POSIX_Threads_Free
*/
STATIC INLINE void _POSIX_Threads_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
@@ -44,7 +44,7 @@ STATIC INLINE void _POSIX_Threads_Free (
* _POSIX_Threads_Get
*/
STATIC INLINE Thread_Control *_POSIX_Threads_Get (
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
pthread_t id,
Objects_Locations *location
)
@@ -58,7 +58,7 @@ STATIC INLINE Thread_Control *_POSIX_Threads_Get (
* _POSIX_Threads_Is_null
*/
STATIC INLINE boolean _POSIX_Threads_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
Thread_Control *the_pthread
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Semaphore_Allocate
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
@@ -33,7 +33,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
* _POSIX_Semaphore_Free
*/
STATIC INLINE void _POSIX_Semaphore_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
@@ -45,7 +45,7 @@ STATIC INLINE void _POSIX_Semaphore_Free (
* _POSIX_Semaphore_Get
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
)
@@ -59,7 +59,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
* _POSIX_Semaphore_Is_null
*/
STATIC INLINE boolean _POSIX_Semaphore_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
)
{

View File

@@ -22,7 +22,7 @@
* _POSIX_Semaphore_Allocate
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
@@ -33,7 +33,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
* _POSIX_Semaphore_Free
*/
STATIC INLINE void _POSIX_Semaphore_Free (
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
@@ -45,7 +45,7 @@ STATIC INLINE void _POSIX_Semaphore_Free (
* _POSIX_Semaphore_Get
*/
STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
Objects_Id *id,
Objects_Locations *location
)
@@ -59,7 +59,7 @@ STATIC INLINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
* _POSIX_Semaphore_Is_null
*/
STATIC INLINE boolean _POSIX_Semaphore_Is_null (
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
POSIX_Semaphore_Control *the_semaphore
)
{

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;
}

View File

@@ -11,6 +11,7 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/cond.h>
#include <rtems/posix/time.h>
#include <rtems/posix/mutex.h>
/*
* TEMPORARY
@@ -199,7 +200,7 @@ int pthread_cond_init(
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = 0;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
@@ -255,14 +256,16 @@ int pthread_cond_destroy(
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
);
if ( _Thread_queue_Get_number_waiting( &the_cond->Wait_queue ) )
return EBUSY;
_POSIX_Condition_variables_Free( the_cond );
if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
@@ -314,7 +317,12 @@ int _POSIX_Condition_variables_Signal_support(
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();
@@ -355,13 +363,21 @@ int pthread_cond_broadcast(
int _POSIX_Condition_variables_Wait_support(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout
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:
@@ -372,26 +388,49 @@ int _POSIX_Condition_variables_Wait_support(
return EINVAL;
case OBJECTS_LOCAL:
/*
* XXX: should be an error if cond->Mutex != mutex
*/
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
_Thread_Enable_dispatch();
return EINVAL;
}
status = pthread_mutex_unlock( mutex );
if ( !status )
return status;
the_cond->Mutex = *mutex;
/* XXX .. enter critical section .. */
_Thread_queue_Enqueue( &the_cond->Wait_queue, 0 );
(void) pthread_mutex_unlock( mutex );
/* XXX ignore this for now since behavior is undefined
if ( mutex_status ) {
_Thread_Enable_dispatch();
return EINVAL;
}
*/
_Thread_Enable_dispatch();
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;
status = pthread_mutex_lock( mutex );
if ( !status )
return status;
_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 _Thread_Executing->Wait.return_code;
return status;
}
return POSIX_BOTTOM_REACHED();
}
@@ -409,7 +448,8 @@ int pthread_cond_wait(
return _POSIX_Condition_variables_Wait_support(
cond,
mutex,
THREAD_QUEUE_WAIT_FOREVER
THREAD_QUEUE_WAIT_FOREVER,
FALSE
);
}
@@ -424,9 +464,34 @@ int pthread_cond_timedwait(
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,
_POSIX_Timespec_to_interval( abstime )
timeout,
already_timedout
);
}

View File

@@ -116,13 +116,13 @@ int pthread_setspecific(
the_key = _POSIX_Keys_Get( key, &location );
switch ( location ) {
case OBJECTS_ERROR:
case OBJECTS_REMOTE: /* should never happen */
return EINVAL;
case OBJECTS_REMOTE:
return EINVAL; /* should never happen */
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();
@@ -141,17 +141,19 @@ void *pthread_getspecific(
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_REMOTE:
return 0; /* should never happen */
case OBJECTS_LOCAL:
index = _Objects_Get_index( _Thread_Executing->Object.id );
class = _Objects_Get_class( _Thread_Executing->Object.id );
return (void *) the_key->Values[ class ][ index ];
key_data = (void *) the_key->Values[ class ][ index ];
_Thread_Enable_dispatch();
return key_data;
}
return (void *) POSIX_BOTTOM_REACHED();
}
@@ -172,9 +174,8 @@ int pthread_key_delete(
the_key = _POSIX_Keys_Get( key, &location );
switch ( location ) {
case OBJECTS_ERROR:
case OBJECTS_REMOTE: /* should never happen */
return EINVAL;
case OBJECTS_REMOTE:
return 0; /* should never happen */
case OBJECTS_LOCAL:
_Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
@@ -191,6 +192,7 @@ int pthread_key_delete(
*/
_POSIX_Keys_Free( the_key );
_Thread_Enable_dispatch();
return 0;
}
return POSIX_BOTTOM_REACHED();

View File

@@ -45,6 +45,14 @@ int _POSIX_Mutex_MP_Send_request_packet (
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
*/
@@ -57,11 +65,42 @@ int _POSIX_Mutex_MP_Send_request_packet (
const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = {
TRUE, /* is_initialized */
PTHREAD_PROCESS_PRIVATE, /* process_shared */
POSIX_SCHEDULER_MINIMUM_PRIORITY, /* prio_ceiling */
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
@@ -115,7 +154,7 @@ int pthread_mutexattr_destroy(
pthread_mutexattr_t *attr
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized )
return EINVAL;
attr->is_initialized = FALSE;
@@ -132,7 +171,7 @@ int pthread_mutexattr_getpshared(
int *pshared
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized || !pshared )
return EINVAL;
*pshared = attr->process_shared;
@@ -149,7 +188,7 @@ int pthread_mutexattr_setpshared(
int pshared
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
@@ -176,14 +215,33 @@ int pthread_mutex_init(
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;
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;
@@ -223,7 +281,7 @@ int pthread_mutex_init(
if ( !the_mutex ) {
_Thread_Enable_dispatch();
return ENOMEM;
return EAGAIN;
}
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
@@ -329,7 +387,8 @@ int pthread_mutex_destroy(
return POSIX_BOTTOM_REACHED();
}
/*
/*PAGE
*
* _POSIX_Mutex_Lock_support
*
* A support routine which implements guts of the blocking, non-blocking, and
@@ -364,8 +423,9 @@ int _POSIX_Mutex_Lock_support(
timeout
);
_Thread_Enable_dispatch();
return _Thread_Executing->Wait.return_code;
break;
return _POSIX_Mutex_From_core_mutex_status(
(CORE_mutex_Status) _Thread_Executing->Wait.return_code
);
}
return POSIX_BOTTOM_REACHED();
}
@@ -405,20 +465,13 @@ int pthread_mutex_trylock(
* NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
*/
void POSIX_Threads_mutex_MP_support(
Thread_Control *the_thread,
Objects_Id id
)
{
(void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */
}
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 ) {
@@ -432,13 +485,13 @@ int pthread_mutex_unlock(
MPCI_DEFAULT_TIMEOUT
);
case OBJECTS_LOCAL:
_CORE_mutex_Surrender(
status = _CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
POSIX_Threads_mutex_MP_support
);
_Thread_Enable_dispatch();
return _Thread_Executing->Wait.return_code; /* XXX return status */
return _POSIX_Mutex_From_core_mutex_status( status );
break;
}
return POSIX_BOTTOM_REACHED();
@@ -473,7 +526,7 @@ int pthread_mutexattr_setprotocol(
int protocol
)
{
if ( !attr )
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( protocol ) {
@@ -498,7 +551,7 @@ int pthread_mutexattr_getprotocol(
int *protocol
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized || !protocol )
return EINVAL;
*protocol = attr->protocol;
@@ -515,10 +568,10 @@ int pthread_mutexattr_setprioceiling(
int prioceiling
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( attr->prio_ceiling ) )
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
return EINVAL;
attr->prio_ceiling = prioceiling;
@@ -535,7 +588,7 @@ int pthread_mutexattr_getprioceiling(
int *prioceiling
)
{
if ( !attr || attr->is_initialized == FALSE )
if ( !attr || !attr->is_initialized || !prioceiling )
return EINVAL;
*prioceiling = attr->prio_ceiling;
@@ -558,6 +611,9 @@ int pthread_mutex_setprioceiling(
Priority_Control the_priority;
int status;
if ( !old_ceiling )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
return EINVAL;
@@ -574,12 +630,14 @@ int pthread_mutex_setprioceiling(
the_mutex = _POSIX_Mutex_Get( mutex, &location );
switch ( location ) {
case OBJECTS_ERROR:
return EINVAL;
return EINVAL; /* impossible to get here */
case OBJECTS_REMOTE:
/* XXX It feels questionable to set the ceiling on a remote mutex. */
return POSIX_MP_NOT_IMPLEMENTED();
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,
@@ -605,6 +663,9 @@ int pthread_mutex_getprioceiling(
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:

View File

@@ -53,24 +53,25 @@ void _POSIX_signals_Abormal_termination_handler( int signo )
#define SIG_ARRAY_MAX (SIGRTMAX + 1)
struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = {
/* NO SIGNAL 0 */ SIGACTION_IGNORE,
/* SIGABRT */ SIGACTION_TERMINATE,
/* SIGALRM */ SIGACTION_TERMINATE,
/* SIGFPE */ SIGACTION_TERMINATE,
/* SIGHUP */ SIGACTION_TERMINATE,
/* SIGILL */ SIGACTION_TERMINATE,
/* SIGINT */ SIGACTION_TERMINATE,
/* SIGKILL */ SIGACTION_TERMINATE,
/* SIGPIPE */ SIGACTION_TERMINATE,
/* SIGQUIT */ SIGACTION_TERMINATE,
/* SIGSEGV */ SIGACTION_TERMINATE,
/* SIGTERM */ SIGACTION_TERMINATE,
/* SIGUSR1 */ SIGACTION_TERMINATE,
/* SIGUSR2 */ SIGACTION_TERMINATE,
/* SIGRTMIN 14 */ SIGACTION_IGNORE,
/* SIGRT 15 */ SIGACTION_IGNORE,
/* SIGRT 16 */ SIGACTION_IGNORE,
/* SIGRT 17 */ SIGACTION_IGNORE,
/* SIGRT 18 */ SIGACTION_IGNORE,
/* SIGHUP 1 */ SIGACTION_TERMINATE,
/* SIGINT 2 */ SIGACTION_TERMINATE,
/* SIGQUIT 3 */ SIGACTION_TERMINATE,
/* SIGILL 4 */ SIGACTION_TERMINATE,
/* SIGTRAP 5 */ SIGACTION_TERMINATE,
/* SIGIOT 6 */ SIGACTION_TERMINATE,
/* SIGABRT 6 SIGACTION_TERMINATE, -- alias for SIGIOT */
/* SIGEMT 7 */ SIGACTION_TERMINATE,
/* SIGFPE 8 */ SIGACTION_TERMINATE,
/* SIGKILL 9 */ SIGACTION_TERMINATE,
/* SIGBUS 10 */ SIGACTION_TERMINATE,
/* SIGSEGV 11 */ SIGACTION_TERMINATE,
/* SIGSYS 12 */ SIGACTION_TERMINATE,
/* SIGPIPE 13 */ SIGACTION_TERMINATE,
/* SIGALRM 14 */ SIGACTION_TERMINATE,
/* SIGTERM 15 */ SIGACTION_TERMINATE,
/* SIGUSR1 16 */ SIGACTION_TERMINATE,
/* SIGUSR2 17 */ SIGACTION_TERMINATE,
/* SIGRTMIN 18 */ SIGACTION_IGNORE,
/* SIGRT 19 */ SIGACTION_IGNORE,
/* SIGRT 20 */ SIGACTION_IGNORE,
/* SIGRT 21 */ SIGACTION_IGNORE,
@@ -217,39 +218,49 @@ void _POSIX_signals_Clear_process_signals(
/*PAGE
*
* _POSIX_signals_Check_signal
* _POSIX_signals_Clear_signals
*/
boolean _POSIX_signals_Check_signal(
boolean _POSIX_signals_Clear_signals(
POSIX_API_Control *api,
int signo,
boolean is_global
siginfo_t *info,
boolean is_global,
boolean check_blocked
)
{
sigset_t mask;
sigset_t signals_blocked;
ISR_Level level;
boolean do_callout;
POSIX_signals_Siginfo_node *psiginfo;
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
mask = signo_to_mask( signo );
do_callout = FALSE;
/* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
* insures that no signals are blocked and all are checked.
*/
if ( check_blocked )
signals_blocked = ~api->signals_blocked;
else
signals_blocked = SIGNAL_ALL_MASK;
/* XXX this is not right for siginfo type signals yet */
/* XXX since they can't be cleared the same way */
_ISR_Disable( level );
if ( is_global ) {
if ( mask & (_POSIX_signals_Pending & ~api->signals_blocked ) ) {
if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
_POSIX_signals_Clear_process_signals( mask );
if ( psiginfo ) {
siginfo_struct = psiginfo->Info;
*info = psiginfo->Info;
_Chain_Append_unprotected(
&_POSIX_signals_Inactive_siginfo,
&psiginfo->Node
@@ -261,14 +272,32 @@ boolean _POSIX_signals_Check_signal(
do_callout = TRUE;
}
} else {
if ( mask & (api->signals_pending & ~api->signals_blocked ) ) {
if ( mask & (api->signals_pending & signals_blocked) ) {
api->signals_pending &= ~mask;
do_callout = TRUE;
}
}
_ISR_Enable( level );
return do_callout;
}
if ( !do_callout )
/*PAGE
*
* _POSIX_signals_Check_signal
*/
boolean _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
boolean is_global
)
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
is_global, TRUE ) )
return FALSE;
/*
@@ -355,7 +384,9 @@ restart:
}
for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
goto restart;
@@ -467,7 +498,7 @@ int sigemptyset(
)
{
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
*set = 0;
return 0;
@@ -482,7 +513,7 @@ int sigfillset(
)
{
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
*set = SIGNAL_ALL_MASK;
return 0;
@@ -498,7 +529,10 @@ int sigaddset(
)
{
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
if ( !signo )
return 0;
if ( !is_valid_signo(signo) )
set_errno_and_return_minus_one( EINVAL );
@@ -517,8 +551,11 @@ int sigdelset(
)
{
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
if ( !signo )
return 0;
if ( !is_valid_signo(signo) )
set_errno_and_return_minus_one( EINVAL );
@@ -536,8 +573,11 @@ int sigismember(
)
{
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
if ( !signo )
return 0;
if ( !is_valid_signo(signo) )
set_errno_and_return_minus_one( EINVAL );
@@ -559,12 +599,15 @@ int sigaction(
{
ISR_Level level;
if ( !is_valid_signo(sig) )
set_errno_and_return_minus_one( EINVAL );
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
if ( !sig )
return 0;
if ( !is_valid_signo(sig) )
set_errno_and_return_minus_one( EINVAL );
/*
* Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
*
@@ -582,14 +625,17 @@ int sigaction(
if ( act ) {
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Clear_process_signals( signo_to_mask(sig) );
} else {
_POSIX_signals_Clear_process_signals( signo_to_mask(sig) );
_POSIX_signals_Vectors[ sig ] = *act;
_POSIX_signals_Vectors[ sig ] = *act;
}
_ISR_Enable( level );
}
@@ -641,7 +687,7 @@ int pthread_sigmask(
POSIX_API_Control *api;
if ( !set && !oset )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
@@ -649,7 +695,7 @@ int pthread_sigmask(
*oset = api->signals_blocked;
if ( !set )
set_errno_and_return_minus_one( EFAULT );
return 0;
switch ( how ) {
case SIG_BLOCK:
@@ -689,7 +735,7 @@ int sigpending(
POSIX_API_Control *api;
if ( !set )
set_errno_and_return_minus_one( EFAULT );
set_errno_and_return_minus_one( EINVAL );
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
@@ -713,13 +759,13 @@ int sigsuspend(
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
saved_signals_blocked = api->signals_blocked;
status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
(void) sigfillset( &all_signals );
status = sigtimedwait( &all_signals, NULL, NULL );
api->signals_blocked = saved_signals_blocked;
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
return status;
}
@@ -755,14 +801,15 @@ int _POSIX_signals_Get_highest(
return signo;
}
for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
if ( set & signo_to_mask( signo ) )
return signo;
}
return 0;
}
int sigtimedwait(
const sigset_t *set,
@@ -792,6 +839,8 @@ int sigtimedwait(
if ( *set & api->signals_pending ) {
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
_POSIX_signals_Clear_signals( api, the_info->si_signo, the_info,
FALSE, FALSE );
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
return the_info->si_signo;
@@ -799,18 +848,14 @@ int sigtimedwait(
/* Process pending signals? */
#warning "Mark fix me"
if ( *set & _POSIX_signals_Pending) {
signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
if ( !info || ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) ) {
_POSIX_signals_Clear_signals( api, signo, the_info, TRUE, FALSE );
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
} else {
#warning "_POSIX_signals_Siginfo is an array of chains.... "
#if 0
*the_info = *_POSIX_signals_Siginfo[ signo ];
#endif
}
}
@@ -901,6 +946,13 @@ int killinfo(
if( pid != getpid() )
set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed if not 0.
*/
if ( sig && !is_valid_signo(sig) )
set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
@@ -1202,21 +1254,18 @@ int pthread_kill(
if ( sig && !is_valid_signo(sig) )
set_errno_and_return_minus_one( EINVAL );
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
return 0;
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO )
set_errno_and_return_minus_one( ENOSYS );
/*
* RTEMS does not support sending a siginfo signal to a specific thread.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO )
return ENOSYS;
the_thread = _POSIX_Threads_Get( thread, &location );
switch ( location ) {
case OBJECTS_ERROR:
case OBJECTS_REMOTE:
return ESRCH;
set_errno_and_return_minus_one( ESRCH );
case OBJECTS_LOCAL:
/*
* If sig == 0 then just validate arguments
@@ -1226,14 +1275,24 @@ int pthread_kill(
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
_Thread_Enable_dispatch();
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
}
_Thread_Enable_dispatch();
return 0;
the_thread->do_post_task_switch_extension = TRUE;
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_ISR_Signals_to_thread_executing = TRUE;
}
_Thread_Enable_dispatch();
return 0;
}
return POSIX_BOTTOM_REACHED();

View File

@@ -23,23 +23,27 @@
/*PAGE
*
* The default pthreads attributes structure.
*
* NOTE: Be careful .. if the default attribute set changes,
* _POSIX_Threads_Initialize_user_threads will need to be examined.
*
*/
const pthread_attr_t _POSIX_Threads_Default_attributes = {
TRUE, /* is_initialized */
NULL, /* stackaddr */
STACK_MINIMUM_SIZE * 2, /* stacksize */
PTHREAD_SCOPE_PROCESS, /* contentionscope */
PTHREAD_EXPLICIT_SCHED, /* inheritsched */
SCHED_FIFO, /* schedpolicy */
{ /* schedparam */
128, /* sched_priority */
0, /* ss_low_priority */
{ 0L, 0 }, /* ss_replenish_period */
{ 0L, 0 } /* ss_initial_budget */
TRUE, /* is_initialized */
NULL, /* stackaddr */
PTHREAD_MINIMUM_STACK_SIZE, /* stacksize */
PTHREAD_SCOPE_PROCESS, /* contentionscope */
PTHREAD_INHERIT_SCHED, /* inheritsched */
SCHED_FIFO, /* schedpolicy */
{ /* schedparam */
2, /* sched_priority */
0, /* ss_low_priority */
{ 0L, 0 }, /* ss_replenish_period */
{ 0L, 0 } /* ss_initial_budget */
},
PTHREAD_CREATE_JOINABLE, /* detachstate */
1 /* cputime_clock_allowed */
PTHREAD_CREATE_JOINABLE, /* detachstate */
1 /* cputime_clock_allowed */
};
/*PAGE
@@ -52,6 +56,8 @@ void _POSIX_Threads_Sporadic_budget_TSR(
void *argument
)
{
unsigned32 ticks;
unsigned32 new_priority;
Thread_Control *the_thread;
POSIX_API_Control *api;
@@ -59,18 +65,26 @@ void _POSIX_Threads_Sporadic_budget_TSR(
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
the_thread->cpu_time_budget =
_POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget );
ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget );
_Thread_Change_priority(
the_thread,
_POSIX_Priority_To_core( api->schedparam.sched_priority )
);
if ( !ticks )
ticks = 1;
the_thread->cpu_time_budget = ticks;
_Watchdog_Insert_ticks(
&api->Sporadic_timer,
_POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period )
);
new_priority = _POSIX_Priority_To_core( api->ss_high_priority );
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority );
ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period );
if ( !ticks )
ticks = 1;
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
/*PAGE
@@ -82,18 +96,25 @@ void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
POSIX_API_Control *api;
POSIX_API_Control *api;
unsigned32 new_priority;
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
/* XXX really should be based on MAX_U32 */
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF;
_Thread_Change_priority(
the_thread,
_POSIX_Priority_To_core( api->schedparam.ss_low_priority )
);
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority );
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority );
}
/*PAGE
@@ -109,6 +130,7 @@ boolean _POSIX_Threads_Create_extension(
)
{
POSIX_API_Control *api;
POSIX_API_Control *executing_api;
api = _Workspace_Allocate( sizeof( POSIX_API_Control ) );
@@ -132,9 +154,10 @@ boolean _POSIX_Threads_Create_extension(
/* XXX use signal constants */
api->signals_pending = 0;
if ( _Objects_Get_class( created->Object.id ) == OBJECTS_POSIX_THREADS )
api->signals_blocked = 0;
else
if ( _Objects_Get_class( created->Object.id ) == OBJECTS_POSIX_THREADS ) {
executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
api->signals_blocked = api->signals_blocked;
} else
api->signals_blocked = 0xffffffff;
/* XXX set signal parameters -- block all signals for non-posix threads */
@@ -172,10 +195,8 @@ User_extensions_routine _POSIX_Threads_Delete_extension(
POSIX_API_Control *api;
void **value_ptr;
(void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_POSIX ] );
api = deleted->API_Extensions[ THREAD_API_POSIX ];
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
/* XXX run cancellation handlers */
_POSIX_Keys_Run_destructors( deleted );
@@ -184,8 +205,6 @@ User_extensions_routine _POSIX_Threads_Delete_extension(
* Wakeup all the tasks which joined with this one
*/
api = deleted->API_Extensions[ THREAD_API_POSIX ];
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
@@ -193,6 +212,10 @@ User_extensions_routine _POSIX_Threads_Delete_extension(
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
(void) _Workspace_Free( api );
}
/*PAGE
@@ -214,6 +237,7 @@ void _POSIX_Threads_Initialize_user_threads( void )
unsigned32 maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = _POSIX_Threads_User_initialization_threads;
maximum = _POSIX_Threads_Number_of_initialization_threads;
@@ -221,10 +245,26 @@ void _POSIX_Threads_Initialize_user_threads( void )
if ( !user_threads || maximum == 0 )
return;
/*
* Be careful .. if the default attribute set changes, this may need to.
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
status = pthread_attr_init( &attr );
assert( !status );
status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
assert( !status );
status = pthread_attr_setstacksize( &attr, PTHREAD_MINIMUM_STACK_SIZE * 2 );
assert( !status );
status = pthread_create(
&thread_id,
NULL,
&attr,
user_threads[ index ].entry,
NULL
);
@@ -232,6 +272,11 @@ void _POSIX_Threads_Initialize_user_threads( void )
}
}
/*PAGE
*
* API Extension control structures
*/
API_extensions_Control _POSIX_Threads_API_extensions = {
{ NULL, NULL },
NULL, /* predriver */
@@ -341,7 +386,7 @@ int pthread_attr_setscope(
return 0;
case PTHREAD_SCOPE_SYSTEM:
return ENOSYS;
return ENOTSUP;
default:
return EINVAL;
@@ -358,7 +403,7 @@ int pthread_attr_getscope(
int *contentionscope
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !contentionscope )
return EINVAL;
*contentionscope = attr->contentionscope;
@@ -385,7 +430,7 @@ int pthread_attr_setinheritsched(
return 0;
default:
return EINVAL;
return ENOTSUP;
}
}
@@ -399,7 +444,7 @@ int pthread_attr_getinheritsched(
int *inheritsched
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !inheritsched )
return EINVAL;
*inheritsched = attr->inheritsched;
@@ -428,13 +473,13 @@ int pthread_attr_setschedpolicy(
return 0;
default:
return EINVAL;
return ENOTSUP;
}
}
/*PAGE
*
* 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
* 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
*/
int pthread_attr_getschedpolicy(
@@ -442,7 +487,7 @@ int pthread_attr_getschedpolicy(
int *policy
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !policy )
return EINVAL;
*policy = attr->schedpolicy;
@@ -451,15 +496,15 @@ int pthread_attr_getschedpolicy(
/*PAGE
*
* 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
* 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
*/
int pthread_attr_setschedparam(
pthread_attr_t *attr,
const struct sched_param *param
pthread_attr_t *attr,
const struct sched_param *param
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !param )
return EINVAL;
attr->schedparam = *param;
@@ -476,7 +521,7 @@ int pthread_attr_getschedparam(
struct sched_param *param
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !param )
return EINVAL;
*param = attr->schedparam;
@@ -511,6 +556,8 @@ int pthread_getschedparam(
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
*policy = api->schedpolicy;
*param = api->schedparam;
param->sched_priority =
_POSIX_Priority_From_core( the_thread->current_priority );
_Thread_Enable_dispatch();
return 0;
}
@@ -606,13 +653,14 @@ int pthread_setschedparam(
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
_Thread_Change_priority(
the_thread,
_POSIX_Priority_To_core( api->schedparam.sched_priority )
);
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority( the_thread, the_thread->real_priority );
break;
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
break;
}
@@ -665,7 +713,7 @@ int pthread_attr_getstacksize(
size_t *stacksize
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !stacksize )
return EINVAL;
*stacksize = attr->stacksize;
@@ -685,8 +733,8 @@ int pthread_attr_setstacksize(
if ( !attr || !attr->is_initialized )
return EINVAL;
if (stacksize < STACK_MINIMUM_SIZE)
attr->stacksize = STACK_MINIMUM_SIZE;
if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
else
attr->stacksize = stacksize;
return 0;
@@ -702,7 +750,7 @@ int pthread_attr_getstackaddr(
void **stackaddr
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !stackaddr )
return EINVAL;
*stackaddr = attr->stackaddr;
@@ -736,7 +784,7 @@ int pthread_attr_getdetachstate(
int *detachstate
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !detachstate )
return EINVAL;
*detachstate = attr->detachstate;
@@ -840,7 +888,7 @@ int pthread_create(
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
return ENOSYS;
return ENOTSUP;
/*
* Interpret the scheduling parameters.
@@ -911,7 +959,7 @@ int pthread_create(
if ( !the_thread ) {
_Thread_Enable_dispatch();
return EINVAL;
return EAGAIN;
}
/*
@@ -935,7 +983,7 @@ int pthread_create(
if ( !status ) {
_POSIX_Threads_Free( the_thread );
_Thread_Enable_dispatch();
return EINVAL;
return EAGAIN;
}
/*
@@ -1012,6 +1060,7 @@ int pthread_join(
register Thread_Control *the_thread;
POSIX_API_Control *api;
Objects_Locations location;
void *return_pointer;
the_thread = _POSIX_Threads_Get( thread, &location );
switch ( location ) {
@@ -1035,7 +1084,7 @@ int pthread_join(
* Put ourself on the threads join list
*/
_Thread_Executing->Wait.return_argument = (unsigned32 *) value_ptr;
_Thread_Executing->Wait.return_argument = (unsigned32 *) &return_pointer;
_Thread_queue_Enter_critical_section( &api->Join_List );
@@ -1043,6 +1092,8 @@ int pthread_join(
_Thread_Enable_dispatch();
if ( value_ptr )
*value_ptr = return_pointer;
return 0;
}
@@ -1246,7 +1297,7 @@ int pthread_attr_getcputime(
int *clock_allowed
)
{
if ( !attr || !attr->is_initialized )
if ( !attr || !attr->is_initialized || !clock_allowed )
return EINVAL;
*clock_allowed = attr->cputime_clock_allowed;

View File

@@ -129,7 +129,11 @@ int sched_rr_get_interval(
* Only supported for the "calling process" (i.e. this node).
*/
assert( pid == getpid() );
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;
@@ -142,6 +146,8 @@ int sched_rr_get_interval(
int sched_yield( void )
{
_Thread_Yield_processor();
_Thread_Disable_dispatch();
_Thread_Yield_processor();
_Thread_Enable_dispatch();
return 0;
}

View File

@@ -14,6 +14,37 @@
#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
@@ -64,8 +95,10 @@ time_t time(
{
time_t seconds_since_epoch;
if ( !_TOD_Is_set() )
set_errno_and_return_minus_one( EINVAL );
/*
* 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.
@@ -81,7 +114,8 @@ time_t time(
return seconds_since_epoch;
}
/*
/*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
*/
@@ -149,7 +183,8 @@ int clock_settime(
return 0;
}
/*
/*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
*/
@@ -162,13 +197,12 @@ int clock_gettime(
time_t seconds;
long ticks;
assert( tp );
if ( !tp )
set_errno_and_return_minus_one( EINVAL );
switch ( clock_id ) {
case CLOCK_REALTIME:
if ( !_TOD_Is_set() ) /* XXX does posix allow it to not be set? */
set_errno_and_return_minus_one( EINVAL );
_ISR_Disable( level );
seconds = _TOD_Seconds_since_epoch;
@@ -199,7 +233,8 @@ int clock_gettime(
return 0;
}
/*
/*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
*/
@@ -208,6 +243,9 @@ int clock_getres(
struct timespec *res
)
{
if ( !res )
set_errno_and_return_minus_one( EINVAL );
switch ( clock_id ) {
/*
@@ -228,7 +266,8 @@ int clock_getres(
return 0;
}
/*
/*PAGE
*
* 14.2.5 High Resolution Sleep, P1003.1b-1993, p. 269
*/
@@ -237,7 +276,13 @@ int nanosleep(
struct timespec *rmtp
)
{
Watchdog_Interval ticks;
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.
@@ -246,15 +291,16 @@ int nanosleep(
* FSU pthreads shares this behavior.
*/
if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
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 ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
set_errno_and_return_minus_one( EINVAL );
/* XXX this is interruptible by a posix signal */
ticks = _POSIX_Timespec_to_interval( rqtp );
ticks = _POSIX_Timespec_to_interval( the_rqtp );
/*
* This behavior is also beyond the POSIX specification but is
@@ -264,6 +310,10 @@ int nanosleep(
if ( !ticks ) {
_Thread_Yield_processor();
_Thread_Dispatch();
if ( rmtp ) {
rmtp->tv_sec = 0;
rmtp->tv_nsec = 0;
}
return 0;
}
@@ -274,7 +324,7 @@ int nanosleep(
);
_Watchdog_Initialize(
&_Thread_Executing->Timer,
_Thread_Delay_ended, /* XXX may need to be POSIX specific */
_Thread_Delay_ended,
_Thread_Executing->Object.id,
NULL
);
@@ -288,13 +338,20 @@ int nanosleep(
_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; /* XXX should account for signal */
return 0;
}
/*
/*PAGE
*
* 20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55
*/
@@ -306,7 +363,8 @@ int clock_getcpuclockid(
return POSIX_NOT_IMPLEMENTED();
}
/*
/*PAGE
*
* 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
*/
@@ -318,7 +376,8 @@ int clock_setenable_attr(
return POSIX_NOT_IMPLEMENTED();
}
/*
/*PAGE
*
* 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
*/

View File

@@ -9,7 +9,7 @@
/*
* 3.4.3 Delay Process Execution, P1003.1b-1993, p. 73
* 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
*/
unsigned int sleep(
@@ -27,7 +27,9 @@ unsigned int sleep(
return tm.tv_sec; /* seconds remaining */
}
/*
/*PAGE
*
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
*/

View File

@@ -1,121 +0,0 @@
/* rtems.h
*
* This include file contains information about RTEMS executive that
* is required by the application and is CPU independent. It includes
* two (2) CPU dependent files to tailor its data structures for a
* particular processor.
*
* 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_RTEMS_GENERIC_h
#define __RTEMS_RTEMS_GENERIC_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* Unless told otherwise, the RTEMS include files will hide some stuff
* from normal application code. Defining this crosses a boundary which
* is undesirable since it means your application is using RTEMS features
* which are not included in the formally defined and supported API.
* Define this at your own risk.
*/
#ifndef __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#define __RTEMS_APPLICATION__
#endif
#include <rtems/system.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/types.h>
#include <rtems/config.h>
#include <rtems/init.h>
#include <rtems/rtems/tasks.h>
#include <rtems/rtems/intr.h>
#include <rtems/rtems/clock.h>
#include <rtems/extension.h>
#include <rtems/rtems/timer.h>
#include <rtems/rtems/sem.h>
#include <rtems/rtems/message.h>
#include <rtems/rtems/event.h>
#include <rtems/rtems/signal.h>
#include <rtems/rtems/event.h>
#include <rtems/rtems/part.h>
#include <rtems/rtems/region.h>
#include <rtems/rtems/dpmem.h>
#include <rtems/io.h>
#include <rtems/fatal.h>
#include <rtems/rtems/ratemon.h>
#include <rtems/rtems/mp.h>
#include <rtems/rtems/support.h>
#include <rtems/score/sysstate.h>
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
/*
* The following define the constants which may be used in name searches.
*/
#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
/*
* Parameters and return id's for _Objects_Get_next
*/
#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
#define RTEMS_OBJECT_ID_INITIAL(class, node) OBJECTS_ID_INITIAL(class, node)
#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
/*
* The following constant defines the minimum stack size which every
* thread must exceed.
*/
#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
/*
* Constant for indefinite wait. (actually an illegal interval)
*/
#define RTEMS_NO_TIMEOUT WATCHDOG_NO_TIMEOUT
/*
* An MPCI must support packets of at least this size.
*/
#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
/*
* The following constant defines the number of unsigned32's
* in a packet which must be converted to native format in a
* heterogeneous system. In packets longer than
* MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
* may a user message buffer which is not automatically endian swapped.
*/
#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,112 +0,0 @@
/* asr.h
*
* This include file contains all the constants and structures associated
* with the Asynchronous Signal Handler. This Handler provides the low-level
* support required by the Signal 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_ASR_h
#define __RTEMS_ASR_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/rtems/modes.h>
/*
*
* The following type defines the control block used to manage
* each signal set.
*/
typedef unsigned32 rtems_signal_set;
/*
* Return type for ASR Handler
*/
typedef void rtems_asr;
/*
* The following type corresponds to the applications asynchronous
* signal processing routine.
*/
typedef rtems_asr ( *rtems_asr_entry )(
rtems_signal_set
);
/*
*
* The following defines the control structure used to manage
* signals. Each thread has a copy of this record.
*/
typedef struct {
boolean is_enabled; /* are ASRs enabled currently? */
rtems_asr_entry handler; /* address of RTEMS_ASR */
Modes_Control mode_set; /* RTEMS_ASR mode */
rtems_signal_set signals_posted; /* signal set */
rtems_signal_set signals_pending; /* pending signal set */
unsigned32 nest_level; /* nest level of RTEMS_ASR */
} ASR_Information;
/*
* The following constants define the individual signals which may
* be used to compose a signal set.
*/
#define RTEMS_SIGNAL_0 0x00000001
#define RTEMS_SIGNAL_1 0x00000002
#define RTEMS_SIGNAL_2 0x00000004
#define RTEMS_SIGNAL_3 0x00000008
#define RTEMS_SIGNAL_4 0x00000010
#define RTEMS_SIGNAL_5 0x00000020
#define RTEMS_SIGNAL_6 0x00000040
#define RTEMS_SIGNAL_7 0x00000080
#define RTEMS_SIGNAL_8 0x00000100
#define RTEMS_SIGNAL_9 0x00000200
#define RTEMS_SIGNAL_10 0x00000400
#define RTEMS_SIGNAL_11 0x00000800
#define RTEMS_SIGNAL_12 0x00001000
#define RTEMS_SIGNAL_13 0x00002000
#define RTEMS_SIGNAL_14 0x00004000
#define RTEMS_SIGNAL_15 0x00008000
#define RTEMS_SIGNAL_16 0x00010000
#define RTEMS_SIGNAL_17 0x00020000
#define RTEMS_SIGNAL_18 0x00040000
#define RTEMS_SIGNAL_19 0x00080000
#define RTEMS_SIGNAL_20 0x00100000
#define RTEMS_SIGNAL_21 0x00200000
#define RTEMS_SIGNAL_22 0x00400000
#define RTEMS_SIGNAL_23 0x00800000
#define RTEMS_SIGNAL_24 0x01000000
#define RTEMS_SIGNAL_25 0x02000000
#define RTEMS_SIGNAL_26 0x04000000
#define RTEMS_SIGNAL_27 0x08000000
#define RTEMS_SIGNAL_28 0x10000000
#define RTEMS_SIGNAL_29 0x20000000
#define RTEMS_SIGNAL_30 0x40000000
#define RTEMS_SIGNAL_31 0x80000000
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/asr.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,84 +0,0 @@
/* attr.h
*
* This include file contains all information about the Object Attributes
* Handler.
*
* 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_ATTRIBUTES_h
#define __RTEMS_ATTRIBUTES_h
#ifdef __cplusplus
extern "C" {
#endif
/* types */
typedef unsigned32 rtems_attribute;
/* constants */
#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
#define RTEMS_LOCAL 0x00000000 /* local resource */
#define RTEMS_GLOBAL 0x00000002 /* global resource */
#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
#define RTEMS_PRIORITY 0x00000004 /* process by priority */
#define RTEMS_COUNTING_SEMAPHORE 0x00000000
#define RTEMS_BINARY_SEMAPHORE 0x00000010
#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
#define RTEMS_INHERIT_PRIORITY 0x00000020
#define RTEMS_NO_PRIORITY_CEILING 0x00000000
#define RTEMS_PRIORITY_CEILING 0x00000040
#if ( CPU_HARDWARE_FP == TRUE )
#define ATTRIBUTES_NOT_SUPPORTED 0
#else
#define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT
#endif
#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
#else
#define ATTRIBUTES_REQUIRED 0
#endif
/*
* _Attributes_Handler_initialization
*
* DESCRIPTION:
*
* This routine performs initialization for this handler.
*
* NOTE: There is no initialization required in C. Conditional compilation
* takes care of this in C.
*/
#define _Attributes_Handler_initialization()
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/attr.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,103 +0,0 @@
/* clock.h
*
* This include file contains all the constants and structures associated
* with the Clock Manager. This manager provides facilities to set, obtain,
* and continually update the current date and time.
*
* This manager provides directives to:
*
* + set the current date and time
* + obtain the current date and time
* + announce a clock tick
*
*
* 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_CLOCK_h
#define __RTEMS_CLOCK_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/tod.h>
#include <rtems/rtems/types.h>
/*
* List of things which can be returned by the rtems_clock_get directive.
*/
typedef enum {
RTEMS_CLOCK_GET_TOD,
RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH,
RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
RTEMS_CLOCK_GET_TICKS_PER_SECOND,
RTEMS_CLOCK_GET_TIME_VALUE
} rtems_clock_get_options;
/*
* Standard flavor style to return TOD in for a rtems_clock_get option.
*/
typedef struct {
unsigned32 seconds;
unsigned32 microseconds;
} rtems_clock_time_value;
/*
* rtems_clock_get
*
* DESCRIPTION:
*
* This routine implements the rtems_clock_get directive. It returns
* one of the following:
* + current time of day
* + seconds since epoch
* + ticks since boot
* + ticks per second
*/
rtems_status_code rtems_clock_get(
rtems_clock_get_options option,
void *time_buffer
);
/*
* rtems_clock_set
*
* DESCRIPTION:
*
* This routine implements the rtems_clock_set directive. It sets
* the current time of day to that in the time_buffer record.
*/
rtems_status_code rtems_clock_set(
rtems_time_of_day *time_buffer
);
/*
* rtems_clock_tick
*
* DESCRIPTION:
*
* This routine implements the rtems_clock_tick directive. It is invoked
* to inform RTEMS of the occurrence of a clock tick.
*/
rtems_status_code rtems_clock_tick( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,54 +0,0 @@
/* config.h
*
* This include file contains the table of user defined configuration
* parameters specific for the RTEMS 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_RTEMS_CONFIGURATION_h
#define __RTEMS_RTEMS_CONFIGURATION_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/rtems/types.h>
#include <rtems/rtems/tasks.h>
/*
* 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
*/
typedef struct {
unsigned32 maximum_tasks;
unsigned32 maximum_timers;
unsigned32 maximum_semaphores;
unsigned32 maximum_message_queues;
unsigned32 maximum_partitions;
unsigned32 maximum_regions;
unsigned32 maximum_ports;
unsigned32 maximum_periods;
unsigned32 number_of_initialization_tasks;
rtems_initialization_tasks_table *User_initialization_tasks_table;
} rtems_api_configuration_table;
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,157 +0,0 @@
/* dpmem.h
*
* This include file contains all the constants and structures associated
* with the Dual Ported Memory Manager. This manager provides a mechanism
* for converting addresses between internal and external representations
* for multiple dual-ported memory areas.
*
* Directives provided are:
*
* + create a port
* + get ID of a port
* + delete a port
* + convert external to internal address
* + convert internal to external address
*
*
* 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_DUAL_PORTED_MEMORY_h
#define __RTEMS_DUAL_PORTED_MEMORY_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/object.h>
/*
* The following structure defines the port control block. Each port
* has a control block associated with it. This control block contains
* all information required to support the port related operations.
*/
typedef struct {
Objects_Control Object;
void *internal_base; /* base internal address */
void *external_base; /* base external address */
unsigned32 length; /* length of dual-ported area */
} Dual_ported_memory_Control;
/*
* The following define the internal Dual Ported Memory information.
*/
RTEMS_EXTERN Objects_Information _Dual_ported_memory_Information;
/*
* _Dual_ported_memory_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _Dual_ported_memory_Manager_initialization(
unsigned32 maximum_ports
);
/*
* rtems_port_create
*
* DESCRIPTION:
*
* This routine implements the rtems_port_create directive. The port
* will have the name name. The port maps onto an area of dual ported
* memory of length bytes which has internal_start and external_start
* as the internal and external starting addresses, respectively.
* It returns the id of the created port in ID.
*/
rtems_status_code rtems_port_create(
rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
Objects_Id *id
);
/*
* rtems_port_ident
*
* DESCRIPTION:
*
* This routine implements the rtems_port_ident directive. This directive
* returns the port ID associated with name. If more than one port is
* named name, then the port to which the ID belongs is arbitrary.
*/
rtems_status_code rtems_port_ident(
rtems_name name,
Objects_Id *id
);
/*
* rtems_port_delete
*
* DESCRIPTION:
*
* This routine implements the rtems_port_delete directive. It deletes
* the port associated with ID.
*/
rtems_status_code rtems_port_delete(
Objects_Id id
);
/*
* rtems_port_external_to_internal
*
* DESCRIPTION:
*
* This routine implements the rtems_port_external_to_internal directive.
* It returns the internal port address which maps to the provided
* external port address for the specified port ID.
*/
rtems_status_code rtems_port_external_to_internal(
Objects_Id id,
void *external,
void **internal
);
/*
* rtems_port_internal_to_external
*
* DESCRIPTION:
*
* This routine implements the Port_internal_to_external directive.
* It returns the external port address which maps to the provided
* internal port address for the specified port ID.
*/
rtems_status_code rtems_port_internal_to_external(
Objects_Id id,
void *internal,
void **external
);
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/dpmem.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,174 +0,0 @@
/* event.h
*
* This include file contains the information pertaining to the Event
* Manager. This manager provides a high performance method of communication
* and synchronization.
*
* Directives provided are:
*
* + send an event set to a task
* + receive event condition
*
*
* 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_EVENT_h
#define __RTEMS_EVENT_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/object.h>
#include <rtems/rtems/types.h>
#include <rtems/rtems/options.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
#include <rtems/rtems/eventset.h>
/*
* This constant is passed as the event_in to the
* rtems_event_receive directive to determine which events are pending.
*/
#define EVENT_CURRENT 0
/*
* The following enumerated types indicate what happened while the event
* manager was in the synchronization window.
*/
typedef enum {
EVENT_SYNC_SYNCHRONIZED,
EVENT_SYNC_NOTHING_HAPPENED,
EVENT_SYNC_TIMEOUT,
EVENT_SYNC_SATISFIED
} Event_Sync_states;
/*
* Event_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _Event_Manager_initialization( void );
/*
* rtems_event_send
*
* DESCRIPTION:
*
* This routine implements the rtems_event_send directive. It sends
* event_in to the task specified by ID. If the task is blocked
* waiting to receive events and the posting of event_in satisfies
* the task's event condition, then it is unblocked.
*/
rtems_status_code rtems_event_send (
Objects_Id id,
rtems_event_set event_in
);
/*
* rtems_event_receive
*
* DESCRIPTION:
*
* This routine implements the rtems_event_receive directive. This
* directive is invoked when the calling task wishes to receive
* the event_in event condition. One of the fields in the option_set
* parameter determines whether the receive request is satisfied if
* any or all of the events are pending. If the event condition
* is not satisfied immediately, then the task may block with an
* optional timeout of TICKS clock ticks or return immediately.
* This determination is based on another field in the option_set
* parameter. This directive returns the events received in the
* event_out parameter.
*/
rtems_status_code rtems_event_receive (
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
);
/*
* _Event_Seize
*
* DESCRIPTION:
*
* This routine determines if the event condition event_in is
* satisfied. If so or if the no_wait option is enabled in option_set,
* then the procedure returns immediately. If neither of these
* conditions is true, then the calling task is blocked with an
* optional timeout of ticks clock ticks.
*/
void _Event_Seize (
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
);
/*
* _Event_Surrender
*
* DESCRIPTION:
*
* This routine determines if the event condition of the_thread
* has been satisfied. If so, it unblocks the_thread.
*/
void _Event_Surrender (
Thread_Control *the_thread
);
/*
* _Event_Timeout
*
* DESCRIPTION:
*
* This routine is invoked when a task's event receive request
* has not been satisfied after the specified timeout interval.
* The task represented by ID will be unblocked and its status
* code will be set in it's control block to indicate that a timeout
* has occurred.
*/
void _Event_Timeout (
Objects_Id id,
void *ignored
);
/*
* The following defines the synchronization flag used by the
* Event Manager to insure that signals sent to the currently
* executing thread are received properly.
*/
RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state;
#include <rtems/rtems/eventmp.h>
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/event.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,147 +0,0 @@
/* eventmp.h
*
* This include file contains all the constants and structures associated
* with the Multiprocessing Support in the Event 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_EVENT_MP_h
#define __RTEMS_EVENT_MP_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/rtems/event.h>
#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 event operations.
*/
typedef enum {
EVENT_MP_SEND_REQUEST = 0,
EVENT_MP_SEND_RESPONSE = 1
} Event_MP_Remote_operations;
/*
* The following data structure defines the packet used to perform
* remote event operations.
*/
typedef struct {
rtems_packet_prefix Prefix;
Event_MP_Remote_operations operation;
rtems_event_set event_in;
} Event_MP_Packet;
/*
* _Event_MP_Send_process_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* process operation can be performed on another node.
*
* This routine is not needed since there are no process
* packets to be sent by this manager.
*/
/*
* _Event_MP_Send_request_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive operation can be initiated on another node.
*/
rtems_status_code _Event_MP_Send_request_packet (
Event_MP_Remote_operations operation,
Objects_Id event_id,
rtems_event_set event_in
);
/*
* _Event_MP_Send_response_packet
*
* DESCRIPTION:
*
* This routine performs a remote procedure call so that a
* directive can be performed on another node.
*/
void _Event_MP_Send_response_packet (
Event_MP_Remote_operations operation,
Thread_Control *the_thread
);
/*
*
* _Event_MP_Process_packet
*
* DESCRIPTION:
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _Event_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix
);
/*
* _Event_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.
*
* This routine is not needed since there are no objects
* deleted by this manager.
*/
/*
* _Event_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.
*
* This routine is not needed since there are no objects
* deleted by this manager.
*/
/*
* _Event_MP_Get_packet
*
* DESCRIPTION:
*
* This function is used to obtain a event mp packet.
*/
Event_MP_Packet *_Event_MP_Get_packet ( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of file */

View File

@@ -1,89 +0,0 @@
/* eventset.h
*
* This include file contains the information pertaining to the
* Event Sets Handler. This handler provides methods for the manipulation
* of event sets which will be sent and received by tasks.
*
* 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_EVENT_SET_h
#define __RTEMS_EVENT_SET_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following defines the type used to control event sets.
*/
typedef unsigned32 rtems_event_set;
/*
* The following constants define the individual events which may
* be used to compose an event set.
*/
#define RTEMS_PENDING_EVENTS 0 /* receive pending events */
#define RTEMS_ALL_EVENTS 0xFFFFFFFF
#define RTEMS_EVENT_0 0x00000001
#define RTEMS_EVENT_1 0x00000002
#define RTEMS_EVENT_2 0x00000004
#define RTEMS_EVENT_3 0x00000008
#define RTEMS_EVENT_4 0x00000010
#define RTEMS_EVENT_5 0x00000020
#define RTEMS_EVENT_6 0x00000040
#define RTEMS_EVENT_7 0x00000080
#define RTEMS_EVENT_8 0x00000100
#define RTEMS_EVENT_9 0x00000200
#define RTEMS_EVENT_10 0x00000400
#define RTEMS_EVENT_11 0x00000800
#define RTEMS_EVENT_12 0x00001000
#define RTEMS_EVENT_13 0x00002000
#define RTEMS_EVENT_14 0x00004000
#define RTEMS_EVENT_15 0x00008000
#define RTEMS_EVENT_16 0x00010000
#define RTEMS_EVENT_17 0x00020000
#define RTEMS_EVENT_18 0x00040000
#define RTEMS_EVENT_19 0x00080000
#define RTEMS_EVENT_20 0x00100000
#define RTEMS_EVENT_21 0x00200000
#define RTEMS_EVENT_22 0x00400000
#define RTEMS_EVENT_23 0x00800000
#define RTEMS_EVENT_24 0x01000000
#define RTEMS_EVENT_25 0x02000000
#define RTEMS_EVENT_26 0x04000000
#define RTEMS_EVENT_27 0x08000000
#define RTEMS_EVENT_28 0x10000000
#define RTEMS_EVENT_29 0x20000000
#define RTEMS_EVENT_30 0x40000000
#define RTEMS_EVENT_31 0x80000000
/*
* The following constant is the value of an event set which
* has no events pending.
*/
#define EVENT_SETS_NONE_PENDING 0
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/eventset.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,160 +0,0 @@
/* intr.h
*
* This include file contains all the constants and structures associated
* with the 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_INTERRUPT_h
#define __RTEMS_INTERRUPT_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/isr.h>
/*
* Interrupt level type
*/
typedef ISR_Level rtems_interrupt_level;
/*
* The following type defines the control block used to manage
* the vectors.
*/
typedef ISR_Vector_number rtems_vector_number;
/*
* Return type for ISR Handler
*/
typedef void rtems_isr;
/*
* Pointer to an ISR Handler
*/
typedef rtems_isr ( *rtems_isr_entry )(
rtems_vector_number
);
/*
* _Interrupt_Manager_initialization
*
* DESCRIPTION:
*
* This routine initializes the interrupt manager.
*
*/
void _Interrupt_Manager_initialization( void );
/*
* rtems_interrupt_catch
*
* DESCRIPTION:
*
* This routine implements the rtems_interrupt_catch directive. This
* directive installs new_isr_handler as the RTEMS interrupt service
* routine for vector. The previous RTEMS interrupt service
* routine is returned in old_isr_handler.
*/
rtems_status_code rtems_interrupt_catch(
rtems_isr_entry new_isr_handler,
rtems_vector_number vector,
rtems_isr_entry *old_isr_handler
);
/*
* rtems_interrupt_disable
*
* DESCRIPTION:
*
* This routine disables all maskable interrupts and returns the
* previous level in _isr_cookie.
*/
#define rtems_interrupt_disable( _isr_cookie ) \
_ISR_Disable(_isr_cookie)
/*
* rtems_interrupt_enable
*
* DESCRIPTION:
*
* This routine enables maskable interrupts to the level indicated
* _isr_cookie.
*/
#define rtems_interrupt_enable( _isr_cookie ) \
_ISR_Enable(_isr_cookie)
/*
* rtems_interrupt_flash
*
* DESCRIPTION:
*
* This routine temporarily enables maskable interrupts to the
* level in _isr_cookie before redisabling them.
*/
#define rtems_interrupt_flash( _isr_cookie ) \
_ISR_Flash(_isr_cookie)
/*
* rtems_interrupt_is_in_progress
*
* DESCRIPTION:
*
* This function returns TRUE if the processor is currently servicing
* and interrupt and FALSE otherwise. A return value of TRUE indicates
* that the caller is an interrupt service routine, NOT a thread. The
* directives available to an interrupt service routine are restricted.
*/
#define rtems_interrupt_is_in_progress() \
_ISR_Is_in_progress()
/*
* rtems_interrupt_cause
*
* DESCRIPTION:
*
* This routine generates an interrupt.
*
* NOTE: No implementation.
*/
#define rtems_interrupt_cause( _interrupt_to_cause )
/*
* rtems_interrupt_cause
*
* DESCRIPTION:
*
* This routine clears the specified interrupt.
*
* NOTE: No implementation.
*/
#define rtems_interrupt_clear( _interrupt_to_clear )
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,317 +0,0 @@
/* message.h
*
* This include file contains all the constants and structures associated
* with the Message Queue Manager. This manager provides a mechanism for
* communication and synchronization between tasks using messages.
*
* Directives provided are:
*
* + create a queue
* + get ID of a queue
* + delete a queue
* + put a message at the rear of a queue
* + put a message at the front of a queue
* + broadcast N messages to a queue
* + receive message from a queue
* + flush all messages on a 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_MESSAGE_QUEUE_h
#define __RTEMS_MESSAGE_QUEUE_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/rtems/types.h>
#include <rtems/score/chain.h>
#include <rtems/score/object.h>
#include <rtems/rtems/attr.h>
#include <rtems/score/threadq.h>
#include <rtems/score/coremsg.h>
/*
* The following enumerated type details the modes in which a message
* may be submitted to a message queue. The message may be posted
* in a send or urgent fashion.
*/
typedef enum {
MESSAGE_QUEUE_SEND_REQUEST = 0,
MESSAGE_QUEUE_URGENT_REQUEST = 1
} Message_queue_Submit_types;
/*
* The following records define the control block used to manage
* each message queue.
*/
typedef struct {
Objects_Control Object;
rtems_attribute attribute_set;
CORE_message_queue_Control message_queue;
} Message_queue_Control;
/*
* The following defines the information control block used to
* manage this class of objects.
*/
RTEMS_EXTERN Objects_Information _Message_queue_Information;
/*
* _Message_queue_Manager_initialization
*
* DESCRIPTION:
*
* This routine performs the initialization necessary for this manager.
*/
void _Message_queue_Manager_initialization(
unsigned32 maximum_message_queues
);
/*
* rtems_message_queue_create
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_create directive. The
* message queue will have the name name. If the attribute_set indicates
* that the message queue is to be limited in the number of messages
* that can be outstanding, then count indicates the maximum number of
* messages that will be held. It returns the id of the created
* message queue in ID.
*/
rtems_status_code rtems_message_queue_create(
rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
Objects_Id *id
);
/*
* rtems_message_queue_ident
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_ident directive.
* This directive returns the message queue ID associated with NAME.
* If more than one message queue is named name, then the message
* queue to which the ID belongs is arbitrary. node indicates the
* extent of the search for the ID of the message queue named name.
* The search can be limited to a particular node or allowed to
* encompass all nodes.
*/
rtems_status_code rtems_message_queue_ident(
rtems_name name,
unsigned32 node,
Objects_Id *id
);
/*
* rtems_message_queue_delete
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_delete directive. The
* message queue indicated by ID is deleted.
*/
rtems_status_code rtems_message_queue_delete(
Objects_Id id
);
/*
* rtems_message_queue_send
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_send directive.
* This directive sends the message buffer to the message queue
* indicated by ID. If one or more tasks is blocked waiting
* to receive a message from this message queue, then one will
* receive the message. The task selected to receive the
* message is based on the task queue discipline algorithm in
* use by this particular message queue. If no tasks are waiting,
* then the message buffer will be placed at the rear of the
* chain of pending messages for this message queue.
*/
rtems_status_code rtems_message_queue_send(
Objects_Id id,
void *buffer,
unsigned32 size
);
/*
* rtems_message_queue_urgent
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_send directive.
* This directive sends the message buffer to the message queue
* indicated by ID. If one or more tasks is blocked waiting
* to receive a message from this message queue, then one will
* receive the message. The task selected to receive the
* message is based on the task queue discipline algorithm in
* use by this particular message queue. If no tasks are waiting,
* then the message buffer will be placed at the rear of the
* chain of pending messages for this message queue.
*/
rtems_status_code rtems_message_queue_urgent(
Objects_Id id,
void *buffer,
unsigned32 size
);
/*
* rtems_message_queue_broadcast
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_send directive.
* This directive sends the message buffer to the message queue
* indicated by ID. If one or more tasks is blocked waiting
* to receive a message from this message queue, then one will
* receive the message. The task selected to receive the
* message is based on the task queue discipline algorithm in
* use by this particular message queue. If no tasks are waiting,
* then the message buffer will be placed at the rear of the
* chain of pending messages for this message queue.
*/
rtems_status_code rtems_message_queue_broadcast(
Objects_Id id,
void *buffer,
unsigned32 size,
unsigned32 *count
);
/*
* rtems_message_queue_receive
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_receive directive.
* This directive is invoked when the calling task wishes to receive
* a message from the message queue indicated by ID. The received
* message is to be placed in buffer. If no messages are outstanding
* and the option_set indicates that the task is willing to block,
* then the task will be blocked until a message arrives or until,
* optionally, timeout clock ticks have passed.
*/
rtems_status_code rtems_message_queue_receive(
Objects_Id id,
void *buffer,
unsigned32 *size,
unsigned32 option_set,
rtems_interval timeout
);
/*
* rtems_message_queue_flush
*
* DESCRIPTION:
*
* This routine implements the rtems_message_queue_flush directive.
* This directive takes all outstanding messages for the message
* queue indicated by ID and returns them to the inactive message
* chain. The number of messages flushed is returned in COUNT.
*/
rtems_status_code rtems_message_queue_flush(
Objects_Id id,
unsigned32 *count
);
/*
* _Message_queue_Submit
*
* DESCRIPTION:
*
* This routine implements the directives rtems_message_queue_send
* and rtems_message_queue_urgent. It processes a message that is
* to be submitted to the designated message queue. The message will
* either be processed as a send send message which it will be inserted
* at the rear of the queue or it will be processed as an urgent message
* which will be inserted at the front of the queue.
*/
rtems_status_code _Message_queue_Submit(
Objects_Id id,
void *buffer,
unsigned32 size,
Message_queue_Submit_types submit_type
);
/*
* _Message_queue_Allocate
*
* DESCRIPTION:
*
* This function allocates a message queue control block from
* the inactive chain of free message queue control blocks.
*/
Message_queue_Control *_Message_queue_Allocate (
unsigned32 count,
unsigned32 max_message_size
);
/*
* _Message_queue_Translate_core_message_queue_return_code
*
* DESCRIPTION:
*
* This function returns a RTEMS status code based on the core message queue
* status code specified.
*/
rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
unsigned32 the_message_queue_status
);
/*
*
* _Message_queue_Core_message_queue_mp_support
*
* Input parameters:
* the_thread - the remote thread the message was submitted to
* id - id of the message queue
*
* Output parameters: NONE
*/
void _Message_queue_Core_message_queue_mp_support (
Thread_Control *the_thread,
Objects_Id id
);
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/message.inl>
#endif
#include <rtems/rtems/msgmp.h>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

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