forked from Imagelibrary/rtems
2003-11-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* .cvsignore: Remove. * ChangeLog: Remove. * Makefile.am: Remove. * configure.ac: Remove. * psxtests.am: Remove. * include/.cvsignore: Remove. * include/Makefile.am: Remove. * include/pmacros.h: Remove. * psx01/.cvsignore: Remove. * psx01/Makefile.am: Remove. * psx01/init.c: Remove. * psx01/psx01.scn: Remove. * psx01/system.h: Remove. * psx01/task.c: Remove. * psx02/.cvsignore: Remove. * psx02/Makefile.am: Remove. * psx02/init.c: Remove. * psx02/psx02.scn: Remove. * psx02/system.h: Remove. * psx02/task.c: Remove. * psx03/.cvsignore: Remove. * psx03/Makefile.am: Remove. * psx03/init.c: Remove. * psx03/psx03.scn: Remove. * psx03/system.h: Remove. * psx03/task.c: Remove. * psx04/.cvsignore: Remove. * psx04/Makefile.am: Remove. * psx04/init.c: Remove. * psx04/psx04.scn: Remove. * psx04/system.h: Remove. * psx04/task1.c: Remove. * psx04/task2.c: Remove. * psx04/task3.c: Remove. * psx05/.cvsignore: Remove. * psx05/Makefile.am: Remove. * psx05/init.c: Remove. * psx05/psx05.scn: Remove. * psx05/system.h: Remove. * psx05/task.c: Remove. * psx05/task2.c: Remove. * psx05/task3.c: Remove. * psx06/.cvsignore: Remove. * psx06/Makefile.am: Remove. * psx06/init.c: Remove. * psx06/psx06.scn: Remove. * psx06/system.h: Remove. * psx06/task.c: Remove. * psx06/task2.c: Remove. * psx07/.cvsignore: Remove. * psx07/Makefile.am: Remove. * psx07/init.c: Remove. * psx07/psx07.scn: Remove. * psx07/system.h: Remove. * psx07/task.c: Remove. * psx08/.cvsignore: Remove. * psx08/Makefile.am: Remove. * psx08/init.c: Remove. * psx08/psx08.scn: Remove. * psx08/system.h: Remove. * psx08/task1.c: Remove. * psx08/task2.c: Remove. * psx08/task3.c: Remove. * psx09/.cvsignore: Remove. * psx09/Makefile.am: Remove. * psx09/init.c: Remove. * psx09/psx09.scn: Remove. * psx09/system.h: Remove. * psx10/.cvsignore: Remove. * psx10/Makefile.am: Remove. * psx10/init.c: Remove. * psx10/psx10.scn: Remove. * psx10/system.h: Remove. * psx10/task.c: Remove. * psx10/task2.c: Remove. * psx10/task3.c: Remove. * psx11/.cvsignore: Remove. * psx11/Makefile.am: Remove. * psx11/init.c: Remove. * psx11/psx11.scn: Remove. * psx11/system.h: Remove. * psx11/task.c: Remove. * psx12/.cvsignore: Remove. * psx12/Makefile.am: Remove. * psx12/init.c: Remove. * psx12/psx12.scn: Remove. * psx12/system.h: Remove. * psx12/task.c: Remove. * psx13/.cvsignore: Remove. * psx13/Makefile.am: Remove. * psx13/main.c: Remove. * psx13/psx13.scn: Remove. * psx13/test.c: Remove. * psxcancel/.cvsignore: Remove. * psxcancel/Makefile.am: Remove. * psxcancel/init.c: Remove. * psxcancel/psxcancel.scn: Remove. * psxchroot01/.cvsignore: Remove. * psxchroot01/Makefile.am: Remove. * psxchroot01/main.c: Remove. * psxchroot01/psxchroot01.scn: Remove. * psxchroot01/test.c: Remove. * psxfile01/.cvsignore: Remove. * psxfile01/Makefile.am: Remove. * psxfile01/main.c: Remove. * psxfile01/psxfile01.scn: Remove. * psxfile01/test.c: Remove. * psxfile01/test_cat.c: Remove. * psxfile01/test_extend.c: Remove. * psxfile01/test_write.c: Remove. * psxhdrs/.cvsignore: Remove. * psxhdrs/Makefile.am: Remove. * psxhdrs/clock01.c: Remove. * psxhdrs/clock02.c: Remove. * psxhdrs/clock03.c: Remove. * psxhdrs/clock04.c: Remove. * psxhdrs/clock05.c: Remove. * psxhdrs/clock06.c: Remove. * psxhdrs/cond01.c: Remove. * psxhdrs/cond02.c: Remove. * psxhdrs/cond03.c: Remove. * psxhdrs/cond04.c: Remove. * psxhdrs/cond05.c: Remove. * psxhdrs/cond06.c: Remove. * psxhdrs/cond07.c: Remove. * psxhdrs/cond08.c: Remove. * psxhdrs/cond09.c: Remove. * psxhdrs/cond10.c: Remove. * psxhdrs/key01.c: Remove. * psxhdrs/key02.c: Remove. * psxhdrs/key03.c: Remove. * psxhdrs/key04.c: Remove. * psxhdrs/mutex01.c: Remove. * psxhdrs/mutex02.c: Remove. * psxhdrs/mutex03.c: Remove. * psxhdrs/mutex04.c: Remove. * psxhdrs/mutex05.c: Remove. * psxhdrs/mutex06.c: Remove. * psxhdrs/mutex07.c: Remove. * psxhdrs/mutex08.c: Remove. * psxhdrs/mutex09.c: Remove. * psxhdrs/mutex10.c: Remove. * psxhdrs/mutex11.c: Remove. * psxhdrs/mutex12.c: Remove. * psxhdrs/mutex13.c: Remove. * psxhdrs/mutex14.c: Remove. * psxhdrs/mutex15.c: Remove. * psxhdrs/mutex16.c: Remove. * psxhdrs/proc01.c: Remove. * psxhdrs/proc02.c: Remove. * psxhdrs/proc03.c: Remove. * psxhdrs/proc04.c: Remove. * psxhdrs/proc05.c: Remove. * psxhdrs/proc06.c: Remove. * psxhdrs/proc07.c: Remove. * psxhdrs/proc08.c: Remove. * psxhdrs/proc09.c: Remove. * psxhdrs/proc10.c: Remove. * psxhdrs/proc11.c: Remove. * psxhdrs/proc12.c: Remove. * psxhdrs/proc13.c: Remove. * psxhdrs/proc14.c: Remove. * psxhdrs/pthread01.c: Remove. * psxhdrs/pthread02.c: Remove. * psxhdrs/pthread03.c: Remove. * psxhdrs/pthread04.c: Remove. * psxhdrs/pthread05.c: Remove. * psxhdrs/pthread06.c: Remove. * psxhdrs/pthread07.c: Remove. * psxhdrs/pthread08.c: Remove. * psxhdrs/pthread09.c: Remove. * psxhdrs/pthread10.c: Remove. * psxhdrs/pthread11.c: Remove. * psxhdrs/pthread12.c: Remove. * psxhdrs/pthread13.c: Remove. * psxhdrs/pthread14.c: Remove. * psxhdrs/pthread15.c: Remove. * psxhdrs/pthread16.c: Remove. * psxhdrs/pthread17.c: Remove. * psxhdrs/pthread18.c: Remove. * psxhdrs/pthread19.c: Remove. * psxhdrs/pthread20.c: Remove. * psxhdrs/pthread21.c: Remove. * psxhdrs/pthread22.c: Remove. * psxhdrs/pthread23.c: Remove. * psxhdrs/pthread24.c: Remove. * psxhdrs/pthread25.c: Remove. * psxhdrs/pthread26.c: Remove. * psxhdrs/pthread27.c: Remove. * psxhdrs/pthread28.c: Remove. * psxhdrs/pthread29.c: Remove. * psxhdrs/pthread30.c: Remove. * psxhdrs/pthread31.c: Remove. * psxhdrs/pthread32.c: Remove. * psxhdrs/pthread33.c: Remove. * psxhdrs/pthread34.c: Remove. * psxhdrs/pthread35.c: Remove. * psxhdrs/pthread36.c: Remove. * psxhdrs/sched01.c: Remove. * psxhdrs/sched02.c: Remove. * psxhdrs/sched03.c: Remove. * psxhdrs/sched04.c: Remove. * psxhdrs/sched05.c: Remove. * psxhdrs/sched06.c: Remove. * psxhdrs/sched07.c: Remove. * psxhdrs/sched08.c: Remove. * psxhdrs/signal01.c: Remove. * psxhdrs/signal02.c: Remove. * psxhdrs/signal03.c: Remove. * psxhdrs/signal04.c: Remove. * psxhdrs/signal05.c: Remove. * psxhdrs/signal06.c: Remove. * psxhdrs/signal07.c: Remove. * psxhdrs/signal08.c: Remove. * psxhdrs/signal09.c: Remove. * psxhdrs/signal10.c: Remove. * psxhdrs/signal11.c: Remove. * psxhdrs/signal12.c: Remove. * psxhdrs/signal13.c: Remove. * psxhdrs/signal14.c: Remove. * psxhdrs/signal15.c: Remove. * psxhdrs/signal16.c: Remove. * psxhdrs/signal17.c: Remove. * psxhdrs/signal18.c: Remove. * psxhdrs/signal19.c: Remove. * psxhdrs/signal20.c: Remove. * psxhdrs/signal21.c: Remove. * psxhdrs/signal22.c: Remove. * psxhdrs/signal23.c: Remove. * psxhdrs/sync01.c: Remove. * psxhdrs/sync02.c: Remove. * psxhdrs/sync03.c: Remove. * psxhdrs/time01.c: Remove. * psxhdrs/time02.c: Remove. * psxhdrs/time03.c: Remove. * psxhdrs/time04.c: Remove. * psxhdrs/time05.c: Remove. * psxhdrs/time06.c: Remove. * psxhdrs/time07.c: Remove. * psxhdrs/time08.c: Remove. * psxhdrs/time09.c: Remove. * psxhdrs/time10.c: Remove. * psxhdrs/time11.c: Remove. * psxhdrs/time12.c: Remove. * psxhdrs/time13.c: Remove. * psxhdrs/timer01.c: Remove. * psxhdrs/timer02.c: Remove. * psxhdrs/timer03.c: Remove. * psxhdrs/timer04.c: Remove. * psxhdrs/timer05.c: Remove. * psxhdrs/timer06.c: Remove. * psxhdrs/timer07.c: Remove. * psxmount/.cvsignore: Remove. * psxmount/Makefile.am: Remove. * psxmount/main.c: Remove. * psxmount/psxmount.scn: Remove. * psxmount/test.c: Remove. * psxmsgq01/.cvsignore: Remove. * psxmsgq01/Makefile.am: Remove. * psxmsgq01/init.c: Remove. * psxmsgq01/psxmsgq01.scn: Remove. * psxmsgq01/system.h: Remove. * psxreaddir/.cvsignore: Remove. * psxreaddir/Makefile.am: Remove. * psxreaddir/main.c: Remove. * psxreaddir/psxreaddir.scn: Remove. * psxreaddir/test.c: Remove. * psxsem01/.cvsignore: Remove. * psxsem01/Makefile.am: Remove. * psxsem01/init.c: Remove. * psxsem01/psxsem01.scn: Remove. * psxsem01/system.h: Remove. * psxstat/.cvsignore: Remove. * psxstat/Makefile.am: Remove. * psxstat/main.c: Remove. * psxstat/psxstat.scn: Remove. * psxstat/test.c: Remove. * psxtime/.cvsignore: Remove. * psxtime/Makefile.am: Remove. * psxtime/main.c: Remove. * psxtime/psxtime.scn: Remove. * psxtime/test.c: Remove. * psxtimer/.cvsignore: Remove. * psxtimer/Makefile.am: Remove. * psxtimer/psxtimer.c: Remove. * psxtimer/psxtimer.scn: Remove. * psxtimer/system.h: Remove.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
aclocal.m4
|
||||
autom4te*.cache
|
||||
config.cache
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
Makefile
|
||||
Makefile.in
|
||||
missing
|
||||
mkinstalldirs
|
||||
@@ -1,708 +0,0 @@
|
||||
2003-11-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* .cvsignore: Remove.
|
||||
* ChangeLog: Remove.
|
||||
* Makefile.am: Remove.
|
||||
* configure.ac: Remove.
|
||||
* psxtests.am: Remove.
|
||||
* include/.cvsignore: Remove.
|
||||
* include/Makefile.am: Remove.
|
||||
* include/pmacros.h: Remove.
|
||||
* psx01/.cvsignore: Remove.
|
||||
* psx01/Makefile.am: Remove.
|
||||
* psx01/init.c: Remove.
|
||||
* psx01/psx01.scn: Remove.
|
||||
* psx01/system.h: Remove.
|
||||
* psx01/task.c: Remove.
|
||||
* psx02/.cvsignore: Remove.
|
||||
* psx02/Makefile.am: Remove.
|
||||
* psx02/init.c: Remove.
|
||||
* psx02/psx02.scn: Remove.
|
||||
* psx02/system.h: Remove.
|
||||
* psx02/task.c: Remove.
|
||||
* psx03/.cvsignore: Remove.
|
||||
* psx03/Makefile.am: Remove.
|
||||
* psx03/init.c: Remove.
|
||||
* psx03/psx03.scn: Remove.
|
||||
* psx03/system.h: Remove.
|
||||
* psx03/task.c: Remove.
|
||||
* psx04/.cvsignore: Remove.
|
||||
* psx04/Makefile.am: Remove.
|
||||
* psx04/init.c: Remove.
|
||||
* psx04/psx04.scn: Remove.
|
||||
* psx04/system.h: Remove.
|
||||
* psx04/task1.c: Remove.
|
||||
* psx04/task2.c: Remove.
|
||||
* psx04/task3.c: Remove.
|
||||
* psx05/.cvsignore: Remove.
|
||||
* psx05/Makefile.am: Remove.
|
||||
* psx05/init.c: Remove.
|
||||
* psx05/psx05.scn: Remove.
|
||||
* psx05/system.h: Remove.
|
||||
* psx05/task.c: Remove.
|
||||
* psx05/task2.c: Remove.
|
||||
* psx05/task3.c: Remove.
|
||||
* psx06/.cvsignore: Remove.
|
||||
* psx06/Makefile.am: Remove.
|
||||
* psx06/init.c: Remove.
|
||||
* psx06/psx06.scn: Remove.
|
||||
* psx06/system.h: Remove.
|
||||
* psx06/task.c: Remove.
|
||||
* psx06/task2.c: Remove.
|
||||
* psx07/.cvsignore: Remove.
|
||||
* psx07/Makefile.am: Remove.
|
||||
* psx07/init.c: Remove.
|
||||
* psx07/psx07.scn: Remove.
|
||||
* psx07/system.h: Remove.
|
||||
* psx07/task.c: Remove.
|
||||
* psx08/.cvsignore: Remove.
|
||||
* psx08/Makefile.am: Remove.
|
||||
* psx08/init.c: Remove.
|
||||
* psx08/psx08.scn: Remove.
|
||||
* psx08/system.h: Remove.
|
||||
* psx08/task1.c: Remove.
|
||||
* psx08/task2.c: Remove.
|
||||
* psx08/task3.c: Remove.
|
||||
* psx09/.cvsignore: Remove.
|
||||
* psx09/Makefile.am: Remove.
|
||||
* psx09/init.c: Remove.
|
||||
* psx09/psx09.scn: Remove.
|
||||
* psx09/system.h: Remove.
|
||||
* psx10/.cvsignore: Remove.
|
||||
* psx10/Makefile.am: Remove.
|
||||
* psx10/init.c: Remove.
|
||||
* psx10/psx10.scn: Remove.
|
||||
* psx10/system.h: Remove.
|
||||
* psx10/task.c: Remove.
|
||||
* psx10/task2.c: Remove.
|
||||
* psx10/task3.c: Remove.
|
||||
* psx11/.cvsignore: Remove.
|
||||
* psx11/Makefile.am: Remove.
|
||||
* psx11/init.c: Remove.
|
||||
* psx11/psx11.scn: Remove.
|
||||
* psx11/system.h: Remove.
|
||||
* psx11/task.c: Remove.
|
||||
* psx12/.cvsignore: Remove.
|
||||
* psx12/Makefile.am: Remove.
|
||||
* psx12/init.c: Remove.
|
||||
* psx12/psx12.scn: Remove.
|
||||
* psx12/system.h: Remove.
|
||||
* psx12/task.c: Remove.
|
||||
* psx13/.cvsignore: Remove.
|
||||
* psx13/Makefile.am: Remove.
|
||||
* psx13/main.c: Remove.
|
||||
* psx13/psx13.scn: Remove.
|
||||
* psx13/test.c: Remove.
|
||||
* psxcancel/.cvsignore: Remove.
|
||||
* psxcancel/Makefile.am: Remove.
|
||||
* psxcancel/init.c: Remove.
|
||||
* psxcancel/psxcancel.scn: Remove.
|
||||
* psxchroot01/.cvsignore: Remove.
|
||||
* psxchroot01/Makefile.am: Remove.
|
||||
* psxchroot01/main.c: Remove.
|
||||
* psxchroot01/psxchroot01.scn: Remove.
|
||||
* psxchroot01/test.c: Remove.
|
||||
* psxfile01/.cvsignore: Remove.
|
||||
* psxfile01/Makefile.am: Remove.
|
||||
* psxfile01/main.c: Remove.
|
||||
* psxfile01/psxfile01.scn: Remove.
|
||||
* psxfile01/test.c: Remove.
|
||||
* psxfile01/test_cat.c: Remove.
|
||||
* psxfile01/test_extend.c: Remove.
|
||||
* psxfile01/test_write.c: Remove.
|
||||
* psxhdrs/.cvsignore: Remove.
|
||||
* psxhdrs/Makefile.am: Remove.
|
||||
* psxhdrs/clock01.c: Remove.
|
||||
* psxhdrs/clock02.c: Remove.
|
||||
* psxhdrs/clock03.c: Remove.
|
||||
* psxhdrs/clock04.c: Remove.
|
||||
* psxhdrs/clock05.c: Remove.
|
||||
* psxhdrs/clock06.c: Remove.
|
||||
* psxhdrs/cond01.c: Remove.
|
||||
* psxhdrs/cond02.c: Remove.
|
||||
* psxhdrs/cond03.c: Remove.
|
||||
* psxhdrs/cond04.c: Remove.
|
||||
* psxhdrs/cond05.c: Remove.
|
||||
* psxhdrs/cond06.c: Remove.
|
||||
* psxhdrs/cond07.c: Remove.
|
||||
* psxhdrs/cond08.c: Remove.
|
||||
* psxhdrs/cond09.c: Remove.
|
||||
* psxhdrs/cond10.c: Remove.
|
||||
* psxhdrs/key01.c: Remove.
|
||||
* psxhdrs/key02.c: Remove.
|
||||
* psxhdrs/key03.c: Remove.
|
||||
* psxhdrs/key04.c: Remove.
|
||||
* psxhdrs/mutex01.c: Remove.
|
||||
* psxhdrs/mutex02.c: Remove.
|
||||
* psxhdrs/mutex03.c: Remove.
|
||||
* psxhdrs/mutex04.c: Remove.
|
||||
* psxhdrs/mutex05.c: Remove.
|
||||
* psxhdrs/mutex06.c: Remove.
|
||||
* psxhdrs/mutex07.c: Remove.
|
||||
* psxhdrs/mutex08.c: Remove.
|
||||
* psxhdrs/mutex09.c: Remove.
|
||||
* psxhdrs/mutex10.c: Remove.
|
||||
* psxhdrs/mutex11.c: Remove.
|
||||
* psxhdrs/mutex12.c: Remove.
|
||||
* psxhdrs/mutex13.c: Remove.
|
||||
* psxhdrs/mutex14.c: Remove.
|
||||
* psxhdrs/mutex15.c: Remove.
|
||||
* psxhdrs/mutex16.c: Remove.
|
||||
* psxhdrs/proc01.c: Remove.
|
||||
* psxhdrs/proc02.c: Remove.
|
||||
* psxhdrs/proc03.c: Remove.
|
||||
* psxhdrs/proc04.c: Remove.
|
||||
* psxhdrs/proc05.c: Remove.
|
||||
* psxhdrs/proc06.c: Remove.
|
||||
* psxhdrs/proc07.c: Remove.
|
||||
* psxhdrs/proc08.c: Remove.
|
||||
* psxhdrs/proc09.c: Remove.
|
||||
* psxhdrs/proc10.c: Remove.
|
||||
* psxhdrs/proc11.c: Remove.
|
||||
* psxhdrs/proc12.c: Remove.
|
||||
* psxhdrs/proc13.c: Remove.
|
||||
* psxhdrs/proc14.c: Remove.
|
||||
* psxhdrs/pthread01.c: Remove.
|
||||
* psxhdrs/pthread02.c: Remove.
|
||||
* psxhdrs/pthread03.c: Remove.
|
||||
* psxhdrs/pthread04.c: Remove.
|
||||
* psxhdrs/pthread05.c: Remove.
|
||||
* psxhdrs/pthread06.c: Remove.
|
||||
* psxhdrs/pthread07.c: Remove.
|
||||
* psxhdrs/pthread08.c: Remove.
|
||||
* psxhdrs/pthread09.c: Remove.
|
||||
* psxhdrs/pthread10.c: Remove.
|
||||
* psxhdrs/pthread11.c: Remove.
|
||||
* psxhdrs/pthread12.c: Remove.
|
||||
* psxhdrs/pthread13.c: Remove.
|
||||
* psxhdrs/pthread14.c: Remove.
|
||||
* psxhdrs/pthread15.c: Remove.
|
||||
* psxhdrs/pthread16.c: Remove.
|
||||
* psxhdrs/pthread17.c: Remove.
|
||||
* psxhdrs/pthread18.c: Remove.
|
||||
* psxhdrs/pthread19.c: Remove.
|
||||
* psxhdrs/pthread20.c: Remove.
|
||||
* psxhdrs/pthread21.c: Remove.
|
||||
* psxhdrs/pthread22.c: Remove.
|
||||
* psxhdrs/pthread23.c: Remove.
|
||||
* psxhdrs/pthread24.c: Remove.
|
||||
* psxhdrs/pthread25.c: Remove.
|
||||
* psxhdrs/pthread26.c: Remove.
|
||||
* psxhdrs/pthread27.c: Remove.
|
||||
* psxhdrs/pthread28.c: Remove.
|
||||
* psxhdrs/pthread29.c: Remove.
|
||||
* psxhdrs/pthread30.c: Remove.
|
||||
* psxhdrs/pthread31.c: Remove.
|
||||
* psxhdrs/pthread32.c: Remove.
|
||||
* psxhdrs/pthread33.c: Remove.
|
||||
* psxhdrs/pthread34.c: Remove.
|
||||
* psxhdrs/pthread35.c: Remove.
|
||||
* psxhdrs/pthread36.c: Remove.
|
||||
* psxhdrs/sched01.c: Remove.
|
||||
* psxhdrs/sched02.c: Remove.
|
||||
* psxhdrs/sched03.c: Remove.
|
||||
* psxhdrs/sched04.c: Remove.
|
||||
* psxhdrs/sched05.c: Remove.
|
||||
* psxhdrs/sched06.c: Remove.
|
||||
* psxhdrs/sched07.c: Remove.
|
||||
* psxhdrs/sched08.c: Remove.
|
||||
* psxhdrs/signal01.c: Remove.
|
||||
* psxhdrs/signal02.c: Remove.
|
||||
* psxhdrs/signal03.c: Remove.
|
||||
* psxhdrs/signal04.c: Remove.
|
||||
* psxhdrs/signal05.c: Remove.
|
||||
* psxhdrs/signal06.c: Remove.
|
||||
* psxhdrs/signal07.c: Remove.
|
||||
* psxhdrs/signal08.c: Remove.
|
||||
* psxhdrs/signal09.c: Remove.
|
||||
* psxhdrs/signal10.c: Remove.
|
||||
* psxhdrs/signal11.c: Remove.
|
||||
* psxhdrs/signal12.c: Remove.
|
||||
* psxhdrs/signal13.c: Remove.
|
||||
* psxhdrs/signal14.c: Remove.
|
||||
* psxhdrs/signal15.c: Remove.
|
||||
* psxhdrs/signal16.c: Remove.
|
||||
* psxhdrs/signal17.c: Remove.
|
||||
* psxhdrs/signal18.c: Remove.
|
||||
* psxhdrs/signal19.c: Remove.
|
||||
* psxhdrs/signal20.c: Remove.
|
||||
* psxhdrs/signal21.c: Remove.
|
||||
* psxhdrs/signal22.c: Remove.
|
||||
* psxhdrs/signal23.c: Remove.
|
||||
* psxhdrs/sync01.c: Remove.
|
||||
* psxhdrs/sync02.c: Remove.
|
||||
* psxhdrs/sync03.c: Remove.
|
||||
* psxhdrs/time01.c: Remove.
|
||||
* psxhdrs/time02.c: Remove.
|
||||
* psxhdrs/time03.c: Remove.
|
||||
* psxhdrs/time04.c: Remove.
|
||||
* psxhdrs/time05.c: Remove.
|
||||
* psxhdrs/time06.c: Remove.
|
||||
* psxhdrs/time07.c: Remove.
|
||||
* psxhdrs/time08.c: Remove.
|
||||
* psxhdrs/time09.c: Remove.
|
||||
* psxhdrs/time10.c: Remove.
|
||||
* psxhdrs/time11.c: Remove.
|
||||
* psxhdrs/time12.c: Remove.
|
||||
* psxhdrs/time13.c: Remove.
|
||||
* psxhdrs/timer01.c: Remove.
|
||||
* psxhdrs/timer02.c: Remove.
|
||||
* psxhdrs/timer03.c: Remove.
|
||||
* psxhdrs/timer04.c: Remove.
|
||||
* psxhdrs/timer05.c: Remove.
|
||||
* psxhdrs/timer06.c: Remove.
|
||||
* psxhdrs/timer07.c: Remove.
|
||||
* psxmount/.cvsignore: Remove.
|
||||
* psxmount/Makefile.am: Remove.
|
||||
* psxmount/main.c: Remove.
|
||||
* psxmount/psxmount.scn: Remove.
|
||||
* psxmount/test.c: Remove.
|
||||
* psxmsgq01/.cvsignore: Remove.
|
||||
* psxmsgq01/Makefile.am: Remove.
|
||||
* psxmsgq01/init.c: Remove.
|
||||
* psxmsgq01/psxmsgq01.scn: Remove.
|
||||
* psxmsgq01/system.h: Remove.
|
||||
* psxreaddir/.cvsignore: Remove.
|
||||
* psxreaddir/Makefile.am: Remove.
|
||||
* psxreaddir/main.c: Remove.
|
||||
* psxreaddir/psxreaddir.scn: Remove.
|
||||
* psxreaddir/test.c: Remove.
|
||||
* psxsem01/.cvsignore: Remove.
|
||||
* psxsem01/Makefile.am: Remove.
|
||||
* psxsem01/init.c: Remove.
|
||||
* psxsem01/psxsem01.scn: Remove.
|
||||
* psxsem01/system.h: Remove.
|
||||
* psxstat/.cvsignore: Remove.
|
||||
* psxstat/Makefile.am: Remove.
|
||||
* psxstat/main.c: Remove.
|
||||
* psxstat/psxstat.scn: Remove.
|
||||
* psxstat/test.c: Remove.
|
||||
* psxtime/.cvsignore: Remove.
|
||||
* psxtime/Makefile.am: Remove.
|
||||
* psxtime/main.c: Remove.
|
||||
* psxtime/psxtime.scn: Remove.
|
||||
* psxtime/test.c: Remove.
|
||||
* psxtimer/.cvsignore: Remove.
|
||||
* psxtimer/Makefile.am: Remove.
|
||||
* psxtimer/psxtimer.c: Remove.
|
||||
* psxtimer/psxtimer.scn: Remove.
|
||||
* psxtimer/system.h: Remove.
|
||||
|
||||
2003-10-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Remove RTEMS_CANONICAL_HOST.
|
||||
|
||||
2003-10-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac:Remove RTEMS_CHECK_CPU.
|
||||
|
||||
2003-09-15 Jennifer Averett <jennifer@OARcorp.com>
|
||||
|
||||
* psxhdrs/sync01.c, psxhdrs/sync02.c: Correct fd creation
|
||||
|
||||
2003-09-04 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psx01/init.c, psx01/system.h, psx01/task.c, psx02/init.c,
|
||||
psx02/system.h, psx02/task.c, psx03/init.c, psx03/system.h,
|
||||
psx03/task.c, psx04/init.c, psx04/system.h, psx04/task1.c,
|
||||
psx04/task2.c, psx04/task3.c, psx05/init.c, psx05/system.h,
|
||||
psx05/task.c, psx05/task2.c, psx05/task3.c, psx06/init.c,
|
||||
psx06/system.h, psx06/task.c, psx06/task2.c, psx07/init.c,
|
||||
psx07/system.h, psx07/task.c, psx08/init.c, psx08/system.h,
|
||||
psx08/task1.c, psx08/task2.c, psx08/task3.c, psx09/init.c,
|
||||
psx09/system.h, psx10/init.c, psx10/system.h, psx10/task.c,
|
||||
psx10/task2.c, psx10/task3.c, psx11/init.c, psx11/system.h,
|
||||
psx11/task.c, psx12/init.c, psx12/system.h, psx12/task.c,
|
||||
psx13/main.c, psx13/test.c, psxcancel/init.c, psxfile01/main.c,
|
||||
psxfile01/test.c, psxhdrs/clock01.c, psxhdrs/clock02.c,
|
||||
psxhdrs/clock03.c, psxhdrs/clock04.c, psxhdrs/clock05.c,
|
||||
psxhdrs/clock06.c, psxhdrs/cond01.c, psxhdrs/cond02.c,
|
||||
psxhdrs/cond03.c, psxhdrs/cond04.c, psxhdrs/cond05.c,
|
||||
psxhdrs/cond06.c, psxhdrs/cond07.c, psxhdrs/cond08.c,
|
||||
psxhdrs/cond09.c, psxhdrs/cond10.c, psxhdrs/key01.c, psxhdrs/key02.c,
|
||||
psxhdrs/key03.c, psxhdrs/key04.c, psxhdrs/mutex01.c,
|
||||
psxhdrs/mutex02.c, psxhdrs/mutex03.c, psxhdrs/mutex04.c,
|
||||
psxhdrs/mutex05.c, psxhdrs/mutex06.c, psxhdrs/mutex07.c,
|
||||
psxhdrs/mutex08.c, psxhdrs/mutex09.c, psxhdrs/mutex10.c,
|
||||
psxhdrs/mutex11.c, psxhdrs/mutex12.c, psxhdrs/mutex13.c,
|
||||
psxhdrs/mutex14.c, psxhdrs/mutex15.c, psxhdrs/mutex16.c,
|
||||
psxhdrs/proc01.c, psxhdrs/proc02.c, psxhdrs/proc03.c,
|
||||
psxhdrs/proc04.c, psxhdrs/proc05.c, psxhdrs/proc06.c,
|
||||
psxhdrs/proc07.c, psxhdrs/proc08.c, psxhdrs/proc09.c,
|
||||
psxhdrs/proc10.c, psxhdrs/proc11.c, psxhdrs/proc12.c,
|
||||
psxhdrs/proc13.c, psxhdrs/proc14.c, psxhdrs/pthread01.c,
|
||||
psxhdrs/pthread02.c, psxhdrs/pthread03.c, psxhdrs/pthread04.c,
|
||||
psxhdrs/pthread05.c, psxhdrs/pthread06.c, psxhdrs/pthread07.c,
|
||||
psxhdrs/pthread08.c, psxhdrs/pthread09.c, psxhdrs/pthread10.c,
|
||||
psxhdrs/pthread11.c, psxhdrs/pthread12.c, psxhdrs/pthread13.c,
|
||||
psxhdrs/pthread14.c, psxhdrs/pthread15.c, psxhdrs/pthread16.c,
|
||||
psxhdrs/pthread17.c, psxhdrs/pthread18.c, psxhdrs/pthread19.c,
|
||||
psxhdrs/pthread20.c, psxhdrs/pthread21.c, psxhdrs/pthread22.c,
|
||||
psxhdrs/pthread23.c, psxhdrs/pthread24.c, psxhdrs/pthread25.c,
|
||||
psxhdrs/pthread26.c, psxhdrs/pthread27.c, psxhdrs/pthread28.c,
|
||||
psxhdrs/pthread29.c, psxhdrs/pthread30.c, psxhdrs/pthread31.c,
|
||||
psxhdrs/pthread32.c, psxhdrs/pthread33.c, psxhdrs/pthread34.c,
|
||||
psxhdrs/pthread35.c, psxhdrs/pthread36.c, psxhdrs/sched01.c,
|
||||
psxhdrs/sched02.c, psxhdrs/sched03.c, psxhdrs/sched04.c,
|
||||
psxhdrs/sched05.c, psxhdrs/sched06.c, psxhdrs/sched07.c,
|
||||
psxhdrs/sched08.c, psxhdrs/signal01.c, psxhdrs/signal02.c,
|
||||
psxhdrs/signal03.c, psxhdrs/signal04.c, psxhdrs/signal05.c,
|
||||
psxhdrs/signal06.c, psxhdrs/signal07.c, psxhdrs/signal08.c,
|
||||
psxhdrs/signal09.c, psxhdrs/signal10.c, psxhdrs/signal11.c,
|
||||
psxhdrs/signal12.c, psxhdrs/signal13.c, psxhdrs/signal14.c,
|
||||
psxhdrs/signal15.c, psxhdrs/signal16.c, psxhdrs/signal17.c,
|
||||
psxhdrs/signal18.c, psxhdrs/signal19.c, psxhdrs/signal20.c,
|
||||
psxhdrs/signal21.c, psxhdrs/signal22.c, psxhdrs/signal23.c,
|
||||
psxhdrs/sync01.c, psxhdrs/sync02.c, psxhdrs/sync03.c,
|
||||
psxhdrs/time01.c, psxhdrs/time02.c, psxhdrs/time03.c,
|
||||
psxhdrs/time04.c, psxhdrs/time05.c, psxhdrs/time06.c,
|
||||
psxhdrs/time07.c, psxhdrs/time08.c, psxhdrs/time09.c,
|
||||
psxhdrs/time10.c, psxhdrs/time11.c, psxhdrs/time12.c,
|
||||
psxhdrs/time13.c, psxhdrs/timer01.c, psxhdrs/timer02.c,
|
||||
psxhdrs/timer03.c, psxhdrs/timer04.c, psxhdrs/timer05.c,
|
||||
psxhdrs/timer06.c, psxhdrs/timer07.c, psxmsgq01/init.c,
|
||||
psxmsgq01/system.h, psxsem01/system.h, psxstat/main.c,
|
||||
psxstat/test.c, psxtime/main.c, psxtime/test.c, psxtimer/psxtimer.c,
|
||||
psxtimer/system.h: URL for license changed.
|
||||
|
||||
2003-09-04 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 462/tests
|
||||
* psxhdrs/Makefile.am: Added ualarm.c
|
||||
* psxhdrs/signal23.c: New file.
|
||||
|
||||
2003-09-03 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 463/tests
|
||||
PR 465/tests
|
||||
* psxhdrs/Makefile.am: Add new test cases.
|
||||
* psxhdrs/sync01.c, psxhdrs/sync02.c, psxhdrs/sync03.c,
|
||||
psxhdrs/timer07.c: New files.
|
||||
|
||||
2003-08-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Reflect having moved aclocal/.
|
||||
|
||||
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Reflect having moved automake/.
|
||||
* include/Makefile.am: Reflect having moved automake/.
|
||||
* psx01/Makefile.am: Reflect having moved automake/.
|
||||
* psx02/Makefile.am: Reflect having moved automake/.
|
||||
* psx03/Makefile.am: Reflect having moved automake/.
|
||||
* psx04/Makefile.am: Reflect having moved automake/.
|
||||
* psx05/Makefile.am: Reflect having moved automake/.
|
||||
* psx06/Makefile.am: Reflect having moved automake/.
|
||||
* psx07/Makefile.am: Reflect having moved automake/.
|
||||
* psx08/Makefile.am: Reflect having moved automake/.
|
||||
* psx09/Makefile.am: Reflect having moved automake/.
|
||||
* psx10/Makefile.am: Reflect having moved automake/.
|
||||
* psx11/Makefile.am: Reflect having moved automake/.
|
||||
* psx12/Makefile.am: Reflect having moved automake/.
|
||||
* psx13/Makefile.am: Reflect having moved automake/.
|
||||
* psxcancel/Makefile.am: Reflect having moved automake/.
|
||||
* psxchroot01/Makefile.am: Reflect having moved automake/.
|
||||
* psxfile01/Makefile.am: Reflect having moved automake/.
|
||||
* psxhdrs/Makefile.am: Reflect having moved automake/.
|
||||
* psxmount/Makefile.am: Reflect having moved automake/.
|
||||
* psxmsgq01/Makefile.am: Reflect having moved automake/.
|
||||
* psxreaddir/Makefile.am: Reflect having moved automake/.
|
||||
* psxsem01/Makefile.am: Reflect having moved automake/.
|
||||
* psxstat/Makefile.am: Reflect having moved automake/.
|
||||
* psxtime/Makefile.am: Reflect having moved automake/.
|
||||
* psxtimer/Makefile.am: Reflect having moved automake/.
|
||||
|
||||
2003-08-14 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 408/filesystem
|
||||
* psx13/test.c: Added very rudimentary test of sync() service.
|
||||
|
||||
2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Use rtems-bugs@rtems.com as bug report email address.
|
||||
|
||||
2003-06-12 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxchroot01/test.c, psxreaddir/test.c: Removed warnings.
|
||||
|
||||
2003-05-29 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psx02/init.c, psx04/init.c, psx13/test.c, psxchroot01/test.c,
|
||||
psxhdrs/pthread07.c, psxmsgq01/init.c, psxreaddir/test.c,
|
||||
psxtimer/psxtimer.c: Removed warnings.
|
||||
|
||||
2003-05-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Remove CC_CFLAGS_DEBUG_V.
|
||||
CC_CFLAGS_DEFAULT (obsolete).
|
||||
|
||||
2003-05-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Remove CC_CFLAGS_PROFILE_V.
|
||||
Remove CC_LDFLAGS_PROFILE_V.
|
||||
|
||||
2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Remove AC_CONFIG_AUX_DIR.
|
||||
|
||||
2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: AM_INIT_AUTOMAKE([1.7.2]).
|
||||
|
||||
2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: AC_PREREQ(2.57).
|
||||
|
||||
2002-11-14 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psx01/psx01.scn, psx02/psx02.scn, psx03/psx03.scn, psx04/psx04.scn,
|
||||
psx05/psx05.scn, psx06/psx06.scn, psx07/psx07.scn, psx08/psx08.scn,
|
||||
psx09/psx09.scn, psx10/psx10.scn, psx11/psx11.scn, psx12/psx12.scn:
|
||||
Per PR239 update the IDs in the various screens.
|
||||
|
||||
2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* .cvsignore: Reformat.
|
||||
Add autom4te*cache.
|
||||
Remove autom4te.cache.
|
||||
|
||||
2002-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* psx01/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx02/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx03/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx04/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx05/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx06/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx07/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx08/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx09/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx10/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx11/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx12/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psx13/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxcancel/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxchroot01/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxfile01/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxhdrs/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxmount/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxmsgq01/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxreaddir/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxsem01/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxstat/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxtime/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
* psxtimer/Makefile.am: Use .$(OBJEXT) instead of .o.
|
||||
|
||||
2002-08-01 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* Per PR47 add support for buffered test output. This involved
|
||||
adding defines to redirect output to a buffer and dump it when
|
||||
full, at "test pause", and at exit. To avoid problems when redefining
|
||||
exit(), all tests were modified to call rtems_test_exit().
|
||||
Some tests, notable psxtests, had to be modified to include
|
||||
the standard test macro .h file (pmacros.h or tmacros.h) to
|
||||
enable this support.
|
||||
* include/pmacros.h, psx01/task.c, psx02/init.c, psx02/task.c,
|
||||
psx03/init.c, psx04/init.c, psx05/init.c, psx06/init.c, psx07/init.c,
|
||||
psx08/task3.c, psx09/init.c, psx10/init.c, psx11/init.c,
|
||||
psx12/init.c, psx13/Makefile.am, psx13/main.c, psx13/test.c,
|
||||
psxcancel/init.c, psxchroot01/Makefile.am, psxchroot01/main.c,
|
||||
psxchroot01/test.c, psxfile01/Makefile.am, psxfile01/main.c,
|
||||
psxfile01/test.c, psxfile01/test_cat.c, psxfile01/test_extend.c,
|
||||
psxfile01/test_write.c, psxmount/Makefile.am, psxmount/main.c,
|
||||
psxmount/test.c, psxmsgq01/init.c, psxreaddir/Makefile.am,
|
||||
psxreaddir/main.c, psxreaddir/test.c, psxsem01/init.c,
|
||||
psxstat/Makefile.am, psxstat/main.c, psxstat/test.c, psxtime/main.c,
|
||||
psxtime/test.c, psxtimer/psxtimer.c: Modified.
|
||||
|
||||
2002-07-05 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxcancel/Makefile.am, psxcancel/init.c, psxcancel/psxcancel.scn:
|
||||
Updated as part of PR164 which reported problems with the RTEMS
|
||||
implementation of pthread_cancel.
|
||||
|
||||
2001-04-26 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxmsgq01/init.c: Reflect changes made to address PR81 that
|
||||
reworked POSIX message queues to add a descriptor separate from
|
||||
the underlying message queue. This allows non-blocking to follow
|
||||
the "open" not the underlying queue.
|
||||
|
||||
2002-04-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac: Remove ENABLE_GCC28.
|
||||
|
||||
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.ac:
|
||||
AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS).
|
||||
AM_INIT_AUTOMAKE([no-define foreign 1.6]).
|
||||
* Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* include/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx01/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx02/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx03/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx04/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx05/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx06/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx07/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx08/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx09/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx10/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx11/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx12/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psx13/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxcancel/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxchroot01/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxfile01/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxhdrs/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxmount/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxmsgq01/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxreaddir/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxsem01/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxstat/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxtime/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
* psxtimer/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||
|
||||
2001-11-07 Jennifer Averett <jennifer@OARcorp.com>
|
||||
|
||||
Reported by Ibragimov Ilya <ibr@oktet.ru> and tracked as PR63.
|
||||
* psxstat/test.c: Fix test ENOTDIR to correspond to chdir() change.
|
||||
Since we check permissions before evaluating enough to see if it
|
||||
a regular file or directory, this hack is needed to make the regular
|
||||
file executable.
|
||||
|
||||
2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* .cvsignore: Add autom4te.cache for autoconf > 2.52.
|
||||
* configure.in: Remove.
|
||||
* configure.ac: New file, generated from configure.in by autoupdate.
|
||||
|
||||
2001-09-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* psxtests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy.
|
||||
|
||||
2001-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* psx01/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx11/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxcancel/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx02/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx13/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxtime/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxchroot01/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx07/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxmsgq01/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxtimer/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx10/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx08/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxhdrs/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxfile01/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx05/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx09/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxmount/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxstat/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx12/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxreaddir/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psxsem01/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx03/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx04/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
* psx06/Makefile.am: include leaf.am instead of leaf.cfg.
|
||||
|
||||
2001-08-09 Fernando-Ruiz Casas <correo@fernando-ruiz.com>
|
||||
|
||||
* psxchroot01/.cvsignore, psxchroot01/Makefile.am, psxchroot01/main.c,
|
||||
psxchroot01/psxchroot01.scn, psxchroot01/test.c: Implemented the
|
||||
psxchroot01 test.
|
||||
|
||||
2001-05-25 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* Added once version of psxchroot01 test for user review.
|
||||
* psxchroot01: New directory.
|
||||
* psxchroot01/Makefile.am, psxchroot01/main.c, psxchroot01/test.c,
|
||||
psxchroot01/psxchroot01.scn, psxchroot01/.cvsignore: New files.
|
||||
* configure.in, Makefile.am: Modified to reflect above.
|
||||
|
||||
2001-05-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]).
|
||||
|
||||
2001-04-24 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxfile01/test.c, psxfile01/psxfile01.scn : Added test case for
|
||||
open, write, reopen, append twice from Andrew Bythell
|
||||
<abythell@nortelnetworks.com> that tripped an initialization
|
||||
problem in the IMFS.
|
||||
|
||||
2001-04-20 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psx04/init.c, psx04/psx04.scn, psx07/init.c, psx07/psx07.scn,
|
||||
psxfile01/psxfile01.scn, psxmsgq01/psxmsgq01.scn,
|
||||
psxreaddir/test.c, psxstat/psxstat.scn, psxstat/test.c,
|
||||
psxtime/psxtime.scn, psxtimer/psxtimer.scn:
|
||||
Various adjustments so test output matches screens more reliably.
|
||||
|
||||
2001-01-25 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psx01/psx01.scn: Corrected to reflect clock_getres() now working.
|
||||
|
||||
2000-11-17 Jennifer Averett <jennifer@OARcorp.com>
|
||||
|
||||
* psxstat/test.c, psxstat/psxstat.scn: Forced inode numbers
|
||||
to remain consistant across platforms and bsps by forcing
|
||||
a mount point in front of all paths.
|
||||
|
||||
2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
|
||||
|
||||
* psxmount/test.c, psxmount/psxmount.scn: Improve output to report
|
||||
expected error condition in one case.
|
||||
* psxreaddir/test.c, psxreaddir.scn: Added test cases to exercise
|
||||
readdir() of root of mounted filesystem. Also corrected the screen
|
||||
file for some mistakes noticed in this effort.
|
||||
|
||||
2000-11-13 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxmount/psxmount.scn, psxmount/test.c: Correct spelling.
|
||||
|
||||
2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
|
||||
|
||||
2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal.
|
||||
|
||||
2000-10-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
||||
Switch to GNU canonicalization.
|
||||
* psxtests.am: Remove DEFS.
|
||||
|
||||
2000-10-24 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* psxmount/test.c, psxstat/test.c: Include <imfs.h> to get IMFS_ops.
|
||||
It was formerly incorrectly prototyped in <libio.h>.
|
||||
|
||||
2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* psx01/Makefile.am, psx02/Makefile.am, psx03/Makefile.am,
|
||||
psx04/Makefile.am, psx05/Makefile.am, psx06/Makefile.am,
|
||||
psx07/Makefile.am, psx08/Makefile.am, psx09/Makefile.am,
|
||||
psx10/Makefile.am, psx11/Makefile.am, psx12/Makefile.am,
|
||||
psx13/Makefile.am, psxcancel/Makefile.am, psxfile01/Makefile.am,
|
||||
psxhdrs/Makefile.am, psxmount/Makefile.am, psxmsgq01/Makefile.am,
|
||||
psxreaddir/Makefile.am, psxsem01/Makefile.am, psxstat/Makefile.am,
|
||||
psxtime/Makefile.am, psxtimer/Makefile.am: Include compile.am
|
||||
|
||||
2000-08-31 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
* psx01/Makefile.am, psx02/Makefile.am, psx03/Makefile.am,
|
||||
psx04/Makefile.am, psx05/Makefile.am, psx06/Makefile.am,
|
||||
psx07/Makefile.am, psx08/Makefile.am, psx09/Makefile.am,
|
||||
psx10/Makefile.am, psx11/Makefile.am, psx11/Makefile.am,
|
||||
psx12/Makefile.am, psxcancel/Makefile.am, psxmsgq01/Makefile.am,
|
||||
psxsem01/Makefile.am, psxsem01/Makefile.am, psxtimer/Makefile.am:
|
||||
Use AM_CPPFLAGS += instead of AM_CPPFLAGS =
|
||||
|
||||
2000-08-10 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* ChangeLog: New file.
|
||||
@@ -1,21 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
ACLOCAL_AMFLAGS = -I ../aclocal
|
||||
|
||||
SHARED_DIRS =
|
||||
|
||||
POSIX_DIRS = include psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 \
|
||||
psx09 psx10 psx11 psx12 psxtime psxtimer psxcancel psxmsgq01 psxsem01
|
||||
|
||||
POSIX_FILES_DIRS = psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01
|
||||
|
||||
UNUSED_DIRS =
|
||||
|
||||
SUBDIRS = $(SHARED_DIRS) $(POSIX_DIRS) $(POSIX_FILES_DIRS) $(UNUSED_DIRS)
|
||||
|
||||
EXTRA_DIST = psxtests.am
|
||||
|
||||
include $(top_srcdir)/../automake/subdirs.am
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,58 +0,0 @@
|
||||
## Process this file with autoconf to produce a configure script.
|
||||
##
|
||||
## $Id$
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([rtems-c-src-tests-psxtests],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
|
||||
AC_CONFIG_SRCDIR([psx01])
|
||||
RTEMS_TOP(../../../..)
|
||||
|
||||
RTEMS_CANONICAL_TARGET_CPU
|
||||
|
||||
AM_INIT_AUTOMAKE([no-define foreign 1.7.2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
RTEMS_ENABLE_BARE
|
||||
|
||||
RTEMS_ENV_RTEMSBSP
|
||||
|
||||
RTEMS_PROJECT_ROOT
|
||||
|
||||
RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
|
||||
|
||||
RTEMS_CANONICALIZE_TOOLS
|
||||
|
||||
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
|
||||
|
||||
AC_SUBST(BARE_CPU_CFLAGS)
|
||||
AC_SUBST(BARE_CPU_MODEL)
|
||||
|
||||
# Explicitly list all Makefiles here
|
||||
AC_CONFIG_FILES([Makefile
|
||||
include/Makefile
|
||||
psx01/Makefile
|
||||
psx02/Makefile
|
||||
psx03/Makefile
|
||||
psx04/Makefile
|
||||
psx05/Makefile
|
||||
psx06/Makefile
|
||||
psx07/Makefile
|
||||
psx08/Makefile
|
||||
psx09/Makefile
|
||||
psx10/Makefile
|
||||
psx11/Makefile
|
||||
psx12/Makefile
|
||||
psx13/Makefile
|
||||
psxcancel/Makefile
|
||||
psxchroot01/Makefile
|
||||
psxfile01/Makefile
|
||||
psxhdrs/Makefile
|
||||
psxmount/Makefile
|
||||
psxmsgq01/Makefile
|
||||
psxreaddir/Makefile
|
||||
psxsem01/Makefile
|
||||
psxstat/Makefile
|
||||
psxtime/Makefile
|
||||
psxtimer/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,8 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
noinst_HEADERS = pmacros.h
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_TEST_MACROS_h
|
||||
#define __POSIX_TEST_MACROS_h
|
||||
|
||||
#include <bsp.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <buffer_test_io.h>
|
||||
|
||||
/*
|
||||
* These help manipulate the "struct tm" form of time
|
||||
*/
|
||||
|
||||
#define TM_SUNDAY 0
|
||||
#define TM_MONDAY 1
|
||||
#define TM_TUESDAY 2
|
||||
#define TM_WEDNESDAY 3
|
||||
#define TM_THURSDAY 4
|
||||
#define TM_FRIDAY 5
|
||||
#define TM_SATURDAY 6
|
||||
|
||||
#define TM_JANUARY 0
|
||||
#define TM_FEBRUARY 1
|
||||
#define TM_MARCH 2
|
||||
#define TM_APRIL 3
|
||||
#define TM_MAY 4
|
||||
#define TM_JUNE 5
|
||||
#define TM_JULY 6
|
||||
#define TM_AUGUST 7
|
||||
#define TM_SEPTEMBER 8
|
||||
#define TM_OCTOBER 10
|
||||
#define TM_NOVEMBER 12
|
||||
#define TM_DECEMBER 12
|
||||
|
||||
#ifndef build_time
|
||||
#define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \
|
||||
{ (TM)->tm_year = YR; \
|
||||
(TM)->tm_mon = MON; \
|
||||
(TM)->tm_mday = DAY; \
|
||||
(TM)->tm_wday = WEEKDAY; \
|
||||
(TM)->tm_hour = HR; \
|
||||
(TM)->tm_min = MIN; \
|
||||
(TM)->tm_sec = SEC; }
|
||||
#endif
|
||||
|
||||
#define set_time( WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \
|
||||
do { \
|
||||
struct tm tm; \
|
||||
struct timespec tv; \
|
||||
int status; \
|
||||
\
|
||||
build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \
|
||||
\
|
||||
tv.tv_sec = mktime( &tm ); \
|
||||
tv.tv_nsec = 0; \
|
||||
assert( tv.tv_sec != -1 ); \
|
||||
\
|
||||
status = clock_settime( CLOCK_REALTIME, &tv ); \
|
||||
assert( !status ); \
|
||||
} while ( 0 )
|
||||
|
||||
#define print_current_time(s1, s2) \
|
||||
do { \
|
||||
char _time_buffer[32]; \
|
||||
int _status; \
|
||||
struct timespec _tv; \
|
||||
\
|
||||
_status = clock_gettime( CLOCK_REALTIME, &_tv ); \
|
||||
assert( !_status ); \
|
||||
\
|
||||
(void) ctime_r( &_tv.tv_sec, _time_buffer ); \
|
||||
_time_buffer[ strlen( _time_buffer ) - 1 ] = 0; \
|
||||
printf( "%s%s%s\n", s1, _time_buffer, s2 ); \
|
||||
fflush(stdout); \
|
||||
} while ( 0 )
|
||||
|
||||
#define empty_line() puts( "" )
|
||||
|
||||
#endif
|
||||
|
||||
/* end of file */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx01
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,242 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <sched.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
struct timespec tv;
|
||||
struct timespec tr;
|
||||
int status;
|
||||
int priority;
|
||||
pthread_t thread_id;
|
||||
time_t seconds;
|
||||
time_t seconds1;
|
||||
time_t remaining;
|
||||
struct tm tm;
|
||||
struct utsname uts;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 1 ***" );
|
||||
|
||||
build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* print some system information */
|
||||
|
||||
puts( "Init: uname - EFAULT (invalid uts pointer argument)" );
|
||||
status = uname( NULL );
|
||||
assert( status == -1 );
|
||||
assert( errno == EFAULT );
|
||||
|
||||
status = uname( &uts );
|
||||
assert( !status );
|
||||
printf( "Init: uts.sysname: %s\n", uts.sysname );
|
||||
printf( "Init: uts.nodename: %s\n", uts.nodename );
|
||||
printf( "Init: uts.release: %s\n", uts.release );
|
||||
printf( "Init: uts.version: %s\n", uts.version );
|
||||
printf( "Init: uts.machine: %s\n", uts.machine );
|
||||
puts("");
|
||||
|
||||
/* error cases in clock_gettime and clock_settime */
|
||||
|
||||
puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
|
||||
status = clock_settime( -1, &tv );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_settime - EINVAL (invalid clockid)" );
|
||||
status = clock_settime( -1, &tv );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
/* exercise clock_getres */
|
||||
|
||||
puts( "Init: clock_getres - EINVAL (invalid clockid)" );
|
||||
status = clock_getres( -1, &tv );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_getres - EINVAL (NULL resolution)" );
|
||||
status = clock_getres( CLOCK_REALTIME, NULL );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_getres - SUCCESSFUL" );
|
||||
status = clock_getres( CLOCK_REALTIME, &tv );
|
||||
printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
|
||||
assert( !status );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
tv.tv_sec = mktime( &tm );
|
||||
assert( tv.tv_sec != -1 );
|
||||
|
||||
tv.tv_nsec = 0;
|
||||
|
||||
/* now set the time of day */
|
||||
|
||||
empty_line();
|
||||
|
||||
printf( asctime( &tm ) );
|
||||
puts( "Init: clock_settime - SUCCESSFUL" );
|
||||
status = clock_settime( CLOCK_REALTIME, &tv );
|
||||
assert( !status );
|
||||
|
||||
printf( asctime( &tm ) );
|
||||
printf( ctime( &tv.tv_sec ) );
|
||||
|
||||
/* use sleep to delay */
|
||||
|
||||
remaining = sleep( 3 );
|
||||
assert( !remaining );
|
||||
|
||||
/* print new times to make sure it has changed and we can get the realtime */
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &tv );
|
||||
assert( !status );
|
||||
|
||||
printf( ctime( &tv.tv_sec ) );
|
||||
|
||||
seconds = time( NULL );
|
||||
printf( ctime( &seconds ) );
|
||||
|
||||
/* just to have the value copied out through the parameter */
|
||||
|
||||
seconds = time( &seconds1 );
|
||||
assert( seconds == seconds1 );
|
||||
|
||||
/* check the time remaining */
|
||||
|
||||
printf( "Init: seconds remaining (%d)\n", (int)remaining );
|
||||
assert( !remaining );
|
||||
|
||||
/* error cases in nanosleep */
|
||||
|
||||
empty_line();
|
||||
puts( "Init: nanosleep - EINVAL (NULL time)" );
|
||||
status = nanosleep ( NULL, &tr );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_nsec = TOD_NANOSECONDS_PER_SECOND * 2;
|
||||
puts( "Init: nanosleep - EINVAL (too many nanoseconds)" );
|
||||
status = nanosleep ( &tv, &tr );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
/* this is actually a small delay or yield */
|
||||
tv.tv_sec = -1;
|
||||
tv.tv_nsec = 0;
|
||||
puts( "Init: nanosleep - negative seconds small delay " );
|
||||
status = nanosleep ( &tv, &tr );
|
||||
assert( !status );
|
||||
|
||||
/* use nanosleep to yield */
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_nsec = 0;
|
||||
|
||||
puts( "Init: nanosleep - yield" );
|
||||
status = nanosleep ( &tv, &tr );
|
||||
assert( !status );
|
||||
assert( !tr.tv_sec );
|
||||
assert( !tr.tv_nsec );
|
||||
|
||||
/* use nanosleep to delay */
|
||||
|
||||
tv.tv_sec = 3;
|
||||
tv.tv_nsec = 500000;
|
||||
|
||||
puts( "Init: nanosleep - 3.05 seconds" );
|
||||
status = nanosleep ( &tv, &tr );
|
||||
assert( !status );
|
||||
|
||||
/* print the current real time again */
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &tv );
|
||||
assert( !status );
|
||||
|
||||
printf( ctime( &tv.tv_sec ) );
|
||||
|
||||
/* check the time remaining */
|
||||
|
||||
printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
|
||||
assert( !tr.tv_sec && !tr.tv_nsec );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init: ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* exercise get minimum priority */
|
||||
|
||||
priority = sched_get_priority_min( SCHED_FIFO );
|
||||
printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority );
|
||||
assert( priority != -1 );
|
||||
|
||||
puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" );
|
||||
priority = sched_get_priority_min( -1 );
|
||||
assert( priority == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
/* exercise get maximum priority */
|
||||
|
||||
priority = sched_get_priority_max( SCHED_FIFO );
|
||||
printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority );
|
||||
assert( priority != -1 );
|
||||
|
||||
puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" );
|
||||
priority = sched_get_priority_min( -1 );
|
||||
assert( priority == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
/* print the round robin time quantum */
|
||||
|
||||
status = sched_rr_get_interval( getpid(), &tr );
|
||||
printf(
|
||||
"Init: Round Robin quantum is %ld seconds, %ld nanoseconds\n",
|
||||
tr.tv_sec,
|
||||
tr.tv_nsec
|
||||
);
|
||||
assert( !status );
|
||||
|
||||
/* create a thread */
|
||||
|
||||
puts( "Init: pthread_create - SUCCESSFUL" );
|
||||
status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* too may threads error */
|
||||
|
||||
puts( "Init: pthread_create - EAGAIN (too many threads)" );
|
||||
status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
|
||||
assert( status == EAGAIN );
|
||||
|
||||
puts( "Init: sched_yield to Task_1" );
|
||||
status = sched_yield();
|
||||
assert( !status );
|
||||
|
||||
/* switch to Task_1 */
|
||||
|
||||
/* exit this thread */
|
||||
|
||||
puts( "Init: pthread_exit" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Task_1 */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
*** POSIX TEST 1 ***
|
||||
Init: uname - EFAULT (invalid uts pointer argument)
|
||||
Init: uts.sysname: RTEMS
|
||||
Init: uts.nodename: Node 1
|
||||
Init: uts.release: rtems-VERSION
|
||||
NOTE: VERSION will vary.
|
||||
Init: uts.version:
|
||||
Init: uts.machine: CPU/CPU Model
|
||||
NOTE: CPU/CPU Model will vary.
|
||||
Init: clock_gettime - EINVAL (invalid clockid)
|
||||
Init: clock_settime - EINVAL (invalid clockid)
|
||||
Init: clock_getres - EINVAL (invalid clockid)
|
||||
Init: clock_getres - EINVAL (NULL resolution)
|
||||
Init: clock_getres - SUCCESSFUL
|
||||
Init: resolution = sec (0), nsec (10000000)
|
||||
Fri May 24 11:05:00 1996
|
||||
Init: clock_settime - SUCCESSFUL
|
||||
Fri May 24 11:05:00 1996
|
||||
Fri May 24 11:05:00 1996
|
||||
Fri May 24 11:05:03 1996
|
||||
Fri May 24 11:05:03 1996
|
||||
Init: seconds remaining (0)
|
||||
|
||||
Init: nanosleep - EINVAL (NULL time)
|
||||
Init: nanosleep - EINVAL (too many nanoseconds)
|
||||
Init: nanosleep - negative seconds small delay
|
||||
Init: nanosleep - yield
|
||||
Init: nanosleep - 3.05 seconds
|
||||
Fri May 24 11:05:06 1996
|
||||
Init: sec (0), nsec (0) remaining
|
||||
Init: ID is 0x0b010001
|
||||
Init: sched_get_priority_min (SCHED_FIFO) -- 1
|
||||
Init: sched_get_priority_min -- EINVAL (invalid policy)
|
||||
Init: sched_get_priority_max (SCHED_FIFO) -- 254
|
||||
Init: sched_get_priority_min -- EINVAL (invalid policy)
|
||||
Init: Round Robin quantum is 0 seconds, 500000000 nanoseconds
|
||||
Init: pthread_create - SUCCESSFUL
|
||||
Init: pthread_create - EAGAIN (too many threads)
|
||||
Init: sched_yield to Task_1
|
||||
Task_1: sched_yield to Init
|
||||
Init: pthread_exit
|
||||
|
||||
Task_1: ID is 0x0b010002
|
||||
Task_1: pthread_equal - match case passed
|
||||
Task_1: pthread_equal - different case passed
|
||||
Task_1: pthread_equal - first id bad
|
||||
Task_1: pthread_equal - second id bad
|
||||
Task_1: pthread_once - EINVAL (NULL once_control)
|
||||
Task_1: pthread_once - EINVAL (NULL init_routine)
|
||||
Task_1: pthread_once - SUCCESSFUL (init_routine executes)
|
||||
Test_init_routine: invoked
|
||||
Task_1: pthread_once - SUCCESSFUL (init_routine does not execute)
|
||||
*** END OF POSIX TEST 1 ***
|
||||
@@ -1,53 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,93 +0,0 @@
|
||||
/* Task_1_through_3
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void Test_init_routine( void )
|
||||
{
|
||||
puts( "Test_init_routine: invoked" );
|
||||
}
|
||||
|
||||
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
|
||||
puts( "Task_1: sched_yield to Init" );
|
||||
status = sched_yield();
|
||||
assert( !status );
|
||||
|
||||
/* switch to Task_1 */
|
||||
|
||||
/* now do some real testing */
|
||||
|
||||
empty_line();
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Task_id = pthread_self();
|
||||
printf( "Task_1: ID is 0x%08x\n", Task_id );
|
||||
|
||||
/* exercise pthread_equal */
|
||||
|
||||
status = pthread_equal( Task_id, Task_id );
|
||||
if ( status )
|
||||
puts( "Task_1: pthread_equal - match case passed" );
|
||||
assert( status );
|
||||
|
||||
status = pthread_equal( Init_id, Task_id );
|
||||
if ( !status )
|
||||
puts( "Task_1: pthread_equal - different case passed" );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_equal - first id bad" );
|
||||
status = pthread_equal( -1, Task_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_equal - second id bad" );
|
||||
status = pthread_equal( Init_id, -1 );
|
||||
assert( !status );
|
||||
|
||||
/* exercise pthread_once */
|
||||
|
||||
puts( "Task_1: pthread_once - EINVAL (NULL once_control)" );
|
||||
status = pthread_once( NULL, Test_init_routine );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Task_1: pthread_once - EINVAL (NULL init_routine)" );
|
||||
status = pthread_once( &once, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Task_1: pthread_once - SUCCESSFUL (init_routine executes)" );
|
||||
status = pthread_once( &once, Test_init_routine );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_once - SUCCESSFUL (init_routine does not execute)" );
|
||||
status = pthread_once( &once, Test_init_routine );
|
||||
assert( !status );
|
||||
|
||||
puts( "*** END OF POSIX TEST 1 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx02
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
)
|
||||
{
|
||||
Signal_count++;
|
||||
printf(
|
||||
"Signal: %d caught by 0x%x (%d)\n",
|
||||
(int) signo,
|
||||
(unsigned int) pthread_self(),
|
||||
Signal_count
|
||||
);
|
||||
Signal_occurred = 1;
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct timespec tv;
|
||||
struct timespec tr;
|
||||
struct sigaction act;
|
||||
sigset_t mask;
|
||||
sigset_t pending_set;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 2 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* install a signal handler */
|
||||
|
||||
status = sigemptyset( &act.sa_mask );
|
||||
assert( !status );
|
||||
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
/* simple signal to self */
|
||||
|
||||
Signal_count = 0;
|
||||
Signal_occurred = 0;
|
||||
|
||||
status = pthread_kill( Init_id, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
Signal_occurred = 0;
|
||||
|
||||
/* now block the signal, send it, see if it is pending, and unblock it */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Init: Block SIGUSR1\n" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
|
||||
printf( "Init: send SIGUSR1 to self\n" );
|
||||
status = pthread_kill( Init_id, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
printf( "Init: Unblock SIGUSR1\n" );
|
||||
status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread */
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_1_through_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
/*
|
||||
* Loop for 5 seconds seeing how many signals we catch
|
||||
*/
|
||||
|
||||
tr.tv_sec = 5;
|
||||
tr.tv_nsec = 0;
|
||||
|
||||
do {
|
||||
tv = tr;
|
||||
|
||||
Signal_occurred = 0;
|
||||
|
||||
status = nanosleep ( &tv, &tr );
|
||||
|
||||
if ( status == -1 ) {
|
||||
assert( errno == EINTR );
|
||||
assert( tr.tv_nsec || tr.tv_sec );
|
||||
} else if ( !status ) {
|
||||
assert( !tr.tv_nsec && !tr.tv_sec );
|
||||
}
|
||||
|
||||
printf(
|
||||
"Init: signal was %sprocessed with %d:%d time remaining\n",
|
||||
(Signal_occurred) ? "" : "not ",
|
||||
(int) tr.tv_sec,
|
||||
(int) tr.tv_nsec
|
||||
);
|
||||
|
||||
} while ( tr.tv_sec || tr.tv_nsec );
|
||||
|
||||
/* exit this thread */
|
||||
|
||||
puts( "*** END OF POSIX TEST 2 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
*** POSIX TEST 2 ***
|
||||
Init's ID is 0x0b010001
|
||||
Signal: 16 caught by 0xc010001 (1)
|
||||
Init: Block SIGUSR1
|
||||
Init: Signals pending 0x00000000
|
||||
Init: send SIGUSR1 to self
|
||||
Init: Signals pending 0x00008000
|
||||
Init: Unblock SIGUSR1
|
||||
Signal: 16 caught by 0xc010001 (2)
|
||||
Task1: Fri May 24 11:05:00 1996
|
||||
Signal: 16 caught by 0xc010001 (3)
|
||||
Init: signal was processed with 5:0 time remaining
|
||||
Task1: Fri May 24 11:05:01 1996
|
||||
Signal: 16 caught by 0xc010001 (4)
|
||||
Init: signal was processed with 3:990000000 time remaining
|
||||
Task1: Fri May 24 11:05:02 1996
|
||||
Signal: 16 caught by 0xc010001 (5)
|
||||
Init: signal was processed with 2:980000000 time remaining
|
||||
Task1: Fri May 24 11:05:03 1996
|
||||
Signal: 16 caught by 0xc010001 (6)
|
||||
Init: signal was processed with 1:970000000 time remaining
|
||||
Task1: Fri May 24 11:05:04 1996
|
||||
Signal: 16 caught by 0xc010001 (7)
|
||||
Init: signal was processed with 0:960000000 time remaining
|
||||
Init: signal was not processed with 0:0 time remaining
|
||||
*** END OF POSIX TEST 2 ***
|
||||
@@ -1,51 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
#include <errno.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,44 +0,0 @@
|
||||
/* Task_1_through_3
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int seconds;
|
||||
int i;
|
||||
int status;
|
||||
|
||||
for ( i=0 ; i<5 ; i++ ) {
|
||||
print_current_time( "Task1: ", "" );
|
||||
status = pthread_kill( Init_id, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
seconds = sleep( 1 );
|
||||
assert( !seconds );
|
||||
}
|
||||
puts( "*** END OF POSIX TEST 2 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx03
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,203 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
)
|
||||
{
|
||||
Signal_count++;
|
||||
printf(
|
||||
"Signal: %d caught by 0x%x (%d)\n",
|
||||
signo,
|
||||
pthread_self(),
|
||||
Signal_count
|
||||
);
|
||||
Signal_occurred = 1;
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct timespec timeout;
|
||||
struct sigaction act;
|
||||
sigset_t mask;
|
||||
sigset_t waitset;
|
||||
int signo;
|
||||
siginfo_t siginfo;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 3 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* install a signal handler */
|
||||
|
||||
status = sigemptyset( &act.sa_mask );
|
||||
assert( !status );
|
||||
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
/* initialize signal handler variables */
|
||||
|
||||
Signal_count = 0;
|
||||
Signal_occurred = 0;
|
||||
|
||||
/*
|
||||
* wait on SIGUSR1 for 3 seconds, will timeout
|
||||
*/
|
||||
|
||||
/* initialize the signal set we will wait for to SIGUSR1 */
|
||||
|
||||
status = sigemptyset( &waitset );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &waitset, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
puts( "Init: waiting on any signal for 3 seconds." );
|
||||
signo = sigtimedwait( &waitset, &siginfo, &timeout );
|
||||
assert( signo == -1 );
|
||||
|
||||
if ( errno == EAGAIN )
|
||||
puts( "Init: correctly timed out waiting for SIGUSR1." );
|
||||
else
|
||||
printf( "sigtimedwait returned wrong errno - %d\n", errno );
|
||||
|
||||
Signal_occurred = 0;
|
||||
|
||||
/*
|
||||
* wait on SIGUSR1 for 3 seconds, will timeout because Task_1 sends SIGUSR2
|
||||
*/
|
||||
|
||||
empty_line();
|
||||
|
||||
/* initialize a mask to block SIGUSR2 */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Init: Block SIGUSR2\n" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread */
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* signal handler is still installed, waitset is still set for SIGUSR1 */
|
||||
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
puts( "Init: waiting on any signal for 3 seconds." );
|
||||
signo = sigtimedwait( &waitset, &siginfo, &timeout );
|
||||
|
||||
/* switch to Task 1 */
|
||||
|
||||
if ( errno == EAGAIN )
|
||||
puts( "Init: correctly timed out waiting for SIGUSR1." );
|
||||
else
|
||||
printf( "sigtimedwait returned wrong errno - %d\n", errno );
|
||||
assert( signo == -1 );
|
||||
|
||||
/*
|
||||
* wait on SIGUSR1 for 3 seconds, Task_2 will send it to us
|
||||
*/
|
||||
|
||||
empty_line();
|
||||
|
||||
/* create a thread */
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* signal handler is still installed, waitset is still set for SIGUSR1 */
|
||||
|
||||
/* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */
|
||||
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
/* just so we can check that these were altered */
|
||||
|
||||
siginfo.si_code = -1;
|
||||
siginfo.si_signo = -1;
|
||||
siginfo.si_value.sival_int = -1;
|
||||
|
||||
puts( "Init: waiting on any signal for 3 seconds." );
|
||||
signo = sigtimedwait( &waitset, &siginfo, &timeout );
|
||||
printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 );
|
||||
assert( signo == SIGUSR1 );
|
||||
assert( siginfo.si_signo == SIGUSR1 );
|
||||
assert( siginfo.si_code == SI_USER );
|
||||
assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
|
||||
|
||||
/* try out a process signal */
|
||||
|
||||
empty_line();
|
||||
puts( "Init: kill with SIGUSR2." );
|
||||
status = kill( getpid(), SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
siginfo.si_code = -1;
|
||||
siginfo.si_signo = -1;
|
||||
siginfo.si_value.sival_int = -1;
|
||||
|
||||
status = sigemptyset( &waitset );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &waitset, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &waitset, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: waiting on any signal for 3 seconds." );
|
||||
signo = sigtimedwait( &waitset, &siginfo, &timeout );
|
||||
printf( "Init: received (%d) SIGUSR2=%d\n", siginfo.si_signo, SIGUSR2 );
|
||||
assert( signo == SIGUSR2 );
|
||||
assert( siginfo.si_signo == SIGUSR2 );
|
||||
assert( siginfo.si_code == SI_USER );
|
||||
assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
|
||||
|
||||
/* exit this thread */
|
||||
|
||||
puts( "*** END OF POSIX TEST 3 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
*** POSIX TEST 3 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: waiting on any signal for 3 seconds.
|
||||
Init: correctly timed out waiting for SIGUSR1.
|
||||
|
||||
Init: Block SIGUSR2
|
||||
Init: waiting on any signal for 3 seconds.
|
||||
Task_1: Fri May 24 11:05:03 1996
|
||||
Task_1: pthread_kill - SIGUSR2 to Init
|
||||
Init: correctly timed out waiting for SIGUSR1.
|
||||
|
||||
Init: waiting on any signal for 3 seconds.
|
||||
Task_2: Fri May 24 11:05:06 1996
|
||||
Task_1: pthread_kill - SIGUSR1 to Init
|
||||
Signal: 16 caught by 0xc010001 (1)
|
||||
Init: received (16) SIGUSR1=16
|
||||
|
||||
Init: kill with SIGUSR2.
|
||||
Init: waiting on any signal for 3 seconds.
|
||||
Init: received (17) SIGUSR2=17
|
||||
*** END OF POSIX TEST 3 ***
|
||||
@@ -1,54 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 3
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,64 +0,0 @@
|
||||
/* Task_1_through_3
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
/* send SIGUSR2 to Init which is waiting on SIGUSR1 */
|
||||
|
||||
print_current_time( "Task_1: ", "" );
|
||||
|
||||
puts( "Task_1: pthread_kill - SIGUSR2 to Init" );
|
||||
status = pthread_kill( Init_id, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
/* send SIGUSR1 to Init which is waiting on SIGUSR1 */
|
||||
|
||||
print_current_time( "Task_2: ", "" );
|
||||
|
||||
puts( "Task_1: pthread_kill - SIGUSR1 to Init" );
|
||||
status = pthread_kill( Init_id, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx04
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task1.c task2.c task3.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,558 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
)
|
||||
{
|
||||
Signal_count++;
|
||||
printf(
|
||||
"Signal: %d caught by 0x%x (%d)\n",
|
||||
signo,
|
||||
pthread_self(),
|
||||
Signal_count
|
||||
);
|
||||
Signal_occurred = 1;
|
||||
}
|
||||
|
||||
void Signal_info_handler(
|
||||
int signo,
|
||||
siginfo_t *info,
|
||||
void *context
|
||||
)
|
||||
{
|
||||
Signal_count++;
|
||||
printf(
|
||||
"Signal_info: %d caught by 0x%x (%d) si_signo= %d si_code= %d value= %d\n",
|
||||
signo,
|
||||
pthread_self(),
|
||||
Signal_count,
|
||||
info->si_signo,
|
||||
info->si_code,
|
||||
info->si_value.sival_int
|
||||
);
|
||||
Signal_occurred = 1;
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct sigaction act;
|
||||
sigset_t mask;
|
||||
sigset_t pending_set;
|
||||
sigset_t oset;
|
||||
struct timespec timeout;
|
||||
siginfo_t info;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 4 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* install a signal handler for SIGUSR1 */
|
||||
|
||||
status = sigemptyset( &act.sa_mask );
|
||||
assert( !status );
|
||||
printf( "Init: sigemptyset - set= 0x%08x\n", (unsigned int) act.sa_mask );
|
||||
|
||||
/* test sigfillset following the above sigemptyset */
|
||||
|
||||
status = sigfillset( &act.sa_mask );
|
||||
assert( !status );
|
||||
printf( "Init: sigfillset - set= 0x%08x\n", (unsigned int) act.sa_mask );
|
||||
|
||||
/* test sigdelset */
|
||||
|
||||
status = sigdelset( &act.sa_mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
printf( "Init: sigdelset - delete SIGUSR1 set= 0x%08x\n",
|
||||
(unsigned int) act.sa_mask );
|
||||
|
||||
/* test sigismember - FALSE */
|
||||
|
||||
status = sigismember( &act.sa_mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
puts( "Init: sigismember - FALSE since SIGUSR1 is not a member" );
|
||||
|
||||
/* test sigismember - TRUE */
|
||||
|
||||
status = sigismember( &act.sa_mask, SIGUSR2 );
|
||||
assert( status );
|
||||
puts( "Init: sigismember - TRUE since SIGUSR2 is a member" );
|
||||
|
||||
/* return the set to empty */
|
||||
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
/* simple signal to process */
|
||||
|
||||
Signal_count = 0;
|
||||
Signal_occurred = 0;
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
/* end of install a signal handler for SIGUSR1 */
|
||||
|
||||
Signal_occurred = 0;
|
||||
|
||||
/* now block the signal, send it, see if it is pending, and unblock it */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1" );
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
/* simple signal to process */
|
||||
|
||||
Signal_count = 0;
|
||||
Signal_occurred = 0;
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
Signal_occurred = 0;
|
||||
|
||||
/* now block the signal, send it, see if it is pending, and unblock it */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: Unblock SIGUSR1" );
|
||||
status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* now let another task get interrupted by a signal */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: create a thread interested in SIGUSR1" );
|
||||
status = pthread_create( &Task1_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: sleep so the other task can block" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
status = sigpending( &pending_set );
|
||||
assert( !status );
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: sleep so the other task can catch signal" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
/* test alarm */
|
||||
|
||||
empty_line();
|
||||
|
||||
/* install a signal handler for SIGALRM and unblock it */
|
||||
|
||||
status = sigemptyset( &act.sa_mask );
|
||||
assert( !status );
|
||||
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
sigaction( SIGALRM, &act, NULL );
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGALRM );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Unblock SIGALRM" );
|
||||
status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* schedule the alarm */
|
||||
|
||||
puts( "Init: Firing alarm in 5 seconds" );
|
||||
status = alarm( 5 );
|
||||
printf( "Init: %d seconds left on previous alarm\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Firing alarm in 2 seconds" );
|
||||
status = alarm( 2 );
|
||||
printf( "Init: %d seconds left on previous alarm\n", status );
|
||||
assert( status );
|
||||
|
||||
puts( "Init: Wait 4 seconds for alarm" );
|
||||
status = sleep( 4 );
|
||||
printf( "Init: %d seconds left in sleep\n", status );
|
||||
assert( status );
|
||||
|
||||
/* test SIG_SETMASK case and returning oset of pthread_sigmask */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1 and SIGUSR2 only" );
|
||||
status = pthread_sigmask( SIG_SETMASK, &mask, &oset );
|
||||
printf( "Init: Previous blocked set was 0x%08x\n", (unsigned int) oset );
|
||||
assert( !status );
|
||||
|
||||
/* test inquiry about current blocked set with pthread_sigmask */
|
||||
|
||||
status = pthread_sigmask( 0, NULL, &oset );
|
||||
printf( "Init: Current blocked set is 0x%08x\n", (unsigned int) oset );
|
||||
assert( !status );
|
||||
|
||||
/* return blocked mask to no signals blocked */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Unblock all signals" );
|
||||
status = pthread_sigmask( SIG_SETMASK, &mask, &oset );
|
||||
printf( "Init: Previous blocked set was 0x%08x\n", (unsigned int) oset );
|
||||
assert( !status );
|
||||
|
||||
/* test sigsuspend */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: create a thread to send Init SIGUSR1" );
|
||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sigsuspend for any signal" );
|
||||
status = sigsuspend( &mask );
|
||||
assert( status );
|
||||
printf( "Init: awakended from sigsuspend status=%08d \n", status );
|
||||
|
||||
/* test a SIGINFO case, these are signals sent to a process only */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: create a thread to sent Process SIGUSR1 with SA_SIGINFO" );
|
||||
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* set action on SIGUSR1 to an info case */
|
||||
act.sa_handler = Signal_handler;
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
act.sa_sigaction = Signal_info_handler;
|
||||
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
puts( "Init: sigqueue occurred" );
|
||||
|
||||
/* Send SIGUSR1, Task_3 has issued a sigwaitinfo */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Send SIGUSR1, Task_3 has issued a sigwait */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR1" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: send SIGUSR1 to process" );
|
||||
status = kill( getpid(), SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Send SIGUSR1, Task_3 has issued a sigwaitinfo */
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Block SIGUSR2" );
|
||||
status = sigprocmask( SIG_BLOCK, &mask, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: send SIGUSR2 to process" );
|
||||
status = kill( getpid(), SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR2" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Suspend for signal that has already be sent */
|
||||
|
||||
puts( "Init: sigsuspend for any signal" );
|
||||
status = sigsuspend( &mask );
|
||||
assert( status );
|
||||
printf( "Init: awakended from sigsuspend status=%d \n", status );
|
||||
|
||||
/* generate error cases for psignal */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigemptyset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigfillset( NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigfillset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigaddset( NULL, SIGUSR1 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigaddset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigaddset( &mask, 0 );
|
||||
assert( !status );
|
||||
puts( "Init: sigaddset - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
status = sigaddset( &mask, 999 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigaddset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigdelset( NULL, SIGUSR1 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigdelset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigdelset( &mask, 0 );
|
||||
assert( !status );
|
||||
puts( "Init: sigdelset - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
status = sigdelset( &mask, 999 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigdelset - EINVAL (set invalid)" );
|
||||
|
||||
status = sigismember( NULL, SIGUSR1 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigismember - EINVAL (set invalid)" );
|
||||
|
||||
status = sigismember( &mask, 0 );
|
||||
assert( !status );
|
||||
puts( "Init: sigismember - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
status = sigismember( &mask, 999 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigismember - EINVAL (signal invalid)" );
|
||||
|
||||
status = sigaction( 0, &act, 0 );
|
||||
assert( !status );
|
||||
puts( "Init: sigaction - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
status = sigaction( 999, &act, NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigaction - EINVAL (signal invalid)" );
|
||||
|
||||
status = sigaction( SIGKILL, &act, NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigaction - EINVAL (SIGKILL)" );
|
||||
|
||||
status = pthread_sigmask( SIG_BLOCK, NULL, NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: pthread_sigmask - EINVAL (set and oset invalid)" );
|
||||
|
||||
status = pthread_sigmask( 999, &pending_set, NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: pthread_sigmask - EINVAL (how invalid)" );
|
||||
|
||||
status = sigpending( NULL );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: sigpending - EINVAL (set invalid)" );
|
||||
|
||||
timeout.tv_nsec = -1;
|
||||
status = sigtimedwait( &mask, &info, &timeout );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0)" );
|
||||
|
||||
timeout.tv_nsec = 0x7fffffff;
|
||||
status = sigtimedwait( &mask, &info, &timeout );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid to large)" );
|
||||
|
||||
status = pthread_kill( Init_id, 999 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: pthread_kill - EINVAL (sig invalid)" );
|
||||
|
||||
status = pthread_kill( 0, SIGUSR2 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == ESRCH );
|
||||
puts( "Init: pthread_kill - ESRCH (signal SA_SIGINFO)" );
|
||||
|
||||
status = pthread_kill( Init_id, 0 );
|
||||
assert( !status );
|
||||
puts( "Init: pthread_kill - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
act.sa_handler = SIG_IGN;
|
||||
act.sa_flags = 0;
|
||||
sigaction( SIGUSR2, &act, NULL );
|
||||
status = pthread_kill( Init_id, SIGUSR2 );
|
||||
assert( !status );
|
||||
puts( "Init: pthread_kill - SUCCESSFUL (signal = SIG_IGN)" );
|
||||
|
||||
status = kill( 0x7fffffff, SIGUSR1 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == ESRCH );
|
||||
puts( "Init: kill - ESRCH (pid invalid)" );
|
||||
|
||||
status = kill( getpid(), 0 );
|
||||
assert( !status );
|
||||
puts( "Init: kill - SUCCESSFUL (signal = 0)" );
|
||||
|
||||
status = kill( getpid(), 999 );
|
||||
if ( status != -1 )
|
||||
printf( "status = %d\n", status );
|
||||
assert( errno == EINVAL );
|
||||
puts( "Init: kill - EINVAL (sig invalid)" );
|
||||
|
||||
/* exit this thread */
|
||||
|
||||
puts( "*** END OF POSIX TEST 4 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
*** POSIX TEST 4 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: sigemptyset - set= 0x00000000
|
||||
Init: sigfillset - set= 0xffffffff
|
||||
Init: sigdelset - delete SIGUSR1 set= 0xffff7fff
|
||||
Init: sigismember - FALSE since SIGUSR1 is not a member
|
||||
Init: sigismember - TRUE since SIGUSR2 is a member
|
||||
Init: send SIGUSR1 to process
|
||||
Signal: 16 caught by 0xc010001 (1)
|
||||
Init: Block SIGUSR1
|
||||
Init: send SIGUSR1 to process
|
||||
Signal: 16 caught by 0xc010001 (1)
|
||||
Init: Block SIGUSR1
|
||||
Init: Signals pending 0x00000000
|
||||
Init: send SIGUSR1 to process
|
||||
Init: Signals pending 0x00008000
|
||||
Init: Unblock SIGUSR1
|
||||
Signal: 16 caught by 0xc010001 (2)
|
||||
Init: create a thread interested in SIGUSR1
|
||||
Init: Block SIGUSR1
|
||||
Init: Signals pending 0x00000000
|
||||
Init: sleep so the other task can block
|
||||
Task_1: sleeping for 5 seconds
|
||||
Init: send SIGUSR1 to process
|
||||
Init: Signals pending 0x00008000
|
||||
Init: sleep so the other task can catch signal
|
||||
Signal: 16 caught by 0xc010002 (3)
|
||||
Task_1: 4 seconds left
|
||||
Task_1: exit
|
||||
Init: Unblock SIGALRM
|
||||
Init: Firing alarm in 5 seconds
|
||||
Init: 0 seconds left on previous alarm
|
||||
Init: Firing alarm in 2 seconds
|
||||
Init: 4 seconds left on previous alarm - MAY BE 5 SECONDS ALSO
|
||||
Init: Wait 4 seconds for alarm
|
||||
Signal: 14 caught by 0xc010001 (4)
|
||||
Init: 2 seconds left in sleep
|
||||
Init: Block SIGUSR1 and SIGUSR2 only
|
||||
Init: Previous blocked set was 0x00008000
|
||||
Init: Current blocked set is 0x00018000
|
||||
Init: Unblock all signals
|
||||
Init: Previous blocked set was 0x00018000
|
||||
Init: create a thread to send Init SIGUSR1
|
||||
Init: sigsuspend for any signal
|
||||
Task_2: sending SIGUSR1
|
||||
Task_2: exit
|
||||
Signal: 16 caught by 0xc010001 (5)
|
||||
Init: awakended from sigsuspend status=00000016
|
||||
Init: create a thread to sent Process SIGUSR1 with SA_SIGINFO
|
||||
Init: sleep so the Task_3 can sigqueue SIGUSR1
|
||||
Task_3: sigqueue SIGUSR1 with value= 16
|
||||
Signal_info: 16 caught by 0xc010004 (6) si_signo= 16 si_code= 1 value= 16
|
||||
Task_3: sigwaitinfo SIGUSR1 with value= 16
|
||||
Init: sigqueue occurred
|
||||
Init: Block SIGUSR1
|
||||
Init: send SIGUSR1 to process
|
||||
Init: sleep so the Task_3 can receive SIGUSR1
|
||||
Task_3: si_signo= 16 si_code= 1 value= 0
|
||||
Task_3: sigwait SIGUSR1
|
||||
Init: Block SIGUSR1
|
||||
Init: send SIGUSR1 to process
|
||||
Init: sleep so the Task_3 can receive SIGUSR1
|
||||
Task_3: signo= 16
|
||||
Task_3: pause
|
||||
Init: Block SIGUSR2
|
||||
Init: send SIGUSR2 to process
|
||||
Init: sleep so the Task_3 can receive SIGUSR2
|
||||
Task_3: pause= 17
|
||||
Task_3: sending SIGUSR2
|
||||
Task_3: sleep so the Init task can reguest a signal
|
||||
Init: sigsuspend for any signal
|
||||
Init: awakended from sigsuspend status=17
|
||||
Init: sigemptyset - EINVAL (set invalid)
|
||||
Init: sigfillset - EINVAL (set invalid)
|
||||
Init: sigaddset - EINVAL (set invalid)
|
||||
Init: sigaddset - SUCCESSFUL (signal = 0)
|
||||
Init: sigaddset - EINVAL (set invalid)
|
||||
Init: sigdelset - EINVAL (set invalid)
|
||||
Init: sigdelset - SUCCESSFUL (signal = 0)
|
||||
Init: sigdelset - EINVAL (set invalid)
|
||||
Init: sigismember - EINVAL (set invalid)
|
||||
Init: sigismember - SUCCESSFUL (signal = 0)
|
||||
Init: sigismember - EINVAL (signal invalid)
|
||||
Init: sigaction - SUCCESSFUL (signal = 0)
|
||||
Init: sigaction - EINVAL (signal invalid)
|
||||
Init: sigaction - EINVAL (SIGKILL)
|
||||
Init: pthread_sigmask - EINVAL (set and oset invalid)
|
||||
Init: pthread_sigmask - EINVAL (how invalid)
|
||||
Init: sigpending - EINVAL (set invalid)
|
||||
Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0)
|
||||
Init: pthread_sigmask - EINVAL (timout->nsec invalid to large)
|
||||
Init: pthread_kill - EINVAL (sig invalid)
|
||||
Init: pthread_kill - ESRCH (signal SA_SIGINFO)
|
||||
Init: pthread_kill - SUCCESSFUL (signal = 0)
|
||||
Init: pthread_kill - SUCCESSFUL (signal = SIG_IGN)
|
||||
Init: kill - ESRCH (pid invalid)
|
||||
Init: kill - SUCCESSFUL (signal = 0)
|
||||
Init: kill - EINVAL (sig invalid)
|
||||
*** END OF POSIX TEST 4 ***
|
||||
@@ -1,63 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
|
||||
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 5
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
|
||||
(RTEMS_MINIMUM_STACK_SIZE * 4)
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task1_id;
|
||||
TEST_EXTERN pthread_t Task2_id;
|
||||
TEST_EXTERN pthread_t Task3_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,43 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int seconds;
|
||||
|
||||
printf( "Task_1: sleeping for 5 seconds\n" );
|
||||
|
||||
seconds = sleep( 5 );
|
||||
printf( "Task_1: %d seconds left\n", seconds );
|
||||
assert( seconds );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
printf( "Task_1: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/* Task_2
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
printf( "Task_2: sending SIGUSR1\n" );
|
||||
status = pthread_kill( Init_id, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
printf( "Task_2: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
/* Task_3
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <signal.h>
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
int sig;
|
||||
union sigval value;
|
||||
sigset_t mask;
|
||||
siginfo_t info;
|
||||
|
||||
value.sival_int = SIGUSR1;
|
||||
|
||||
printf( "Task_3: sigqueue SIGUSR1 with value= %d\n", value.sival_int );
|
||||
status = sigqueue( getpid(), SIGUSR1, value );
|
||||
assert( !status );
|
||||
|
||||
/* catch signal with sigwaitinfo */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task_3: sigwaitinfo SIGUSR1 with value= %d\n", value.sival_int );
|
||||
status = sigwaitinfo( &mask, &info );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
assert( !(status==-1) );
|
||||
printf(
|
||||
"Task_3: si_signo= %d si_code= %d value= %d\n",
|
||||
info.si_signo,
|
||||
info.si_code,
|
||||
info.si_value.sival_int
|
||||
);
|
||||
|
||||
/* catch signal with sigwait */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task_3: sigwait SIGUSR1\n" );
|
||||
status = sigwait( &mask, &sig );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
assert( !status );
|
||||
printf( "Task_3: signo= %d\n", sig );
|
||||
|
||||
/* catch signal with pause */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = sigemptyset( &mask );
|
||||
assert( !status );
|
||||
|
||||
status = sigaddset( &mask, SIGUSR1 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task_3: pause\n" );
|
||||
status = pause( );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
assert( !(status==-1) );
|
||||
printf( "Task_3: pause= %d\n", status );
|
||||
|
||||
|
||||
/* send signal to Init task before it has pended for a signal */
|
||||
|
||||
empty_line();
|
||||
|
||||
printf( "Task_3: sending SIGUSR2\n" );
|
||||
status = pthread_kill( Init_id, SIGUSR2 );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task_3: sleep so the Init task can reguest a signal\n" );
|
||||
status = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* end of task 3 */
|
||||
printf( "Task_3: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx05
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c task2.c task3.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,583 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
#define MUTEX_BAD_ID 0xfffffffe
|
||||
|
||||
void Print_mutexattr(
|
||||
char *msg,
|
||||
pthread_mutexattr_t *attr
|
||||
)
|
||||
{
|
||||
int status;
|
||||
int protocol;
|
||||
int prioceiling;
|
||||
int pshared;
|
||||
|
||||
/* protocol */
|
||||
|
||||
status = pthread_mutexattr_getprotocol( attr, &protocol );
|
||||
assert( !status );
|
||||
|
||||
printf( "%smutex protocol is (%d) -- ", msg, protocol );
|
||||
switch ( protocol ) {
|
||||
case PTHREAD_PRIO_NONE:
|
||||
puts( "PTHREAD_PRIO_NONE" );
|
||||
break;
|
||||
case PTHREAD_PRIO_INHERIT:
|
||||
puts( "PTHREAD_PRIO_INHERIT" );
|
||||
break;
|
||||
case PTHREAD_PRIO_PROTECT:
|
||||
puts( "PTHREAD_PRIO_PROTECT" );
|
||||
break;
|
||||
default:
|
||||
puts( "UNKNOWN" );
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
/* priority ceiling */
|
||||
|
||||
status = pthread_mutexattr_getprioceiling( attr, &prioceiling );
|
||||
assert( !status );
|
||||
printf( "%smutex priority ceiling is %d\n", msg, prioceiling );
|
||||
|
||||
/* process shared */
|
||||
|
||||
status = pthread_mutexattr_getpshared( attr, &pshared );
|
||||
assert( !status );
|
||||
printf( "%smutex process shared is (%d) -- ", msg, pshared );
|
||||
switch ( pshared ) {
|
||||
case PTHREAD_PROCESS_PRIVATE:
|
||||
puts( "PTHREAD_PROCESS_PRIVATE" );
|
||||
break;
|
||||
case PTHREAD_PROCESS_SHARED:
|
||||
puts( "PTHREAD_PROCESS_SHARED" );
|
||||
break;
|
||||
default:
|
||||
puts( "UNKNOWN" );
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_t destroyed_attr;
|
||||
struct timespec times;
|
||||
struct sched_param param;
|
||||
int pshared;
|
||||
int policy;
|
||||
int protocol;
|
||||
int ceiling;
|
||||
int old_ceiling;
|
||||
|
||||
assert( MUTEX_BAD_ID != PTHREAD_MUTEX_INITIALIZER );
|
||||
Mutex_bad_id = MUTEX_BAD_ID;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 5 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* tes pthread_mutex_attr_init */
|
||||
|
||||
puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_init( NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
Print_mutexattr( "Init: ", &attr );
|
||||
|
||||
/* create an "uninitialized" attribute structure */
|
||||
|
||||
status = pthread_mutexattr_init( &destroyed_attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_destroy( &destroyed_attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutexattr_destroy - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_destroy( NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_destroy - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_destroy( &destroyed_attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* error cases for set and get pshared attribute */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_getpshared( NULL, &pshared );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared)" );
|
||||
status = pthread_mutexattr_getpshared( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getpshared - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_getpshared( &destroyed_attr, &pshared );
|
||||
assert( status == EINVAL );
|
||||
|
||||
pshared = PTHREAD_PROCESS_PRIVATE;
|
||||
puts( "Init: pthread_mutexattr_setpshared - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_setpshared( NULL, pshared );
|
||||
assert( status == EINVAL );
|
||||
|
||||
pshared = PTHREAD_PROCESS_PRIVATE;
|
||||
puts( "Init: pthread_mutexattr_setpshared - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_setpshared( &destroyed_attr, pshared );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* error cases for set and get protocol attribute */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_getprotocol( NULL, &protocol );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol)" );
|
||||
status = pthread_mutexattr_getprotocol( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_getprotocol( &destroyed_attr, &protocol );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_setprotocol( NULL, PTHREAD_PRIO_NONE );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol)" );
|
||||
status = pthread_mutexattr_setprotocol( &attr, -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_setprotocol( &destroyed_attr, -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* error cases for set and get prioceiling attribute */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_getprioceiling( NULL, &ceiling );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling)" );
|
||||
status = pthread_mutexattr_getprioceiling( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_getprioceiling( &destroyed_attr, &ceiling );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr)" );
|
||||
status = pthread_mutexattr_setprioceiling( NULL, 128 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority)" );
|
||||
status = pthread_mutexattr_setprioceiling( &attr, 512 );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized)" );
|
||||
status = pthread_mutexattr_setprioceiling( &destroyed_attr, -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* create a thread */
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* now try some basic mutex operations */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutex_init - EINVAL (NULL mutex_id)" );
|
||||
status = pthread_mutex_init( NULL, &attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_init - EINVAL (not initialized attr)" );
|
||||
status = pthread_mutex_init( &Mutex_id, &destroyed_attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* must get around error checks in attribute set routines */
|
||||
attr.protocol = -1;
|
||||
|
||||
puts( "Init: pthread_mutex_init - EINVAL (bad protocol)" );
|
||||
status = pthread_mutex_init( &Mutex_id, &attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* must get around error checks in attribute set routines */
|
||||
attr.protocol = PTHREAD_PRIO_INHERIT;
|
||||
attr.prio_ceiling = -1;
|
||||
|
||||
puts( "Init: pthread_mutex_init - EINVAL (bad priority ceiling)" );
|
||||
status = pthread_mutex_init( &Mutex_id, &attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* now set up for a success pthread_mutex_init */
|
||||
|
||||
puts( "Init: Resetting mutex attributes" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Changing mutex attributes" );
|
||||
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutexattr_setprioceiling( &attr, 128 );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
|
||||
assert( !status );
|
||||
|
||||
Print_mutexattr( "Init: ", &attr );
|
||||
|
||||
puts( "Init: Resetting mutex attributes" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
/*
|
||||
* Set the protocol to priority ceiling so the owner check happens
|
||||
* and the EPERM test (later) will work.
|
||||
*/
|
||||
|
||||
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_init - SUCCESSFUL" );
|
||||
status = pthread_mutex_init( &Mutex_id, &attr );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
/*
|
||||
* This is not required to be an error and when it is, there are
|
||||
* behavioral conflicts with other implementations.
|
||||
*/
|
||||
puts( "Init: pthread_mutex_init - EBUSY (reinitialize an existing mutex) - skipped" );
|
||||
|
||||
#if 0
|
||||
status = pthread_mutex_init( &Mutex_id, &attr );
|
||||
if ( !status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EBUSY );
|
||||
#endif
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - EINVAL (illegal ID)" );
|
||||
status = pthread_mutex_trylock( &Mutex_bad_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
|
||||
status = pthread_mutex_trylock( &Mutex_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - EDEADLK (already locked)" );
|
||||
status = pthread_mutex_trylock( &Mutex_id );
|
||||
if ( status != EDEADLK )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EDEADLK );
|
||||
|
||||
puts( "Init: pthread_mutex_lock - EDEADLK (already locked)" );
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
if ( status != EDEADLK )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EDEADLK );
|
||||
|
||||
puts( "Init: Sleep 1 second" );
|
||||
|
||||
sleep( 1 );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - EINVAL (invalid id)" );
|
||||
status = pthread_mutex_unlock( &Mutex_bad_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - EPERM (not owner)" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
if ( status != EPERM )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EPERM );
|
||||
|
||||
times.tv_sec = 0;
|
||||
times.tv_nsec = 500000000;
|
||||
puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" );
|
||||
status = pthread_mutex_timedlock( &Mutex_id, × );
|
||||
if ( status != EAGAIN )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EAGAIN );
|
||||
|
||||
/* switch to idle */
|
||||
|
||||
puts( "Init: pthread_mutex_timedlock - EAGAIN (timeout)" );
|
||||
|
||||
/* destroy a mutex */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutex_init - SUCCESSFUL" );
|
||||
status = pthread_mutex_init( &Mutex2_id, &attr );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_init - EAGAIN (too many)" );
|
||||
status = pthread_mutex_init( &Mutex3_id, &attr );
|
||||
assert( status == EAGAIN );
|
||||
|
||||
puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_destroy( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutex_destroy( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_destroy - EINVAL (invalid id)" );
|
||||
status = pthread_mutex_destroy( &Mutex_bad_id );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* destroy a busy mutex */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_init - SUCCESSFUL" );
|
||||
status = pthread_mutex_init( &Mutex2_id, &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
|
||||
status = pthread_mutex_trylock( &Mutex2_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_destroy - EBUSY (already locked)" );
|
||||
status = pthread_mutex_destroy( &Mutex2_id );
|
||||
if ( status != EBUSY )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EBUSY );
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
|
||||
status = pthread_mutex_unlock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutex_destroy( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
/* priority inherit mutex */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts(
|
||||
"Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_INHERIT)"
|
||||
);
|
||||
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_init - SUCCESSFUL" );
|
||||
status = pthread_mutex_init( &Mutex2_id, &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
|
||||
status = pthread_mutex_trylock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread at a lower priority */
|
||||
|
||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* set priority of Task2 to highest priority */
|
||||
|
||||
param.sched_priority = 254;
|
||||
|
||||
puts( "Init: pthread_setschedparam - Setting Task2 priority to highest" );
|
||||
status = pthread_setschedparam( Task2_id, SCHED_FIFO, ¶m );
|
||||
assert( !status );
|
||||
|
||||
/* switching to Task2 */
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &policy, ¶m );
|
||||
assert( !status );
|
||||
printf( "Init: pthread_getschedparam - priority = %d\n", param.sched_priority);
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
|
||||
status = pthread_mutex_unlock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_destroy( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
|
||||
status = pthread_mutex_destroy( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
/* priority ceiling mutex */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts(
|
||||
"Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT)"
|
||||
);
|
||||
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_init - SUCCESSFUL" );
|
||||
status = pthread_mutex_init( &Mutex2_id, &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_mutex_getprioceiling - EINVAL (invalid id)" );
|
||||
status = pthread_mutex_getprioceiling( &Mutex_bad_id, &ceiling );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_getprioceiling - EINVAL (NULL ceiling)" );
|
||||
status = pthread_mutex_getprioceiling( &Mutex2_id, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling );
|
||||
assert( !status );
|
||||
printf( "Init: pthread_mutex_getprioceiling - %d\n", ceiling );
|
||||
|
||||
puts( "Init: pthread_mutex_setprioceiling - EINVAL (invalid id)" );
|
||||
status = pthread_mutex_setprioceiling( &Mutex_bad_id, 200, &old_ceiling );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_setprioceiling - EINVAL (illegal priority)" );
|
||||
status = pthread_mutex_setprioceiling( &Mutex2_id, 512, &old_ceiling );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_mutex_setprioceiling - EINVAL (NULL ceiling)" );
|
||||
status = pthread_mutex_setprioceiling( &Mutex2_id, 128, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* normal cases of set priority ceiling */
|
||||
|
||||
puts( "Init: pthread_mutex_setprioceiling - new ceiling = 200" );
|
||||
status = pthread_mutex_setprioceiling( &Mutex2_id, 200, &old_ceiling );
|
||||
assert( !status );
|
||||
printf(
|
||||
"Init: pthread_mutex_setprioceiling - old ceiling = %d\n",old_ceiling
|
||||
);
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &policy, ¶m );
|
||||
assert( !status );
|
||||
printf(
|
||||
"Init: pthread_getschedparam - priority = %d\n", param.sched_priority
|
||||
);
|
||||
|
||||
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
|
||||
status = pthread_mutex_trylock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &policy, ¶m );
|
||||
assert( !status );
|
||||
printf(
|
||||
"Init: pthread_getschedparam - priority = %d\n", param.sched_priority
|
||||
);
|
||||
|
||||
/* create a thread at a higher priority */
|
||||
|
||||
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* set priority of Task3 to highest priority */
|
||||
|
||||
param.sched_priority = 199;
|
||||
|
||||
status = pthread_setschedparam( Task3_id, SCHED_FIFO, ¶m );
|
||||
assert( !status );
|
||||
puts( "Init: pthread_setschedparam - set Task3 priority to highest" );
|
||||
|
||||
/* DOES NOT SWITCH to Task3 */
|
||||
|
||||
puts( "Init: Sleep 1 second" );
|
||||
assert( !status );
|
||||
sleep( 1 );
|
||||
|
||||
/* switch to task 3 */
|
||||
|
||||
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
|
||||
status = pthread_mutex_unlock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling );
|
||||
assert( !status );
|
||||
printf( "Init: pthread_mutex_getprioceiling- ceiling = %d\n", ceiling );
|
||||
|
||||
/* set priority of Init to highest priority */
|
||||
|
||||
param.sched_priority = 254;
|
||||
|
||||
status = pthread_setschedparam( Init_id, SCHED_FIFO, ¶m );
|
||||
assert( !status );
|
||||
puts( "Init: pthread_setschedparam - set Init priority to highest" );
|
||||
|
||||
puts( "Init: pthread_mutex_lock - EINVAL (priority ceiling violation)" );
|
||||
status = pthread_mutex_lock( &Mutex2_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "*** END OF POSIX TEST 5 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
*** POSIX TEST 5 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_mutexattr_init - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_init - SUCCESSFUL
|
||||
Init: mutex protocol is (0) -- PTHREAD_PRIO_NONE
|
||||
Init: mutex priority ceiling is 254
|
||||
Init: mutex process shared is (0) -- PTHREAD_PROCESS_PRIVATE
|
||||
Init: pthread_mutexattr_destroy - SUCCESSFUL
|
||||
Init: pthread_mutexattr_destroy - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_destroy - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_getpshared - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared)
|
||||
Init: pthread_mutexattr_getpshared - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_setpshared - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_setpshared - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol)
|
||||
Init: pthread_mutexattr_getprotocol - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol)
|
||||
Init: pthread_mutexattr_setprotocol - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling)
|
||||
Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized)
|
||||
Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr)
|
||||
Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority)
|
||||
Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized)
|
||||
Init: pthread_mutex_init - EINVAL (NULL mutex_id)
|
||||
Init: pthread_mutex_init - EINVAL (not initialized attr)
|
||||
Init: pthread_mutex_init - EINVAL (bad protocol)
|
||||
Init: pthread_mutex_init - EINVAL (bad priority ceiling)
|
||||
Init: Resetting mutex attributes
|
||||
Init: Changing mutex attributes
|
||||
Init: mutex protocol is (1) -- PTHREAD_PRIO_INHERIT
|
||||
Init: mutex priority ceiling is 128
|
||||
Init: mutex process shared is (1) -- PTHREAD_PROCESS_SHARED
|
||||
Init: Resetting mutex attributes
|
||||
Init: pthread_mutex_init - SUCCESSFUL
|
||||
Init: pthread_mutex_init - EBUSY (reinitialize an existing mutex) - skipped
|
||||
Init: pthread_mutex_trylock - EINVAL (illegal ID)
|
||||
Init: pthread_mutex_trylock - SUCCESSFUL
|
||||
Init: pthread_mutex_trylock - EDEADLK (already locked)
|
||||
Init: pthread_mutex_lock - EDEADLK (already locked)
|
||||
Init: Sleep 1 second
|
||||
Task: pthread_mutex_trylock already locked
|
||||
Task: pthread_mutex_lock unavailable
|
||||
Init: pthread_mutex_unlock - EINVAL (invalid id)
|
||||
Init: pthread_mutex_unlock - SUCCESSFUL
|
||||
Init: pthread_mutex_unlock - EPERM (not owner)
|
||||
Init: pthread_mutex_timedlock - time out in 1/2 second
|
||||
Task: mutex acquired
|
||||
Task: sleep for 2 seconds
|
||||
Init: pthread_mutex_timedlock - EAGAIN (timeout)
|
||||
Init: pthread_mutex_init - SUCCESSFUL
|
||||
Init: pthread_mutex_init - EAGAIN (too many)
|
||||
Init: pthread_mutexattr_destroy - SUCCESSFUL
|
||||
Init: pthread_mutex_destroy - SUCCESSFUL
|
||||
Init: pthread_mutex_destroy - EINVAL (invalid id)
|
||||
Init: pthread_mutexattr_init - SUCCESSFUL
|
||||
Init: pthread_mutex_init - SUCCESSFUL
|
||||
Init: pthread_mutex_trylock - SUCCESSFUL
|
||||
Init: pthread_mutex_destroy - EBUSY (already locked)
|
||||
Init: pthread_mutex_unlock - SUCCESSFUL
|
||||
Init: pthread_mutex_destroy - SUCCESSFUL
|
||||
Init: pthread_mutexattr_init - SUCCESSFUL
|
||||
Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_INHERIT)
|
||||
Init: pthread_mutex_init - SUCCESSFUL
|
||||
Init: pthread_mutex_trylock - SUCCESSFUL
|
||||
Init: pthread_setschedparam - Setting Task2 priority to highest
|
||||
Task 2: pthread_mutex_lock unavailable (inherit case)
|
||||
Init: pthread_getschedparam - priority = 254
|
||||
Init: pthread_mutex_unlock - SUCCESSFUL
|
||||
Task 2: mutex acquired
|
||||
Task 2: unlock Mutex 2
|
||||
Task 2: exit
|
||||
Init: pthread_mutexattr_destroy - SUCCESSFUL
|
||||
Init: pthread_mutex_destroy - SUCCESSFUL
|
||||
Init: pthread_mutexattr_init - SUCCESSFUL
|
||||
Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT)
|
||||
Init: pthread_mutex_init - SUCCESSFUL
|
||||
Init: pthread_mutex_getprioceiling - EINVAL (invalid id)
|
||||
Init: pthread_mutex_getprioceiling - EINVAL (NULL ceiling)
|
||||
Init: pthread_mutex_getprioceiling - 254
|
||||
Init: pthread_mutex_setprioceiling - EINVAL (invalid id)
|
||||
Init: pthread_mutex_setprioceiling - EINVAL (illegal priority)
|
||||
Init: pthread_mutex_setprioceiling - EINVAL (NULL ceiling)
|
||||
Init: pthread_mutex_setprioceiling - new ceiling = 200
|
||||
Init: pthread_mutex_setprioceiling - old ceiling = 254
|
||||
Init: pthread_getschedparam - priority = 2
|
||||
Init: pthread_mutex_trylock - SUCCESSFUL
|
||||
Init: pthread_getschedparam - priority = 200
|
||||
Init: pthread_setschedparam - set Task3 priority to highest
|
||||
Init: Sleep 1 second
|
||||
Task 3: pthread_mutex_lock unavailable (inherit case)
|
||||
Init: pthread_mutex_unlock - SUCCESSFUL
|
||||
Task 3: mutex acquired
|
||||
Task 3: unlock Mutex 2
|
||||
Task 3: pthread_getschedparam priority = 199
|
||||
Task 3: exit
|
||||
Init: pthread_mutex_getprioceiling- ceiling = 200
|
||||
Init: pthread_setschedparam - set Init priority to highest
|
||||
Init: pthread_mutex_lock - EINVAL (priority ceiling violation)
|
||||
*** END OF POSIX TEST 5 ***
|
||||
@@ -1,65 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
TEST_EXTERN pthread_t Task2_id;
|
||||
TEST_EXTERN pthread_t Task3_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex2_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex3_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex_bad_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,57 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
printf( "Task: pthread_mutex_trylock already locked\n" );
|
||||
status = pthread_mutex_trylock( &Mutex_id );
|
||||
if ( status != EBUSY )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EBUSY );
|
||||
|
||||
printf( "Task: pthread_mutex_lock unavailable\n" );
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
/* switch to init */
|
||||
|
||||
printf( "Task: mutex acquired\n" );
|
||||
|
||||
printf( "Task: sleep for 2 seconds\n" );
|
||||
sleep( 2 );
|
||||
|
||||
/* switch to init */
|
||||
|
||||
printf( "Task: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/* Task_2
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
printf( "Task 2: pthread_mutex_lock unavailable (inherit case)\n" );
|
||||
status = pthread_mutex_lock( &Mutex2_id );
|
||||
if ( status )
|
||||
printf( "status =%d\n", status );
|
||||
assert( !status );
|
||||
printf( "Task 2: mutex acquired\n" );
|
||||
|
||||
/* switch to init */
|
||||
|
||||
printf( "Task 2: unlock Mutex 2\n" );
|
||||
status = pthread_mutex_unlock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task 2: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/* Task_3
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct sched_param param;
|
||||
int policy;
|
||||
|
||||
printf( "Task 3: pthread_mutex_lock unavailable (inherit case)\n" );
|
||||
status = pthread_mutex_lock( &Mutex2_id );
|
||||
printf( "Task 3: mutex acquired\n" );
|
||||
assert( !status );
|
||||
|
||||
printf( "Task 3: unlock Mutex 2\n" );
|
||||
status = pthread_mutex_unlock( &Mutex2_id );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &policy, ¶m );
|
||||
assert( !status );
|
||||
printf( "Task 3: pthread_getschedparam priority = %d\n", param.sched_priority );
|
||||
|
||||
printf( "Task 3: exit\n" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to Init */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx06
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c task2.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void Key_destructor(
|
||||
void *key_data
|
||||
)
|
||||
{
|
||||
Destructor_invoked++;
|
||||
|
||||
/*
|
||||
* This checks out that we only run the destructor multiple times
|
||||
* when the key data is non null.
|
||||
*/
|
||||
|
||||
if ( Destructor_invoked == 5 )
|
||||
(void) pthread_setspecific( Key_id, NULL );
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
unsigned int remaining;
|
||||
rtems_unsigned32 *key_data;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 6 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* create a couple of threads */
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* create a key */
|
||||
|
||||
empty_line();
|
||||
|
||||
Destructor_invoked = 0;
|
||||
puts( "Init: pthread_key_create - SUCCESSFUL" );
|
||||
status = pthread_key_create( &Key_id, Key_destructor );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
printf( "Destructor invoked %d times\n", Destructor_invoked );
|
||||
|
||||
puts( "Init: pthread_key_create - EAGAIN (too many keys)" );
|
||||
status = pthread_key_create( &Key_id, Key_destructor );
|
||||
assert( status == EAGAIN );
|
||||
|
||||
puts( "Init: pthread_setspecific - EINVAL (invalid key)" );
|
||||
status = pthread_setspecific( -1, &Data_array[ 0 ] );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_getspecific - EINVAL (invalid key)" );
|
||||
key_data = pthread_getspecific( -1 );
|
||||
assert( !key_data );
|
||||
|
||||
puts( "Init: pthread_key_delete - EINVAL (invalid key)" );
|
||||
status = pthread_key_delete( -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
printf( "Init: Setting the key to %d\n", 0 );
|
||||
status = pthread_setspecific( Key_id, &Data_array[ 0 ] );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
key_data = pthread_getspecific( Key_id );
|
||||
printf( "Init: Got the key value of %ld\n",
|
||||
(unsigned long) ((rtems_unsigned32 *)key_data - Data_array) );
|
||||
|
||||
remaining = sleep( 3 );
|
||||
if ( remaining )
|
||||
printf( "seconds remaining = %d\n", remaining );
|
||||
assert( !remaining );
|
||||
|
||||
/* switch to task 1 */
|
||||
|
||||
/* delete the key */
|
||||
|
||||
puts( "Init: pthread_key_delete - SUCCESSFUL" );
|
||||
status = pthread_key_delete( Key_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
printf( "Destructor invoked %d times\n", Destructor_invoked );
|
||||
|
||||
puts( "*** END OF POSIX TEST 6 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
*** POSIX TEST 6 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_key_create - SUCCESSFUL
|
||||
Destructor invoked 0 times
|
||||
Init: pthread_key_create - EAGAIN (too many keys)
|
||||
Init: pthread_setspecific - EINVAL (invalid key)
|
||||
Init: pthread_getspecific - EINVAL (invalid key)
|
||||
Init: pthread_key_delete - EINVAL (invalid key)
|
||||
Init: Setting the key to 0
|
||||
Init: Got the key value of 0
|
||||
Task_1: Setting the key to 1
|
||||
Task_1: Got the key value of 1
|
||||
Task_1: exitting
|
||||
Destructor invoked 4 times
|
||||
Task_2: Setting the key to 2
|
||||
Task_2: Got the key value of 2
|
||||
Task2: exitting
|
||||
Init: pthread_key_delete - SUCCESSFUL
|
||||
Destructor invoked 5 times
|
||||
*** END OF POSIX TEST 6 ***
|
||||
@@ -1,59 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 3
|
||||
#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
TEST_EXTERN pthread_t Task2_id;
|
||||
TEST_EXTERN pthread_key_t Key_id;
|
||||
TEST_EXTERN rtems_unsigned32 Data_array[ CONFIGURE_MAXIMUM_POSIX_THREADS ];
|
||||
TEST_EXTERN rtems_unsigned32 Destructor_invoked;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,50 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
rtems_unsigned32 *key_data;
|
||||
|
||||
printf( "Task_1: Setting the key to %d\n", 1 );
|
||||
status = pthread_setspecific( Key_id, &Data_array[ 1 ] );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
key_data = pthread_getspecific( Key_id );
|
||||
printf( "Task_1: Got the key value of %ld\n",
|
||||
(unsigned long) ((rtems_unsigned32 *)key_data - Data_array) );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: exitting" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to task 2 */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Task_2
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
rtems_unsigned32 *key_data;
|
||||
|
||||
printf( "Destructor invoked %d times\n", Destructor_invoked );
|
||||
|
||||
printf( "Task_2: Setting the key to %d\n", 2 );
|
||||
status = pthread_setspecific( Key_id, &Data_array[ 2 ] );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
key_data = pthread_getspecific( Key_id );
|
||||
printf( "Task_2: Got the key value of %ld\n",
|
||||
(unsigned long) ((rtems_unsigned32 *)key_data - Data_array) );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task2: exitting" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* switch to init task */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx07
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,493 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
)
|
||||
{
|
||||
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority );
|
||||
printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_replenish_period.tv_sec,
|
||||
schedparam->ss_replenish_period.tv_nsec );
|
||||
printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_initial_budget.tv_sec,
|
||||
schedparam->ss_initial_budget.tv_nsec );
|
||||
#else
|
||||
printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
int scope;
|
||||
int inheritsched;
|
||||
int schedpolicy;
|
||||
size_t stacksize;
|
||||
void *stackaddr;
|
||||
int detachstate;
|
||||
struct sched_param schedparam;
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_t destroyed_attr;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 7 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* exercise init and destroy */
|
||||
|
||||
puts( "Init: pthread_attr_init - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_init( NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_init - SUCCESSFUL" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: initialize and destroy an attribute - SUCCESSFUL" );
|
||||
status = pthread_attr_init( &destroyed_attr );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_attr_destroy( &destroyed_attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_destroy - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_destroy( NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_destroy - EINVAL (not initialized)" );
|
||||
status = pthread_attr_destroy( &destroyed_attr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* check some errors in pthread_create */
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (attr not initialized)" );
|
||||
status = pthread_create( &Task_id, &destroyed_attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* junk stack address */
|
||||
status = pthread_attr_setstackaddr( &attr, (void *)&schedparam );
|
||||
assert( !status );
|
||||
|
||||
/* must go around pthread_attr_setstacksize to set a bad stack size */
|
||||
attr.stacksize = 0;
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (stacksize too small)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* reset all the fields */
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
attr.stacksize = rtems_configuration_get_work_space_size() * 10;
|
||||
puts( "Init: pthread_create - EAGAIN (stacksize too large)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EAGAIN );
|
||||
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
/* must go around pthread_attr_set routines to set a bad value */
|
||||
attr.inheritsched = -1;
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (invalid inherit scheduler)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* check out the error case for system scope not supported */
|
||||
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
/* must go around pthread_attr_set routines to set a bad value */
|
||||
attr.contentionscope = PTHREAD_SCOPE_SYSTEM;
|
||||
|
||||
puts( "Init: pthread_create - ENOTSUP (unsupported system contention scope)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == ENOTSUP );
|
||||
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
/* now check out pthread_create for inherit scheduler */
|
||||
|
||||
status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_create - SUCCESSFUL (inherit scheduler)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_join( Task_id, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* switch to Task_1 */
|
||||
|
||||
/* exercise get and set scope */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_setscope - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setscope( NULL, PTHREAD_SCOPE_PROCESS );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setscope - ENOTSUP" );
|
||||
status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
|
||||
assert( status == ENOTSUP );
|
||||
|
||||
puts( "Init: pthread_attr_setscope - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_setscope( &destroyed_attr, PTHREAD_SCOPE_PROCESS );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setscope - EINVAL (invalid scope)" );
|
||||
status = pthread_attr_setscope( &attr, -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setscope - SUCCESSFUL" );
|
||||
status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_PROCESS );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getscope - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getscope( NULL, &scope );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getscope - EINVAL (NULL scope)" );
|
||||
status = pthread_attr_getscope( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getscope - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getscope( &destroyed_attr, &scope );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getscope - SUCCESSFUL" );
|
||||
status = pthread_attr_getscope( &attr, &scope );
|
||||
assert( !status );
|
||||
printf( "Init: current scope attribute = %d\n", scope );
|
||||
|
||||
/* exercise get and set inherit scheduler */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_setinheritsched - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setinheritsched( NULL, PTHREAD_INHERIT_SCHED );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)" );
|
||||
status =
|
||||
pthread_attr_setinheritsched( &destroyed_attr, PTHREAD_INHERIT_SCHED );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" );
|
||||
status = pthread_attr_setinheritsched( &attr, -1 );
|
||||
assert( status == ENOTSUP );
|
||||
|
||||
puts( "Init: pthread_attr_setinheritsched - SUCCESSFUL" );
|
||||
status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getinheritsched( NULL, &inheritsched );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" );
|
||||
status = pthread_attr_getinheritsched( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getinheritsched( &destroyed_attr, &inheritsched );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getinheritsched - SUCCESSFUL" );
|
||||
status = pthread_attr_getinheritsched( &attr, &inheritsched );
|
||||
assert( !status );
|
||||
printf( "Init: current inherit scheduler attribute = %d\n", inheritsched );
|
||||
|
||||
/* exercise get and set inherit scheduler */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setschedpolicy( NULL, SCHED_FIFO );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)" );
|
||||
status =
|
||||
pthread_attr_setschedpolicy( &destroyed_attr, SCHED_OTHER );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" );
|
||||
status = pthread_attr_setschedpolicy( &attr, -1 );
|
||||
assert( status == ENOTSUP );
|
||||
|
||||
puts( "Init: pthread_attr_setschedpolicy - SUCCESSFUL" );
|
||||
status = pthread_attr_setschedpolicy( &attr, SCHED_RR );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getschedpolicy( NULL, &schedpolicy );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" );
|
||||
status = pthread_attr_getschedpolicy( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getschedpolicy( &destroyed_attr, &schedpolicy );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getschedpolicy - SUCCESSFUL" );
|
||||
status = pthread_attr_getschedpolicy( &attr, &schedpolicy );
|
||||
assert( !status );
|
||||
printf( "Init: current scheduler policy attribute = %d\n", schedpolicy );
|
||||
|
||||
/* exercise get and set stack size */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_setstacksize - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setstacksize( NULL, 0 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setstacksize - EINVAL (not initialized attr)" );
|
||||
status =
|
||||
pthread_attr_setstacksize( &destroyed_attr, 0 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" );
|
||||
status = pthread_attr_setstacksize( &attr, 0 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" );
|
||||
status = pthread_attr_setstacksize( &attr, STACK_MINIMUM_SIZE * 2 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getstacksize - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getstacksize( NULL, &stacksize );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)" );
|
||||
status = pthread_attr_getstacksize( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstacksize - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getstacksize( &destroyed_attr, &stacksize );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstacksize - SUCCESSFUL" );
|
||||
status = pthread_attr_getstacksize( &attr, &stacksize );
|
||||
assert( !status );
|
||||
if ( stacksize == (STACK_MINIMUM_SIZE * 2) )
|
||||
printf( "Init: current stack size attribute is OK\n" );
|
||||
|
||||
/* exercise get and set stack address */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_setstackaddr - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setstackaddr( NULL, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)" );
|
||||
status =
|
||||
pthread_attr_setstackaddr( &destroyed_attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setstackaddr - SUCCESSFUL" );
|
||||
status = pthread_attr_setstackaddr( &attr, 0 );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getstackaddr( NULL, &stackaddr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" );
|
||||
status = pthread_attr_getstackaddr( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getstackaddr( &destroyed_attr, &stackaddr );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getstackaddr - SUCCESSFUL" );
|
||||
status = pthread_attr_getstackaddr( &attr, &stackaddr );
|
||||
assert( !status );
|
||||
printf( "Init: current stack address attribute = %p\n", stackaddr );
|
||||
|
||||
/* exercise get and set detach state */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_setdetachstate - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setdetachstate( NULL, PTHREAD_CREATE_DETACHED );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)" );
|
||||
status =
|
||||
pthread_attr_setdetachstate( &destroyed_attr, PTHREAD_CREATE_JOINABLE );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)" );
|
||||
status = pthread_attr_setdetachstate( &attr, -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setdetachstate - SUCCESSFUL" );
|
||||
status = pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getdetachstate( NULL, &detachstate );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" );
|
||||
status = pthread_attr_getdetachstate( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getdetachstate( &destroyed_attr, &detachstate );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getdetachstate - SUCCESSFUL" );
|
||||
status = pthread_attr_getdetachstate( &attr, &detachstate );
|
||||
assert( !status );
|
||||
printf( "Init: current detach state attribute = %d\n", detachstate );
|
||||
|
||||
/* exercise get and set scheduling parameters */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_attr_getschedparam - SUCCESSFUL" );
|
||||
status = pthread_attr_getschedparam( &attr, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
print_schedparam( "Init: ", &schedparam );
|
||||
|
||||
puts( "Init: pthread_attr_setschedparam - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_setschedparam( NULL, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setschedparam - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_setschedparam( &destroyed_attr, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)" );
|
||||
status = pthread_attr_setschedparam( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_setschedparam - SUCCESSFUL" );
|
||||
status = pthread_attr_setschedparam( &attr, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_attr_getschedparam - EINVAL (NULL attr)" );
|
||||
status = pthread_attr_getschedparam( NULL, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getschedparam - EINVAL (not initialized attr)" );
|
||||
status = pthread_attr_getschedparam( &destroyed_attr, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)" );
|
||||
status = pthread_attr_getschedparam( &attr, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* exercise pthread_getschedparam */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_getschedparam - EINVAL (NULL policy)" );
|
||||
status = pthread_getschedparam( pthread_self(), NULL, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_getschedparam - EINVAL (NULL schedparam)" );
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_getschedparam - ESRCH (bad thread)" );
|
||||
status = pthread_getschedparam( -1, &schedpolicy, &schedparam );
|
||||
assert( status == ESRCH );
|
||||
|
||||
puts( "Init: pthread_getschedparam - SUCCESSFUL" );
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
printf( "Init: policy = %d\n", schedpolicy );
|
||||
|
||||
print_schedparam( "Init: ", &schedparam );
|
||||
|
||||
/* exercise pthread_setschedparam */
|
||||
|
||||
empty_line();
|
||||
|
||||
puts( "Init: pthread_setschedparam - EINVAL (NULL schedparam)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
schedparam.sched_priority = -1;
|
||||
|
||||
puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
schedparam.sched_priority = 128;
|
||||
|
||||
puts( "Init: pthread_setschedparam - EINVAL (invalid policy)" );
|
||||
status = pthread_setschedparam( pthread_self(), -1, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_setschedparam - ESRCH (invalid thread)" );
|
||||
status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam );
|
||||
assert( status == ESRCH );
|
||||
|
||||
/* now get sporadic server errors */
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 1;
|
||||
schedparam.ss_replenish_period.tv_nsec = 0;
|
||||
schedparam.ss_initial_budget.tv_sec = 1;
|
||||
schedparam.ss_initial_budget.tv_nsec = 1;
|
||||
|
||||
puts( "Init: pthread_setschedparam - EINVAL (replenish < budget)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 2;
|
||||
schedparam.ss_replenish_period.tv_nsec = 0;
|
||||
schedparam.ss_initial_budget.tv_sec = 1;
|
||||
schedparam.ss_initial_budget.tv_nsec = 0;
|
||||
schedparam.ss_low_priority = -1;
|
||||
|
||||
puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "*** END OF POSIX TEST 7 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
*** POSIX TEST 7 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_attr_init - EINVAL (NULL attr)
|
||||
Init: pthread_attr_init - SUCCESSFUL
|
||||
Init: initialize and destroy an attribute - SUCCESSFUL
|
||||
Init: pthread_attr_destroy - EINVAL (NULL attr)
|
||||
Init: pthread_attr_destroy - EINVAL (not initialized)
|
||||
Init: pthread_create - EINVAL (attr not initialized)
|
||||
Init: pthread_create - EINVAL (stacksize too small)
|
||||
Init: pthread_create - EAGAIN (stacksize too large)
|
||||
Init: pthread_create - EINVAL (invalid inherit scheduler)
|
||||
Init: pthread_create - ENOTSUP (unsupported system contention scope)
|
||||
Init: pthread_create - SUCCESSFUL (inherit scheduler)
|
||||
Task_1: exitting
|
||||
Init: pthread_attr_setscope - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setscope - ENOTSUP
|
||||
Init: pthread_attr_setscope - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setscope - EINVAL (invalid scope)
|
||||
Init: pthread_attr_setscope - SUCCESSFUL
|
||||
Init: pthread_attr_getscope - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getscope - EINVAL (NULL scope)
|
||||
Init: pthread_attr_getscope - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getscope - SUCCESSFUL
|
||||
Init: current scope attribute = 0
|
||||
Init: pthread_attr_setinheritsched - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)
|
||||
Init: pthread_attr_setinheritsched - SUCCESSFUL
|
||||
Init: pthread_attr_getinheritsched - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)
|
||||
Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getinheritsched - SUCCESSFUL
|
||||
Init: current inherit scheduler attribute = 1
|
||||
Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)
|
||||
Init: pthread_attr_setschedpolicy - SUCCESSFUL
|
||||
Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)
|
||||
Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getschedpolicy - SUCCESSFUL
|
||||
Init: current scheduler policy attribute = 2
|
||||
Init: pthread_attr_setstacksize - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setstacksize - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)
|
||||
Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)
|
||||
Init: pthread_attr_getstacksize - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)
|
||||
Init: pthread_attr_getstacksize - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getstacksize - SUCCESSFUL
|
||||
Init: current stack size attribute is OK
|
||||
Init: pthread_attr_setstackaddr - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setstackaddr - SUCCESSFUL
|
||||
Init: pthread_attr_getstackaddr - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)
|
||||
Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getstackaddr - SUCCESSFUL
|
||||
Init: current stack address attribute = 0x0
|
||||
Init: pthread_attr_setdetachstate - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)
|
||||
Init: pthread_attr_setdetachstate - SUCCESSFUL
|
||||
Init: pthread_attr_getdetachstate - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)
|
||||
Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getdetachstate - SUCCESSFUL
|
||||
Init: current detach state attribute = 1
|
||||
Init: pthread_attr_getschedparam - SUCCESSFUL
|
||||
Init: sched priority = 2
|
||||
Init: ss_low_priority = 0
|
||||
Init: ss_replenish_period = (0, 0)
|
||||
Init: ss_initial_budget = (0, 0)
|
||||
Init: pthread_attr_setschedparam - EINVAL (NULL attr)
|
||||
Init: pthread_attr_setschedparam - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)
|
||||
Init: pthread_attr_setschedparam - SUCCESSFUL
|
||||
Init: pthread_attr_getschedparam - EINVAL (NULL attr)
|
||||
Init: pthread_attr_getschedparam - EINVAL (not initialized attr)
|
||||
Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)
|
||||
Init: pthread_getschedparam - EINVAL (NULL policy)
|
||||
Init: pthread_getschedparam - EINVAL (NULL schedparam)
|
||||
Init: pthread_getschedparam - ESRCH (bad thread)
|
||||
Init: pthread_getschedparam - SUCCESSFUL
|
||||
Init: policy = 1
|
||||
Init: sched priority = 2
|
||||
Init: ss_low_priority = 0
|
||||
Init: ss_replenish_period = (0, 0)
|
||||
Init: ss_initial_budget = (0, 0)
|
||||
Init: pthread_setschedparam - EINVAL (NULL schedparam)
|
||||
Init: pthread_setschedparam - EINVAL (invalid priority)
|
||||
Init: pthread_setschedparam - EINVAL (invalid policy)
|
||||
Init: pthread_setschedparam - ESRCH (invalid thread)
|
||||
Init: pthread_setschedparam - EINVAL (replenish < budget)
|
||||
Init: pthread_setschedparam - EINVAL (invalid priority)
|
||||
*** END OF POSIX TEST 7 ***
|
||||
@@ -1,50 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 3
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,33 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
puts( "Task_1: exitting" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx08
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task1.c task2.c task3.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,97 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
void *return_pointer;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 8 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
puts( "Init: pthread_detach - ESRCH (invalid id)" );
|
||||
status = pthread_detach( -1 );
|
||||
assert( status == ESRCH );
|
||||
|
||||
/* detach this thread */
|
||||
|
||||
puts( "Init: pthread_detach self" );
|
||||
status = pthread_detach( pthread_self() );
|
||||
assert( !status );
|
||||
|
||||
/* create thread */
|
||||
|
||||
status = pthread_create( &Task1_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
||||
status = pthread_join( -1, &return_pointer );
|
||||
assert( status == ESRCH );
|
||||
|
||||
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||
status = pthread_join( Task1_id, &return_pointer );
|
||||
|
||||
puts( "Init: returned from pthread_join through return" );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
if ( return_pointer == &Task1_id )
|
||||
puts( "Init: pthread_join returned correct pointer" );
|
||||
else
|
||||
printf(
|
||||
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||
return_pointer,
|
||||
&Task1_id
|
||||
);
|
||||
|
||||
puts( "Init: creating two pthreads" );
|
||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||
status = pthread_join( Task2_id, &return_pointer );
|
||||
/* assert is below comment */
|
||||
|
||||
puts( "Init: returned from pthread_join through pthread_exit" );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
if ( return_pointer == &Task2_id )
|
||||
puts( "Init: pthread_join returned correct pointer" );
|
||||
else
|
||||
printf(
|
||||
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||
return_pointer,
|
||||
&Task2_id
|
||||
);
|
||||
|
||||
puts( "Init: exitting" );
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
*** POSIX TEST 8 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_detach - ESRCH (invalid id)
|
||||
Init: pthread_detach self
|
||||
Init: pthread_join - ESRCH (invalid id)
|
||||
Init: pthread_join - SUCCESSFUL
|
||||
Task_1: exitting
|
||||
Init: returned from pthread_join through return
|
||||
Init: pthread_join returned correct pointer
|
||||
Init: creating two pthreads
|
||||
Init: pthread_join - SUCCESSFUL
|
||||
Task_2: sleep 1 second
|
||||
Task_3: join to Task_2
|
||||
Task_2: join to detached task (Init) -- EINVAL
|
||||
Task_2: join to self task (Init) -- EDEADLK
|
||||
Task_2: exitting
|
||||
Init: returned from pthread_join through pthread_exit
|
||||
Init: pthread_join returned correct pointer
|
||||
Init: exitting
|
||||
Task_3: returned from pthread_join
|
||||
Task_3: pthread_join returned correct pointer
|
||||
*** END OF POSIX TEST 8 ***
|
||||
@@ -1,60 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task1_id;
|
||||
TEST_EXTERN pthread_t Task2_id;
|
||||
TEST_EXTERN pthread_t Task3_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,31 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
puts( "Task_1: exitting" );
|
||||
|
||||
return( &Task1_id );
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* Task_2
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
puts( "Task_2: sleep 1 second" );
|
||||
|
||||
sleep( 1 );
|
||||
|
||||
/* switch to task 3 */
|
||||
|
||||
puts( "Task_2: join to detached task (Init) -- EINVAL" );
|
||||
status = pthread_join( Init_id, NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Task_2: join to self task (Init) -- EDEADLK" );
|
||||
status = pthread_join( pthread_self(), NULL );
|
||||
if ( status != EDEADLK )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EDEADLK );
|
||||
|
||||
puts( "Task_2: exitting" );
|
||||
|
||||
pthread_exit( &Task2_id );
|
||||
|
||||
/* switch to init task */
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Task_3
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
void *return_pointer;
|
||||
|
||||
puts( "Task_3: join to Task_2" );
|
||||
status = pthread_join( Task2_id, &return_pointer );
|
||||
puts( "Task_3: returned from pthread_join" );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
if ( return_pointer == &Task2_id )
|
||||
puts( "Task_3: pthread_join returned correct pointer" );
|
||||
else
|
||||
printf(
|
||||
"Task_3: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||
return_pointer,
|
||||
&Task2_id
|
||||
);
|
||||
|
||||
puts( "*** END OF POSIX TEST 8 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx09
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,225 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
)
|
||||
{
|
||||
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority );
|
||||
printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_replenish_period.tv_sec,
|
||||
schedparam->ss_replenish_period.tv_nsec );
|
||||
printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_initial_budget.tv_sec,
|
||||
schedparam->ss_initial_budget.tv_nsec );
|
||||
#else
|
||||
printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
int passes;
|
||||
int schedpolicy;
|
||||
int priority;
|
||||
struct sched_param schedparam;
|
||||
char buffer[ 80 ];
|
||||
pthread_mutexattr_t attr;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 9 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* try to use this thread as a sporadic server */
|
||||
|
||||
puts( "Init: pthread_getschedparam - SUCCESSFUL" );
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - current priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 0;
|
||||
schedparam.ss_replenish_period.tv_nsec = 500000000; /* 1/2 second */
|
||||
schedparam.ss_initial_budget.tv_sec = 0;
|
||||
schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */
|
||||
|
||||
schedparam.sched_priority = 200;
|
||||
schedparam.ss_low_priority = 100;
|
||||
|
||||
puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
/* go into a loop consuming CPU time to watch our priority change */
|
||||
|
||||
for ( passes=0 ; passes <= 3 ; ) {
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
if ( priority != schedparam.sched_priority ) {
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
passes++;
|
||||
}
|
||||
}
|
||||
|
||||
/* now see if this works if we are holding a priority ceiling mutex */
|
||||
|
||||
empty_line();
|
||||
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 0;
|
||||
schedparam.ss_replenish_period.tv_nsec = 500000000; /* 1/2 second */
|
||||
schedparam.ss_initial_budget.tv_sec = 0;
|
||||
schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */
|
||||
|
||||
#define HIGH_PRIORITY 150
|
||||
#define MEDIUM_PRIORITY 131
|
||||
#define LOW_PRIORITY 100
|
||||
|
||||
schedparam.sched_priority = HIGH_PRIORITY;
|
||||
schedparam.ss_low_priority = LOW_PRIORITY;
|
||||
|
||||
puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
|
||||
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Initializing mutex attributes for priority ceiling" );
|
||||
status = pthread_mutexattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutexattr_setprioceiling( &attr, MEDIUM_PRIORITY );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Creating a mutex" );
|
||||
status = pthread_mutex_init( &Mutex_id, &attr );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
/* go into a loop consuming CPU time to watch our priority lower */
|
||||
|
||||
for ( ; ; ) {
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
if ( schedparam.sched_priority != LOW_PRIORITY )
|
||||
continue;
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
puts( "Init: pthread_mutex_lock acquire the lock" );
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* now spin waiting for our budget to be replenished */
|
||||
|
||||
for ( ; ; ) {
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
if ( schedparam.sched_priority == HIGH_PRIORITY )
|
||||
break;
|
||||
}
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
/* with this unlock we should be able to go to low priority */
|
||||
|
||||
puts( "Init: unlock mutex" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
if ( status )
|
||||
printf( "status = %d\n", status );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
for ( ; ; ) {
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
if ( schedparam.sched_priority == LOW_PRIORITY )
|
||||
break;
|
||||
}
|
||||
|
||||
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
priority = schedparam.sched_priority;
|
||||
sprintf( buffer, " - new priority = %d", priority );
|
||||
print_current_time( "Init: ", buffer );
|
||||
|
||||
puts( "*** END OF POSIX TEST 9 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
*** POSIX TEST 9 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_getschedparam - SUCCESSFUL
|
||||
Init: Fri May 24 11:05:00 1996 - current priority = 2
|
||||
Init: pthread_setschedparam - SUCCESSFUL (sporadic server)
|
||||
Init: Fri May 24 11:05:00 1996 - new priority = 200
|
||||
Init: Fri May 24 11:05:00 1996 - new priority = 100
|
||||
Init: Fri May 24 11:05:00 1996 - new priority = 200
|
||||
Init: Fri May 24 11:05:00 1996 - new priority = 100
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 200
|
||||
Init: pthread_setschedparam - SUCCESSFUL (sporadic server)
|
||||
Init: Initializing mutex attributes for priority ceiling
|
||||
Init: Creating a mutex
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 150
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 100
|
||||
Init: pthread_mutex_lock acquire the lock
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 131
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 150
|
||||
Init: unlock mutex
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 150
|
||||
Init: Fri May 24 11:05:01 1996 - new priority = 100
|
||||
*** END OF POSIX TEST 9 ***
|
||||
@@ -1,56 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
|
||||
#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx10
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c task2.c task3.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,311 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <sched.h>
|
||||
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
pthread_condattr_t attr;
|
||||
pthread_condattr_t attr_error;
|
||||
int pshared;
|
||||
pthread_cond_t cond;
|
||||
struct timespec timeout;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 10 ***" );
|
||||
|
||||
puts( "Init: pthread_condattr_init" );
|
||||
status = pthread_condattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_condattr_init - EINVAL (attribute invalid)" );
|
||||
status = pthread_condattr_init( NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_condattr_destroy" );
|
||||
status = pthread_condattr_destroy( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_condattr_destroy - EINVAL (attribute invalid)" );
|
||||
status = pthread_condattr_destroy( NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_condattr_init" );
|
||||
status = pthread_condattr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED" );
|
||||
status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_condattr_setpshared - PTHREAD_PROCESS_PRIVATE" );
|
||||
status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_condattr_setpshared - EINVAL (attribute invalid)" );
|
||||
|
||||
status = pthread_condattr_setpshared( &attr, 0xFFFFFF );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_condattr_setpshared - EINVAL (pshared invalid)" );
|
||||
|
||||
status = pthread_condattr_getpshared( &attr, &pshared );
|
||||
assert( !status );
|
||||
printf( "Init: pthread_condattr_getpshared - %d\n", pshared );
|
||||
|
||||
status = pthread_condattr_getpshared( NULL, &pshared );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_condattr_getpshared - EINVAL (attribute invalid)" );
|
||||
|
||||
puts( "Init: pthread_cond_init - NULL attr" );
|
||||
status = pthread_cond_init( &cond, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* error for attribute not initialized */
|
||||
|
||||
attr_error.is_initialized = FALSE;
|
||||
status = pthread_cond_init( &cond, &attr_error );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_init - EINVAL (attr not initialized)" );
|
||||
|
||||
status = pthread_cond_init( &cond, NULL );
|
||||
if ( status != ENOMEM )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == ENOMEM );
|
||||
puts( "Init: pthread_cond_init - ENOMEM (too many conds)" );
|
||||
|
||||
puts( "Init: pthread_cond_destroy" );
|
||||
status = pthread_cond_destroy( &cond );
|
||||
assert( !status );
|
||||
|
||||
/* error for bad condition variable passed */
|
||||
|
||||
status = pthread_cond_destroy( NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_destroy - EINVAL (cond invalid)" );
|
||||
|
||||
/* initiailize the attribute for the rest of the test */
|
||||
|
||||
puts( "Init: pthread_cond_init - attr" );
|
||||
status = pthread_cond_init( &Cond1_id, &attr );
|
||||
assert( !status );
|
||||
|
||||
/* signal task1 with a condition variable */
|
||||
|
||||
empty_line();
|
||||
|
||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task1 to allow it to wait for a condition variable */
|
||||
|
||||
puts( "Init: sleep to switch to Task_1" );
|
||||
sleep( 1 );
|
||||
|
||||
status = pthread_cond_destroy( &Cond1_id );
|
||||
if ( status != EBUSY )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EBUSY );
|
||||
puts( "Init: pthread_cond_destroy - EBUSY (task1 waiting)" );
|
||||
|
||||
puts( "Init: pthread_cond_signal" );
|
||||
status = pthread_cond_signal( &Cond1_id );
|
||||
assert( !status );
|
||||
|
||||
empty_line();
|
||||
|
||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task1 and task2 to allow them to wait for broadcast signal */
|
||||
|
||||
puts( "Init: sleep - switch to Task_1 and Task_2" );
|
||||
sleep( 1 );
|
||||
|
||||
/* broadcast a condition variable to task1 and task2 */
|
||||
|
||||
puts( "Init: pthread_cond_broadcast" );
|
||||
status = pthread_cond_broadcast( &Cond1_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep - switch to Task_1" );
|
||||
sleep( 0 );
|
||||
|
||||
/* timedwait case - timeout */
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
/* set timeout to 3 seconds */
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &timeout );
|
||||
assert( !status );
|
||||
timeout.tv_sec += 3;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
puts( "Init: pthread_cond_timedwait for 3 seconds" );
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
if ( status != ETIMEDOUT )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == ETIMEDOUT );
|
||||
puts( "Init: pthread_cond_timedwait - ETIMEDOUT - (mutex not acquired)" );
|
||||
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
/* remaining error messages */
|
||||
|
||||
empty_line();
|
||||
|
||||
/* errors for bad variable passed */
|
||||
|
||||
status = pthread_cond_signal( NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_signal - EINVAL (cond invalid)" );
|
||||
|
||||
status = pthread_cond_broadcast( NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_broadcast - EINVAL (cond invalid)" );
|
||||
|
||||
/* acquire mutex so errors will occur */
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_cond_wait( NULL, &Mutex_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_wait - EINVAL (cond invalid)" );
|
||||
|
||||
status = pthread_cond_timedwait( NULL, &Mutex_id, &timeout );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_timedwait - EINVAL (cond invalid)" );
|
||||
|
||||
status = pthread_cond_wait( &Cond1_id, NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_wait - EINVAL (mutex invalid)" );
|
||||
|
||||
status = pthread_cond_timedwait( &Cond1_id, NULL, &timeout );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_timedwait - EINVAL (mutex invalid)" );
|
||||
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, NULL );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Init: pthread_cond_timedwait - EINVAL (abstime NULL)" );
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &timeout );
|
||||
assert( !status );
|
||||
timeout.tv_sec -= 1;
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
if ( status != ETIMEDOUT )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == ETIMEDOUT );
|
||||
puts( "Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_sec < current time)" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
status = clock_gettime( CLOCK_REALTIME, &timeout );
|
||||
assert( !status );
|
||||
timeout.tv_nsec -= 1;
|
||||
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
if ( status != ETIMEDOUT )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == ETIMEDOUT );
|
||||
puts( "Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_nsec < current time)" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
/* wait and timedwait without mutex */
|
||||
|
||||
/* XXX - this case is commented out in the code pending review
|
||||
*
|
||||
* status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
* if ( status != EINVAL )
|
||||
* printf( "status = %d\n", status );
|
||||
* assert( status == EINVAL );
|
||||
*/
|
||||
puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" );
|
||||
|
||||
/* XXX - this case is commented out in the code pending review
|
||||
*
|
||||
* status = clock_gettime( CLOCK_REALTIME, &timeout );
|
||||
* assert( !status );
|
||||
* timeout.tv_sec += 1;
|
||||
* status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
|
||||
* if ( status != EINVAL )
|
||||
* printf( "status = %d\n", status );
|
||||
* assert( status == EINVAL );
|
||||
*/
|
||||
puts( "Init: pthread_cond_timedwait - EINVAL (mutex not locked before call)");
|
||||
|
||||
empty_line();
|
||||
|
||||
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task3 to allow it to wait for broadcast signal */
|
||||
|
||||
puts( "Init: sleep - switch to Task_3" );
|
||||
sleep( 1 );
|
||||
|
||||
/* destroy the mutex so Task3 can not acguire at the end of Wait_support */
|
||||
|
||||
status = pthread_mutex_destroy( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
/* signal a condition variable to task3 */
|
||||
|
||||
puts( "Init: pthread_cond_signal" );
|
||||
status = pthread_cond_signal( &Cond1_id );
|
||||
|
||||
puts( "Init: sleep - switch to Task_3" );
|
||||
sleep( 1 );
|
||||
|
||||
puts( "*** END OF POSIX TEST 10 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
*** POSIX TEST 10 ***
|
||||
Init: pthread_condattr_init
|
||||
Init: pthread_condattr_init - EINVAL (attribute invalid)
|
||||
Init: pthread_condattr_destroy
|
||||
Init: pthread_condattr_destroy - EINVAL (attribute invalid)
|
||||
Init: pthread_condattr_init
|
||||
Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED
|
||||
Init: pthread_condattr_setpshared - PTHREAD_PROCESS_PRIVATE
|
||||
Init: pthread_condattr_setpshared - EINVAL (attribute invalid)
|
||||
Init: pthread_condattr_setpshared - EINVAL (pshared invalid)
|
||||
Init: pthread_condattr_getpshared - 0
|
||||
Init: pthread_condattr_getpshared - EINVAL (attribute invalid)
|
||||
Init: pthread_cond_init - NULL attr
|
||||
Init: pthread_cond_init - EINVAL (attr not initialized)
|
||||
Init: pthread_cond_init - ENOMEM (too many conds)
|
||||
Init: pthread_cond_destroy
|
||||
Init: pthread_cond_destroy - EINVAL (cond invalid)
|
||||
Init: pthread_cond_init - attr
|
||||
Init: sleep to switch to Task_1
|
||||
Task_1: ID is 0x0b010002
|
||||
Task_1: pthread_cond_wait
|
||||
Init: pthread_cond_destroy - EBUSY (task1 waiting)
|
||||
Init: pthread_cond_signal
|
||||
Init: sleep - switch to Task_1 and Task_2
|
||||
Task_1: back from pthread_cond_wait release mutex
|
||||
Task_1: pthread_cond_wait
|
||||
Task_2: ID is 0x0b010003
|
||||
Task_2: pthread_cond_wait
|
||||
Init: pthread_cond_broadcast
|
||||
Init: sleep - switch to Task_1
|
||||
Task_1: back from pthread_cond_wait release mutex
|
||||
Task_1: task exit
|
||||
Task_2: back from pthread_cond_wait release mutex
|
||||
Task_2: task exit
|
||||
Init: pthread_cond_timedwait for 3 seconds
|
||||
Init: pthread_cond_timedwait - ETIMEDOUT - (mutex not acquired)
|
||||
Init: pthread_cond_signal - EINVAL (cond invalid)
|
||||
Init: pthread_cond_broadcast - EINVAL (cond invalid)
|
||||
Init: pthread_cond_wait - EINVAL (cond invalid)
|
||||
Init: pthread_cond_timedwait - EINVAL (cond invalid)
|
||||
Init: pthread_cond_wait - EINVAL (mutex invalid)
|
||||
Init: pthread_cond_timedwait - EINVAL (mutex invalid)
|
||||
Init: pthread_cond_timedwait - EINVAL (abstime NULL)
|
||||
Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_sec < current time)
|
||||
Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_nsec < current time)
|
||||
Init: pthread_cond_wait - EINVAL (mutex not locked before call)
|
||||
Init: pthread_cond_timedwait - EINVAL (mutex not locked before call)
|
||||
Init: sleep - switch to Task_3
|
||||
Task_3: ID is 0x0b010004
|
||||
Task_3: pthread_cond_wait
|
||||
Init: pthread_cond_signal
|
||||
Init: sleep - switch to Task_3
|
||||
Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)
|
||||
Task_3: task exit
|
||||
*** END OF POSIX TEST 10 ***
|
||||
@@ -1,66 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
|
||||
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
TEST_EXTERN pthread_t Task2_id;
|
||||
TEST_EXTERN pthread_t Task3_id;
|
||||
TEST_EXTERN pthread_cond_t Cond1_id;
|
||||
TEST_EXTERN pthread_mutex_t Mutex_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,64 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
/* wait for a condition variable signal from Init */
|
||||
|
||||
Task_id = pthread_self();
|
||||
printf( "Task_1: ID is 0x%08x\n", Task_id );
|
||||
|
||||
status = pthread_mutex_init( &Mutex_id, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_cond_wait" );
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: back from pthread_cond_wait release mutex" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
/* wait for a condition variable broadcast from Init */
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_cond_wait" );
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: back from pthread_cond_wait release mutex" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: task exit" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/* Task_2
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void *Task_2(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
Task_id = pthread_self();
|
||||
printf( "Task_2: ID is 0x%08x\n", Task_id );
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_2: pthread_cond_wait" );
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_2: back from pthread_cond_wait release mutex" );
|
||||
status = pthread_mutex_unlock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_2: task exit" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Task_3
|
||||
*
|
||||
* This routine serves as a test task.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void *Task_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
Task_id = pthread_self();
|
||||
printf( "Task_3: ID is 0x%08x\n", Task_id );
|
||||
|
||||
status = pthread_mutex_lock( &Mutex_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_3: pthread_cond_wait" );
|
||||
status = pthread_cond_wait( &Cond1_id, &Mutex_id );
|
||||
if ( status != EINVAL )
|
||||
printf( "status = %d\n", status );
|
||||
assert( status == EINVAL );
|
||||
puts( "Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)");
|
||||
|
||||
puts( "Task_3: task exit" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx11
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct sched_param param;
|
||||
pthread_attr_t attr;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 11 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* exercise pthread_setschedparam */
|
||||
|
||||
param.sched_priority = 127;
|
||||
|
||||
puts( "Init: Setting scheduling parameters to FIFO with priority 127" );
|
||||
status = pthread_setschedparam( Init_id, SCHED_FIFO, ¶m );
|
||||
assert( !status );
|
||||
|
||||
param.sched_priority = 125;
|
||||
|
||||
puts( "Init: Setting scheduling parameters to RR with priority 125" );
|
||||
status = pthread_setschedparam( Init_id, SCHED_RR, ¶m );
|
||||
assert( !status );
|
||||
|
||||
param.sched_priority = 121;
|
||||
|
||||
puts( "Init: Setting scheduling parameters to OTHER with priority 121" );
|
||||
status = pthread_setschedparam( Init_id, SCHED_OTHER, ¶m );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread as SCHED_FIFO */
|
||||
|
||||
puts( "Init: create a thread of SCHED_FIFO with priority 120" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
attr.schedpolicy = SCHED_FIFO;
|
||||
attr.schedparam.sched_priority = 120;
|
||||
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: join with the other thread" );
|
||||
status = pthread_join( Task_id, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread as SCHED_RR */
|
||||
|
||||
puts( "Init: create a thread of SCHED_RR with priority 120" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
attr.schedpolicy = SCHED_RR;
|
||||
attr.schedparam.sched_priority = 120;
|
||||
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: join with the other thread" );
|
||||
status = pthread_join( Task_id, NULL );
|
||||
assert( !status );
|
||||
|
||||
/* create a thread as SCHED_OTHER */
|
||||
|
||||
puts( "Init: create a thread of SCHED_OTHER with priority 120" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
attr.schedpolicy = SCHED_OTHER;
|
||||
attr.schedparam.sched_priority = 120;
|
||||
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: join with the other thread" );
|
||||
status = pthread_join( Task_id, NULL );
|
||||
assert( !status );
|
||||
|
||||
puts( "*** END OF POSIX TEST 11 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
*** POSIX TEST 11 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: Setting scheduling parameters to FIFO with priority 127
|
||||
Init: Setting scheduling parameters to RR with priority 125
|
||||
Init: Setting scheduling parameters to OTHER with priority 121
|
||||
Init: create a thread of SCHED_FIFO with priority 120
|
||||
Init: join with the other thread
|
||||
Task_1: killing time
|
||||
Task_1: exitting
|
||||
Init: create a thread of SCHED_RR with priority 120
|
||||
Init: join with the other thread
|
||||
Task_1: killing time
|
||||
Task_1: exitting
|
||||
Init: create a thread of SCHED_OTHER with priority 120
|
||||
Init: join with the other thread
|
||||
Task_1: killing time
|
||||
Task_1: exitting
|
||||
*** END OF POSIX TEST 11 ***
|
||||
@@ -1,50 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,91 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
|
||||
void diff_timespec(
|
||||
struct timespec *start,
|
||||
struct timespec *stop,
|
||||
struct timespec *result
|
||||
)
|
||||
{
|
||||
int nsecs_per_sec = 1000000000;
|
||||
|
||||
result->tv_sec = stop->tv_sec - start->tv_sec;
|
||||
if ( stop->tv_nsec < start->tv_nsec ) {
|
||||
result->tv_nsec = nsecs_per_sec - start->tv_nsec + stop->tv_nsec;
|
||||
result->tv_sec--;
|
||||
} else
|
||||
result->tv_nsec = stop->tv_nsec - start->tv_nsec;
|
||||
|
||||
}
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct timespec start;
|
||||
struct timespec current;
|
||||
struct timespec difference;
|
||||
struct timespec delay;
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &start );
|
||||
assert( !status );
|
||||
|
||||
status = sched_rr_get_interval( getpid(), &delay );
|
||||
assert( !status );
|
||||
|
||||
/* double the rr interval for confidence */
|
||||
|
||||
delay.tv_sec *= 2;
|
||||
delay.tv_nsec *= 2;
|
||||
if ( delay.tv_nsec >= 1000000000 ) { /* handle overflow/carry */
|
||||
delay.tv_nsec -= 1000000000;
|
||||
delay.tv_sec++;
|
||||
}
|
||||
|
||||
|
||||
puts( "Task_1: killing time" );
|
||||
for ( ; ; ) {
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, ¤t );
|
||||
assert( !status );
|
||||
|
||||
diff_timespec( &start, ¤t, &difference );
|
||||
|
||||
if ( difference.tv_sec < delay.tv_sec )
|
||||
continue;
|
||||
|
||||
if ( difference.tv_sec > delay.tv_sec )
|
||||
break;
|
||||
|
||||
if ( difference.tv_nsec > delay.tv_nsec )
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
puts( "Task_1: exitting" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx12
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c task.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES = system.h
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,139 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
)
|
||||
{
|
||||
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority );
|
||||
printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_replenish_period.tv_sec,
|
||||
schedparam->ss_replenish_period.tv_nsec );
|
||||
printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
|
||||
schedparam->ss_initial_budget.tv_sec,
|
||||
schedparam->ss_initial_budget.tv_nsec );
|
||||
#else
|
||||
printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
pthread_attr_t attr;
|
||||
struct sched_param schedparam;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 12 ***" );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
|
||||
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
|
||||
|
||||
/* get id of this thread */
|
||||
|
||||
Init_id = pthread_self();
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
/* invalid scheduling policy error */
|
||||
|
||||
puts( "Init: pthread_attr_init - SUCCESSFUL" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
|
||||
assert( !status );
|
||||
attr.schedpolicy = -1;
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (invalid scheduling policy)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* replenish period < budget error */
|
||||
|
||||
puts( "Init: pthread_attr_init - SUCCESSFUL" );
|
||||
status = pthread_attr_init( &attr );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: set scheduling parameter attributes for sporadic server" );
|
||||
status = pthread_attr_setschedpolicy( &attr, SCHED_SPORADIC );
|
||||
assert( !status );
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 1;
|
||||
schedparam.ss_replenish_period.tv_nsec = 0;
|
||||
schedparam.ss_initial_budget.tv_sec = 2;
|
||||
schedparam.ss_initial_budget.tv_nsec = 0;
|
||||
|
||||
schedparam.sched_priority = 200;
|
||||
schedparam.ss_low_priority = 100;
|
||||
|
||||
status = pthread_attr_setschedparam( &attr, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (replenish < budget)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* invalid ss_low_priority error */
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 2;
|
||||
schedparam.ss_replenish_period.tv_nsec = 0;
|
||||
schedparam.ss_initial_budget.tv_sec = 1;
|
||||
schedparam.ss_initial_budget.tv_nsec = 0;
|
||||
|
||||
schedparam.sched_priority = 200;
|
||||
schedparam.ss_low_priority = -1;
|
||||
|
||||
status = pthread_attr_setschedparam( &attr, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_create - EINVAL (invalid ss_low_priority)" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( status == EINVAL );
|
||||
|
||||
/* create a thread as a sporadic server */
|
||||
|
||||
schedparam.ss_replenish_period.tv_sec = 2;
|
||||
schedparam.ss_replenish_period.tv_nsec = 0;
|
||||
schedparam.ss_initial_budget.tv_sec = 1;
|
||||
schedparam.ss_initial_budget.tv_nsec = 0;
|
||||
|
||||
schedparam.sched_priority = 200;
|
||||
schedparam.ss_low_priority = 100;
|
||||
|
||||
status = pthread_attr_setschedparam( &attr, &schedparam );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_create - SUCCESSFUL" );
|
||||
status = pthread_create( &Task_id, &attr, Task_1, NULL );
|
||||
assert( !status );
|
||||
|
||||
status = pthread_join( Task_id, NULL );
|
||||
assert( status );
|
||||
|
||||
/* switch to Task_1 */
|
||||
|
||||
puts( "*** END OF POSIX TEST 12 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
*** POSIX TEST 12 ***
|
||||
Init's ID is 0x0b010001
|
||||
Init: pthread_attr_init - SUCCESSFUL
|
||||
Init: pthread_create - EINVAL (invalid scheduling policy)
|
||||
Init: pthread_attr_init - SUCCESSFUL
|
||||
Init: set scheduling parameter attributes for sporadic server
|
||||
Init: pthread_create - EINVAL (replenish < budget)
|
||||
Init: pthread_create - EINVAL (invalid ss_low_priority)
|
||||
Init: pthread_create - SUCCESSFUL
|
||||
Task_1: exitting
|
||||
*** END OF POSIX TEST 12 ***
|
||||
@@ -1,52 +0,0 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||
#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
#define TEST_EXTERN
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
#endif
|
||||
|
||||
TEST_EXTERN pthread_t Init_id;
|
||||
TEST_EXTERN pthread_t Task_id;
|
||||
|
||||
/* end of include file */
|
||||
@@ -1,33 +0,0 @@
|
||||
/* Task_1
|
||||
*
|
||||
* This routine serves as a test task. It verifies the basic task
|
||||
* switching capabilities of the executive.
|
||||
*
|
||||
* Input parameters:
|
||||
* argument - task argument
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
|
||||
void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
puts( "Task_1: exitting" );
|
||||
pthread_exit( NULL );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,41 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psx13
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = main.c test.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Simple test program -- simplified version of sample test hello.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define TEST_INIT
|
||||
|
||||
#include <bsp.h>
|
||||
#include <pmacros.h>
|
||||
|
||||
void test_main( void );
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
{
|
||||
test_main();
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
|
||||
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* end of file */
|
||||
@@ -1,16 +0,0 @@
|
||||
*** POSIX TEST 13 ***
|
||||
|
||||
Files initialized successfully.
|
||||
Testing device_lseek()... Success.
|
||||
Testing dup()............ Success. ( Add when dup flags resolved )
|
||||
Testing dup2()........... Success.
|
||||
Testing fdatasync()...... Success.
|
||||
Testing umask().......... Success.
|
||||
Testing utime().......... Success.
|
||||
Testing pipe()........... Success.
|
||||
Testing fsync().......... Success.
|
||||
Testing pathconf()....... Success.
|
||||
Testing fpathconf()...... Success.
|
||||
|
||||
|
||||
*** END OF TEST PSX13 ***
|
||||
@@ -1,690 +0,0 @@
|
||||
/*
|
||||
* Psx13
|
||||
* Chris Bond (working under Jennifer's account)
|
||||
*
|
||||
* This test exercises the following routines:
|
||||
*
|
||||
* device_lseek - test implemented
|
||||
* dup - test implemented
|
||||
* dup2 - test implemented
|
||||
* fdatasync - test implemented
|
||||
* fsync - test implemented
|
||||
* pathconf - test implemented
|
||||
* fpathconf - test implemented
|
||||
* pipe - test implemented
|
||||
* umask - test implemented
|
||||
* utime - test implemented
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <utime.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
* InitFiles function
|
||||
*
|
||||
* Initializes the three files to be used in the test.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: fopen, fprintf, fwrite, FILE are available
|
||||
* actions: creates testfile1, a text file with 'a'..'z' listed 4 times.
|
||||
* creates testfile2, a text file with 'a'..'z' listed 4 times.
|
||||
* creates testfile3, a binary file with 0..9 listed 4 times.
|
||||
* returns: TRUE if files opened successfully.
|
||||
* FALSE if fail on file open for write.
|
||||
*
|
||||
* ------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int InitFiles (void) {
|
||||
|
||||
int count;
|
||||
FILE *fp1, *fp2, *fp3;
|
||||
char letter;
|
||||
int number;
|
||||
int retval;
|
||||
|
||||
fp1 = fopen("testfile1.tst", "wt");
|
||||
fp2 = fopen("testfile2.tst", "wt");
|
||||
fp3 = fopen("testfile4.tst", "wb");
|
||||
|
||||
if ((fp1 != NULL) && (fp2 != NULL) && (fp3 !=NULL)) {
|
||||
|
||||
letter = 'a';
|
||||
|
||||
for (count=0 ; count<(26*4); ++count) {
|
||||
fprintf (fp1, "%c", letter);
|
||||
fprintf (fp2, "%c", letter);
|
||||
|
||||
++letter;
|
||||
if (letter > 'z')
|
||||
letter = 'a';
|
||||
}
|
||||
|
||||
number = 0;
|
||||
|
||||
for (count = 0; count <40; ++count) {
|
||||
|
||||
fwrite (&number, 1, sizeof(int), fp3);
|
||||
|
||||
++number;
|
||||
if (number > 9)
|
||||
number = 0;
|
||||
}
|
||||
|
||||
fclose(fp1);
|
||||
fclose(fp2);
|
||||
fclose(fp3);
|
||||
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* DeviceLSeekTest function
|
||||
*
|
||||
* Hits the device_lseek code by lseeking on the console.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: lseek available
|
||||
* actions: hits lseek with some dummy arguments.
|
||||
* returns: value of return from lseek.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int DeviceLSeekTest (void) {
|
||||
|
||||
int error = -1, retval = FALSE;
|
||||
|
||||
int fd = open ("/dev/console", O_RDONLY);
|
||||
|
||||
error = lseek(fd, 5, SEEK_SET);
|
||||
|
||||
if (error == 0)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* DupTest function
|
||||
*
|
||||
* Hits the dup code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: dup, open, close, fcntl available.
|
||||
* actions: Gets a file descriptor(fd1) for test file1.
|
||||
* dups fd1 to fd2.
|
||||
* sets fd1 to append mode
|
||||
* checks fd2 to ensure it's in append mode, also.
|
||||
* returns: success if fd2 is indeed a copy of fd1.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int DupTest(void) {
|
||||
|
||||
int fd1, fd2;
|
||||
|
||||
int flags = 0, retval = FALSE;
|
||||
|
||||
fd1 = open ("testfile1.tst", O_RDONLY);
|
||||
fd2 = dup(fd1);
|
||||
|
||||
if (fd2 != -1) {
|
||||
|
||||
fcntl(fd1, F_SETFL, O_APPEND);
|
||||
flags = fcntl(fd2, F_GETFL);
|
||||
|
||||
close (fd1);
|
||||
|
||||
flags = (flags & O_APPEND);
|
||||
|
||||
retval = (flags == O_APPEND);
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* Dup2Test function
|
||||
*
|
||||
* Hits the dup2 code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: dup, dup2, open, close, fcntl available.
|
||||
* actions: Gets a file descriptor(fd1) for test file1.
|
||||
* dups fd1 to fd2.
|
||||
* sets fd1 to append mode
|
||||
* checks fd2 to ensure it's in append mode, also.
|
||||
* sets fd1 to invalid value, fd2 to valid, tries to dup2.
|
||||
* sets fd2 to invalid value, fd1 to valid tries to dup2.
|
||||
* returns: success if fd2 is a copy of fd1, and invalid fd1 or fd2 produce errors.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int Dup2Test(void) {
|
||||
|
||||
int fd1, fd2;
|
||||
|
||||
int flags = 0, retval = FALSE;
|
||||
|
||||
int error = 0;
|
||||
|
||||
fd1 = open ("testfile1.tst", O_RDONLY);
|
||||
fd2 = open ("testfile2.tst", O_RDONLY);
|
||||
error = dup2(fd1, fd2);
|
||||
|
||||
/* make sure dup2 works if both fd1 and fd2 are valid file descriptors. */
|
||||
|
||||
if (error != -1) {
|
||||
|
||||
fcntl(fd1, F_SETFL, O_APPEND);
|
||||
flags = fcntl(fd1, F_GETFL);
|
||||
|
||||
flags = (flags & O_APPEND);
|
||||
retval = (flags == O_APPEND);
|
||||
}
|
||||
|
||||
else {
|
||||
retval = FALSE;
|
||||
close(fd2);
|
||||
}
|
||||
|
||||
if (retval == TRUE) {
|
||||
|
||||
/* make sure dup2 fails correctly if one or the other arguments are invalid. */
|
||||
/* this assumes -1 is an invalid value for a file descriptor!!! (POSIX book, p.135) */
|
||||
|
||||
fd1 = -1;
|
||||
|
||||
if (dup2 (fd1, fd2) != -1)
|
||||
retval = FALSE;
|
||||
else {
|
||||
fd1 = dup(fd2);
|
||||
fd2 = -1;
|
||||
|
||||
if (dup2(fd1, fd2) != -1)
|
||||
retval = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
close (fd1);
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* FDataSyncTest function
|
||||
*
|
||||
* Hits the fdatasync code. Does NOT test the functionality of the
|
||||
* underlying fdatasync entry in the IMFS op table.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: open, close, fdatasync functions available.
|
||||
* actions: attempts to fdatasync a file descriptor flagged as read-only.
|
||||
* attempts to fdatasync an invalid file descriptor (-1).
|
||||
* attempts to fdatasync a perfectly valid fd opened as RDWR
|
||||
*
|
||||
* returns: TRUE if attempt to fdatasync invalid and read-only filed escriptor fail, and fdatasync succeeds on valid fd.
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FDataSyncTest(void) {
|
||||
|
||||
int fd = -1;
|
||||
int error = 0, retval = TRUE;
|
||||
|
||||
/* Try it with a RD_ONLY file. */
|
||||
|
||||
fd = open ("testfile1.tst", O_RDONLY);
|
||||
|
||||
error = fdatasync(fd);
|
||||
if ((error == -1) && (errno == EINVAL))
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
close (fd);
|
||||
|
||||
if (retval == TRUE) {
|
||||
|
||||
/* Try it with a bad file descriptor */
|
||||
|
||||
fd = -1;
|
||||
|
||||
error = fdatasync(fd);
|
||||
if ((errno == EBADF) && (error == -1))
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
/* Okay - now the success case... */
|
||||
|
||||
if (retval == TRUE) {
|
||||
fd = open ("testfile1.tst", O_RDWR);
|
||||
error = fdatasync(fd);
|
||||
|
||||
if (error == 0)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
close (fd);
|
||||
|
||||
}
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* UMaskTest function
|
||||
*
|
||||
* Hits the umask code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: umask function available.
|
||||
* actions: set umask to 0ctal 23.
|
||||
* set umask to Octal 22, retrieve the old value.
|
||||
*
|
||||
* returns: TRUE if old value is 23,
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int UMaskTest (void) {
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
|
||||
umask (023);
|
||||
error = umask(022);
|
||||
|
||||
if (error == 023)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* UTimeTest function
|
||||
*
|
||||
* Hits the utime code. Does NOT test the functionality of the underlying utime
|
||||
* entry in the IMFS op table.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: utime function available.
|
||||
* actions: set utime for an invalid filename.
|
||||
* set utime for a valid filename.
|
||||
*
|
||||
* returns: TRUE if time on valid file is set correctly and utime failed on an invaid filename.
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int UTimeTest (void) {
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
struct utimbuf time;
|
||||
struct stat fstat;
|
||||
|
||||
/* First, an invalid filename. */
|
||||
error = utime("!This is an =invalid p@thname!!! :)", NULL);
|
||||
|
||||
if (error == -1)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* Now, the success test. */
|
||||
if (retval == TRUE) {
|
||||
|
||||
time.actime = 12345;
|
||||
time.modtime = 54321;
|
||||
|
||||
error = utime("testfile1.tst", &time);
|
||||
|
||||
if (error == 0) {
|
||||
|
||||
/* But, did it set the time? */
|
||||
stat ("testfile1.tst", &fstat);
|
||||
|
||||
if ((fstat.st_atime == 12345) && (fstat.st_mtime == 54321 ))
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* PipeTest function
|
||||
*
|
||||
* Hits the pipe code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: pipe function available.
|
||||
* actions: call pipe.
|
||||
*
|
||||
* returns: TRUE if pipe retuens ENOSYS,
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int PipeTest (void) {
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
int fd[2];
|
||||
|
||||
error = pipe(fd);
|
||||
|
||||
if ((error == -1) && (errno == ENOSYS))
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* PathConfTest function
|
||||
*
|
||||
* Hits the pathconf code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: pathconf function available.
|
||||
* actions: Try to pathconf a bad filename.
|
||||
* Try to pathconf a good filename.
|
||||
*
|
||||
* returns: TRUE if pathconf fails on bad file, succeeds on good file.
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int PathConfTest (void) {
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
|
||||
error = pathconf("thisfiledoesnotexist", _PC_LINK_MAX);
|
||||
|
||||
if (error == -1) {
|
||||
error = pathconf("testfile1.tst", _PC_LINK_MAX);
|
||||
|
||||
if (error != -1)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* FPathConfTest function
|
||||
*
|
||||
* Hits the fpathconf code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: fpathconf function available.
|
||||
* actions: Call fpathconf with all arguments, plus an invalid.
|
||||
*
|
||||
* returns: TRUE always.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FPathConfTest (void) {
|
||||
|
||||
int error = 0, retval = TRUE;
|
||||
|
||||
int fd = -1;
|
||||
|
||||
error = fpathconf(fd, _PC_LINK_MAX);
|
||||
|
||||
if (error == -1) {
|
||||
fd = open("testfile1.tst", O_RDWR);
|
||||
|
||||
error = fpathconf(fd, _PC_LINK_MAX);
|
||||
error = fpathconf(fd, _PC_MAX_CANON);
|
||||
error = fpathconf(fd, _PC_MAX_INPUT);
|
||||
error = fpathconf(fd, _PC_NAME_MAX);
|
||||
error = fpathconf(fd, _PC_PATH_MAX);
|
||||
error = fpathconf(fd, _PC_PIPE_BUF);
|
||||
error = fpathconf(fd, _PC_CHOWN_RESTRICTED);
|
||||
error = fpathconf(fd, _PC_NO_TRUNC);
|
||||
error = fpathconf(fd, _PC_VDISABLE);
|
||||
error = fpathconf(fd, _PC_ASYNC_IO);
|
||||
error = fpathconf(fd, _PC_PRIO_IO);
|
||||
error = fpathconf(fd, _PC_SYNC_IO);
|
||||
error = fpathconf(fd, 255);
|
||||
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* FSyncTest function
|
||||
*
|
||||
* Hits the fsync code.
|
||||
*
|
||||
* arguments: none
|
||||
* assumptions: open, fsync functions available.
|
||||
* actions: open test file,
|
||||
* try to fsync it.
|
||||
*
|
||||
* returns: TRUE if fsync doesn't return -1,
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FSyncTest (void) {
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
int fd = -1;
|
||||
|
||||
fd = open("testfile1.tst", O_RDWR);
|
||||
|
||||
if (fd != -1) {
|
||||
|
||||
error = fsync(fd);
|
||||
|
||||
if (error != -1)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* Main function
|
||||
*
|
||||
* main entry point to the test
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(__rtems__)
|
||||
int test_main(void)
|
||||
#else
|
||||
int main(
|
||||
int argc,
|
||||
char **argv
|
||||
)
|
||||
#endif
|
||||
{
|
||||
puts( "*** POSIX TEST 13 ***" );
|
||||
|
||||
if (InitFiles() == TRUE) {
|
||||
printf ("\nFiles initialized successfully.\n");
|
||||
|
||||
printf ("Testing device_lseek()... ");
|
||||
if (DeviceLSeekTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing dup()............ ");
|
||||
if (DupTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing dup2()........... ");
|
||||
if (Dup2Test() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing fdatasync()...... ");
|
||||
if (FDataSyncTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing umask().......... ");
|
||||
if (UMaskTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing utime().......... ");
|
||||
if (UTimeTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing pipe()........... ");
|
||||
if (PipeTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing fsync().......... ");
|
||||
if (FSyncTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing pathconf()....... ");
|
||||
if (PathConfTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing fpathconf()...... ");
|
||||
if (FPathConfTest() == TRUE)
|
||||
printf ("Success.\n");
|
||||
else
|
||||
printf ("Failed!!!\n");
|
||||
|
||||
printf ("Testing sync()...... ");
|
||||
sync();
|
||||
}
|
||||
else
|
||||
printf ("\n\nError opening files for write!!!!\n");
|
||||
|
||||
printf( "\n\n*** END OF TEST PSX13 ***" );
|
||||
rtems_test_exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,44 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psxcancel
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = init.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
H_FILES =
|
||||
noinst_HEADERS = $(H_FILES)
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Thread Test Program
|
||||
*
|
||||
* - test of POSIX's pthread_init() function from rtemstask Init()
|
||||
*
|
||||
* ott@linux.thai.net
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef __rtems__
|
||||
#include <rtems.h>
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <bsp.h> /* for device driver prototypes */
|
||||
#include <pmacros.h>
|
||||
|
||||
rtems_task Init( rtems_task_argument argument);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 3
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 5
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 5
|
||||
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 5
|
||||
|
||||
#include <console.h>
|
||||
#include <confdefs.h>
|
||||
|
||||
#endif /* __rtems__ */
|
||||
|
||||
void countTaskDeferred() {
|
||||
int i=0;
|
||||
int type,state;
|
||||
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &state);
|
||||
while (1) {
|
||||
printf("countTaskDeferred: elapsed time (second): %2d\n", i++ );
|
||||
sleep(1);
|
||||
pthread_testcancel();
|
||||
}
|
||||
}
|
||||
|
||||
void countTaskAsync() {
|
||||
int i=0;
|
||||
int type,state;
|
||||
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &state);
|
||||
while (1) {
|
||||
printf("countTaskAsync: elapsed time (second): %2d\n", i++ );
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
int main(){
|
||||
#else
|
||||
rtems_task Init( rtems_task_argument ignored ) {
|
||||
#endif
|
||||
|
||||
pthread_t count;
|
||||
int taskparameter = 0;
|
||||
|
||||
puts( "\n\n*** POSIX CANCEL TEST ***" );
|
||||
|
||||
/* Start countTask deferred */
|
||||
{
|
||||
int task_ret;
|
||||
task_ret = pthread_create(&count, NULL, (void *) countTaskDeferred, (void *) &taskparameter);
|
||||
if (task_ret) {
|
||||
perror("pthread_create: countTask");
|
||||
rtems_test_exit(EXIT_FAILURE);
|
||||
}
|
||||
/* sleep for 5 seconds, then cancel it */
|
||||
sleep(5);
|
||||
pthread_cancel(count);
|
||||
pthread_join(count,NULL);
|
||||
}
|
||||
|
||||
/* Start countTask asynchronous */
|
||||
{
|
||||
int task_ret;
|
||||
task_ret = pthread_create(&count, NULL, (void *) countTaskAsync, (void *) &taskparameter);
|
||||
if (task_ret) {
|
||||
perror("pthread_create: countTask");
|
||||
rtems_test_exit(EXIT_FAILURE);
|
||||
}
|
||||
/* sleep for 5 seconds, then cancel it */
|
||||
sleep(5);
|
||||
pthread_cancel(count);
|
||||
pthread_join(count,NULL);
|
||||
}
|
||||
|
||||
|
||||
puts( "*** END OF POSIX CANCEL TEST ***" );
|
||||
|
||||
#ifdef __linux__
|
||||
return 0;
|
||||
#else
|
||||
rtems_test_exit(EXIT_SUCCESS);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
|
||||
*** POSIX CANCEL TEST ***
|
||||
countTaskDeferred: elapsed time (second): 0
|
||||
countTaskDeferred: elapsed time (second): 1
|
||||
countTaskDeferred: elapsed time (second): 2
|
||||
countTaskDeferred: elapsed time (second): 3
|
||||
countTaskDeferred: elapsed time (second): 4
|
||||
countTaskAsync: elapsed time (second): 0
|
||||
countTaskAsync: elapsed time (second): 1
|
||||
countTaskAsync: elapsed time (second): 2
|
||||
countTaskAsync: elapsed time (second): 3
|
||||
countTaskAsync: elapsed time (second): 4
|
||||
*** END OF POSIX CANCEL TEST ***
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,41 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
TEST = psxchroot01
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
C_FILES = main.c test.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
DOCTYPES = scn
|
||||
DOCS = $(DOCTYPES:%=$(TEST).%)
|
||||
|
||||
SRCS = $(DOCS) $(C_FILES) $(H_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
PRINT_SRCS = $(DOCS)
|
||||
|
||||
PGM = ${ARCH}/$(TEST).exe
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
include $(top_srcdir)/psxtests.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
${PGM}: $(OBJS) $(LINK_FILES)
|
||||
$(make-exe)
|
||||
|
||||
all-local: $(ARCH) $(TMPINSTALL_FILES)
|
||||
|
||||
EXTRA_DIST = $(C_FILES) $(DOCS)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Simple test program -- simplified version of sample test hello.
|
||||
*/
|
||||
|
||||
#define TEST_INIT
|
||||
|
||||
#include <bsp.h>
|
||||
#include <pmacros.h>
|
||||
|
||||
void test_main( void );
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
{
|
||||
test_main();
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
|
||||
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
|
||||
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* end of file */
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
|
||||
*** CHROOT01 TEST ***
|
||||
SUCCESS on /one/one.test
|
||||
SUCCESS on /two/two.test
|
||||
Reset the private environment
|
||||
SUCCESS on /one/one.test
|
||||
SUCCESS on /two/two.test
|
||||
*** END OF CHROOT01 TEST ***
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user