From 0b520cb71804b355cf141ea5c5596aabed711824 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 6 Nov 2019 19:28:29 +0100 Subject: mptests: Avoid build system defined defines Update #3818. --- testsuites/mptests/Makefile.am | 104 +++++++++---------- testsuites/mptests/mp01/init.c | 96 ------------------ testsuites/mptests/mp01/init1.c | 2 + testsuites/mptests/mp01/init2.c | 2 + testsuites/mptests/mp01/initimpl.h | 96 ++++++++++++++++++ testsuites/mptests/mp03/init.c | 65 ------------ testsuites/mptests/mp03/init1.c | 2 + testsuites/mptests/mp03/init2.c | 2 + testsuites/mptests/mp03/initimpl.h | 65 ++++++++++++ testsuites/mptests/mp04/init.c | 60 ----------- testsuites/mptests/mp04/init1.c | 2 + testsuites/mptests/mp04/init2.c | 2 + testsuites/mptests/mp04/initimpl.h | 60 +++++++++++ testsuites/mptests/mp05/init.c | 65 ------------ testsuites/mptests/mp05/init1.c | 2 + testsuites/mptests/mp05/init2.c | 2 + testsuites/mptests/mp05/initimpl.h | 65 ++++++++++++ testsuites/mptests/mp06/init.c | 65 ------------ testsuites/mptests/mp06/init1.c | 2 + testsuites/mptests/mp06/init2.c | 2 + testsuites/mptests/mp06/initimpl.h | 65 ++++++++++++ testsuites/mptests/mp07/init.c | 65 ------------ testsuites/mptests/mp07/init1.c | 2 + testsuites/mptests/mp07/init2.c | 2 + testsuites/mptests/mp07/initimpl.h | 65 ++++++++++++ testsuites/mptests/mp08/init.c | 74 -------------- testsuites/mptests/mp08/init1.c | 2 + testsuites/mptests/mp08/init2.c | 2 + testsuites/mptests/mp08/initimpl.h | 74 ++++++++++++++ testsuites/mptests/mp09/init.c | 74 -------------- testsuites/mptests/mp09/init1.c | 2 + testsuites/mptests/mp09/init2.c | 2 + testsuites/mptests/mp09/initimpl.h | 74 ++++++++++++++ testsuites/mptests/mp10/init.c | 144 --------------------------- testsuites/mptests/mp10/init1.c | 2 + testsuites/mptests/mp10/init2.c | 2 + testsuites/mptests/mp10/initimpl.h | 144 +++++++++++++++++++++++++++ testsuites/mptests/mp11/init.c | 106 -------------------- testsuites/mptests/mp11/init1.c | 2 + testsuites/mptests/mp11/init2.c | 2 + testsuites/mptests/mp11/initimpl.h | 106 ++++++++++++++++++++ testsuites/mptests/mp12/init.c | 114 --------------------- testsuites/mptests/mp12/init1.c | 2 + testsuites/mptests/mp12/init2.c | 2 + testsuites/mptests/mp12/initimpl.h | 114 +++++++++++++++++++++ testsuites/mptests/mp13/init.c | 115 --------------------- testsuites/mptests/mp13/init1.c | 2 + testsuites/mptests/mp13/init2.c | 2 + testsuites/mptests/mp13/initimpl.h | 115 +++++++++++++++++++++ testsuites/mptests/mp14/init.c | 198 ------------------------------------- testsuites/mptests/mp14/init1.c | 2 + testsuites/mptests/mp14/init2.c | 2 + testsuites/mptests/mp14/initimpl.h | 198 +++++++++++++++++++++++++++++++++++++ 53 files changed, 1345 insertions(+), 1293 deletions(-) delete mode 100644 testsuites/mptests/mp01/init.c create mode 100644 testsuites/mptests/mp01/init1.c create mode 100644 testsuites/mptests/mp01/init2.c create mode 100644 testsuites/mptests/mp01/initimpl.h delete mode 100644 testsuites/mptests/mp03/init.c create mode 100644 testsuites/mptests/mp03/init1.c create mode 100644 testsuites/mptests/mp03/init2.c create mode 100644 testsuites/mptests/mp03/initimpl.h delete mode 100644 testsuites/mptests/mp04/init.c create mode 100644 testsuites/mptests/mp04/init1.c create mode 100644 testsuites/mptests/mp04/init2.c create mode 100644 testsuites/mptests/mp04/initimpl.h delete mode 100644 testsuites/mptests/mp05/init.c create mode 100644 testsuites/mptests/mp05/init1.c create mode 100644 testsuites/mptests/mp05/init2.c create mode 100644 testsuites/mptests/mp05/initimpl.h delete mode 100644 testsuites/mptests/mp06/init.c create mode 100644 testsuites/mptests/mp06/init1.c create mode 100644 testsuites/mptests/mp06/init2.c create mode 100644 testsuites/mptests/mp06/initimpl.h delete mode 100644 testsuites/mptests/mp07/init.c create mode 100644 testsuites/mptests/mp07/init1.c create mode 100644 testsuites/mptests/mp07/init2.c create mode 100644 testsuites/mptests/mp07/initimpl.h delete mode 100644 testsuites/mptests/mp08/init.c create mode 100644 testsuites/mptests/mp08/init1.c create mode 100644 testsuites/mptests/mp08/init2.c create mode 100644 testsuites/mptests/mp08/initimpl.h delete mode 100644 testsuites/mptests/mp09/init.c create mode 100644 testsuites/mptests/mp09/init1.c create mode 100644 testsuites/mptests/mp09/init2.c create mode 100644 testsuites/mptests/mp09/initimpl.h delete mode 100644 testsuites/mptests/mp10/init.c create mode 100644 testsuites/mptests/mp10/init1.c create mode 100644 testsuites/mptests/mp10/init2.c create mode 100644 testsuites/mptests/mp10/initimpl.h delete mode 100644 testsuites/mptests/mp11/init.c create mode 100644 testsuites/mptests/mp11/init1.c create mode 100644 testsuites/mptests/mp11/init2.c create mode 100644 testsuites/mptests/mp11/initimpl.h delete mode 100644 testsuites/mptests/mp12/init.c create mode 100644 testsuites/mptests/mp12/init1.c create mode 100644 testsuites/mptests/mp12/init2.c create mode 100644 testsuites/mptests/mp12/initimpl.h delete mode 100644 testsuites/mptests/mp13/init.c create mode 100644 testsuites/mptests/mp13/init1.c create mode 100644 testsuites/mptests/mp13/init2.c create mode 100644 testsuites/mptests/mp13/initimpl.h delete mode 100644 testsuites/mptests/mp14/init.c create mode 100644 testsuites/mptests/mp14/init1.c create mode 100644 testsuites/mptests/mp14/init2.c create mode 100644 testsuites/mptests/mp14/initimpl.h (limited to 'testsuites/mptests') diff --git a/testsuites/mptests/Makefile.am b/testsuites/mptests/Makefile.am index 6ddb2e80cc..d947cb6986 100644 --- a/testsuites/mptests/Makefile.am +++ b/testsuites/mptests/Makefile.am @@ -19,14 +19,14 @@ if TEST_mp01 mp_tests += mp01_node1 mp_screens += mp01/mp01-node1.scn mp_docs += mp01/mp01-node1.doc -mp01_node1_SOURCES = mp01/init.c mp01/task1.c mp01/system.h -mp01_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp01) \ +mp01_node1_SOURCES = mp01/init1.c mp01/task1.c mp01/system.h +mp01_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp01) \ $(support_includes) mp_tests += mp01_node2 mp_screens += mp01/mp01-node2.scn mp_docs += mp01/mp01-node2.doc -mp01_node2_SOURCES = mp01/init.c mp01/task1.c mp01/system.h -mp01_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp01) \ +mp01_node2_SOURCES = mp01/init2.c mp01/task1.c mp01/system.h +mp01_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp01) \ $(support_includes) endif endif @@ -36,14 +36,14 @@ if TEST_mp03 mp_tests += mp03_node1 mp_screens += mp03/mp03-node1.scn mp_docs += mp03/mp03-node1.doc -mp03_node1_SOURCES = mp03/init.c mp03/task1.c mp03/delay.c mp03/system.h -mp03_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp03) \ +mp03_node1_SOURCES = mp03/init1.c mp03/task1.c mp03/delay.c mp03/system.h +mp03_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp03) \ $(support_includes) mp_tests += mp03_node2 mp_screens += mp03/mp03-node2.scn mp_docs += mp03/mp03-node2.doc -mp03_node2_SOURCES = mp03/init.c mp03/task1.c mp03/delay.c mp03/system.h -mp03_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp03) \ +mp03_node2_SOURCES = mp03/init2.c mp03/task1.c mp03/delay.c mp03/system.h +mp03_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp03) \ $(support_includes) endif endif @@ -53,14 +53,14 @@ if TEST_mp04 mp_tests += mp04_node1 mp_screens += mp04/mp04-node1.scn mp_docs += mp04/mp04-node1.doc -mp04_node1_SOURCES = mp04/init.c mp04/task1.c mp04/system.h -mp04_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp04) \ +mp04_node1_SOURCES = mp04/init1.c mp04/task1.c mp04/system.h +mp04_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp04) \ $(support_includes) mp_tests += mp04_node2 mp_screens += mp04/mp04-node2.scn mp_docs += mp04/mp04-node2.doc -mp04_node2_SOURCES = mp04/init.c mp04/task1.c mp04/system.h -mp04_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp04) \ +mp04_node2_SOURCES = mp04/init2.c mp04/task1.c mp04/system.h +mp04_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp04) \ $(support_includes) endif endif @@ -70,14 +70,14 @@ if TEST_mp05 mp_tests += mp05_node1 mp_screens += mp05/mp05-node1.scn mp_docs += mp05/mp05-node1.doc -mp05_node1_SOURCES = mp05/init.c mp05/task1.c mp05/asr.c mp05/system.h -mp05_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp05) \ +mp05_node1_SOURCES = mp05/init1.c mp05/task1.c mp05/asr.c mp05/system.h +mp05_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp05) \ $(support_includes) mp_tests += mp05_node2 mp_screens += mp05/mp05-node2.scn mp_docs += mp05/mp05-node2.doc -mp05_node2_SOURCES = mp05/init.c mp05/task1.c mp05/asr.c mp05/system.h -mp05_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp05) \ +mp05_node2_SOURCES = mp05/init2.c mp05/task1.c mp05/asr.c mp05/system.h +mp05_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp05) \ $(support_includes) endif endif @@ -87,14 +87,14 @@ if TEST_mp06 mp_tests += mp06_node1 mp_screens += mp06/mp06-node1.scn mp_docs += mp06/mp06-node1.doc -mp06_node1_SOURCES = mp06/init.c mp06/task1.c mp06/system.h -mp06_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp06) \ +mp06_node1_SOURCES = mp06/init1.c mp06/task1.c mp06/system.h +mp06_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp06) \ $(support_includes) mp_tests += mp06_node2 mp_screens += mp06/mp06-node2.scn mp_docs += mp06/mp06-node2.doc -mp06_node2_SOURCES = mp06/init.c mp06/task1.c mp06/system.h -mp06_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp06) \ +mp06_node2_SOURCES = mp06/init2.c mp06/task1.c mp06/system.h +mp06_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp06) \ $(support_includes) endif endif @@ -104,14 +104,14 @@ if TEST_mp07 mp_tests += mp07_node1 mp_screens += mp07/mp07-node1.scn mp_docs += mp07/mp07-node1.doc -mp07_node1_SOURCES = mp07/init.c mp07/task1.c mp07/system.h -mp07_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp07) \ +mp07_node1_SOURCES = mp07/init1.c mp07/task1.c mp07/system.h +mp07_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp07) \ $(support_includes) mp_tests += mp07_node2 mp_screens += mp07/mp07-node2.scn mp_docs += mp07/mp07-node2.doc -mp07_node2_SOURCES = mp07/init.c mp07/task1.c mp07/system.h -mp07_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp07) \ +mp07_node2_SOURCES = mp07/init2.c mp07/task1.c mp07/system.h +mp07_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp07) \ $(support_includes) endif endif @@ -121,14 +121,14 @@ if TEST_mp08 mp_tests += mp08_node1 mp_screens += mp08/mp08-node1.scn mp_docs += mp08/mp08-node1.doc -mp08_node1_SOURCES = mp08/init.c mp08/task1.c mp08/system.h -mp08_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp08) \ +mp08_node1_SOURCES = mp08/init1.c mp08/task1.c mp08/system.h +mp08_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp08) \ $(support_includes) mp_tests += mp08_node2 mp_screens += mp08/mp08-node2.scn mp_docs += mp08/mp08-node2.doc -mp08_node2_SOURCES = mp08/init.c mp08/task1.c mp08/system.h -mp08_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp08) \ +mp08_node2_SOURCES = mp08/init2.c mp08/task1.c mp08/system.h +mp08_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp08) \ $(support_includes) endif endif @@ -138,16 +138,16 @@ if TEST_mp09 mp_tests += mp09_node1 mp_screens += mp09/mp09-node1.scn mp_docs += mp09/mp09-node1.doc -mp09_node1_SOURCES = mp09/init.c mp09/task1.c mp09/recvmsg.c \ +mp09_node1_SOURCES = mp09/init1.c mp09/task1.c mp09/recvmsg.c \ mp09/sendmsg.c mp09/system.h -mp09_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp09) \ +mp09_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp09) \ $(support_includes) mp_tests += mp09_node2 mp_screens += mp09/mp09-node2.scn mp_docs += mp09/mp09-node2.doc -mp09_node2_SOURCES = mp09/init.c mp09/task1.c mp09/recvmsg.c \ +mp09_node2_SOURCES = mp09/init2.c mp09/task1.c mp09/recvmsg.c \ mp09/sendmsg.c mp09/system.h -mp09_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp09) \ +mp09_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp09) \ $(support_includes) endif endif @@ -157,16 +157,16 @@ if TEST_mp10 mp_tests += mp10_node1 mp_screens += mp10/mp10-node1.scn mp_docs += mp10/mp10-node1.doc -mp10_node1_SOURCES = mp10/init.c mp10/task1.c mp10/task2.c mp10/task3.c \ +mp10_node1_SOURCES = mp10/init1.c mp10/task1.c mp10/task2.c mp10/task3.c \ mp10/system.h -mp10_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp10) \ +mp10_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp10) \ $(support_includes) mp_tests += mp10_node2 mp_screens += mp10/mp10-node2.scn mp_docs += mp10/mp10-node2.doc -mp10_node2_SOURCES = mp10/init.c mp10/task1.c mp10/task2.c mp10/task3.c \ +mp10_node2_SOURCES = mp10/init2.c mp10/task1.c mp10/task2.c mp10/task3.c \ mp10/system.h -mp10_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp10) \ +mp10_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp10) \ $(support_includes) endif endif @@ -176,14 +176,14 @@ if TEST_mp11 mp_tests += mp11_node1 mp_screens += mp11/mp11-node1.scn mp_docs += mp11/mp11-node1.doc -mp11_node1_SOURCES = mp11/init.c mp11/system.h -mp11_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp11) \ +mp11_node1_SOURCES = mp11/init1.c mp11/system.h +mp11_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp11) \ $(support_includes) mp_tests += mp11_node2 mp_screens += mp11/mp11-node2.scn mp_docs += mp11/mp11-node2.doc -mp11_node2_SOURCES = mp11/init.c mp11/system.h -mp11_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp11) \ +mp11_node2_SOURCES = mp11/init2.c mp11/system.h +mp11_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp11) \ $(support_includes) endif endif @@ -193,14 +193,14 @@ if TEST_mp12 mp_tests += mp12_node1 mp_screens += mp12/mp12-node1.scn mp_docs += mp12/mp12-node1.doc -mp12_node1_SOURCES = mp12/init.c mp12/system.h -mp12_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp12) \ +mp12_node1_SOURCES = mp12/init1.c mp12/system.h +mp12_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp12) \ $(support_includes) mp_tests += mp12_node2 mp_screens += mp12/mp12-node2.scn mp_docs += mp12/mp12-node2.doc -mp12_node2_SOURCES = mp12/init.c mp12/system.h -mp12_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp12) \ +mp12_node2_SOURCES = mp12/init2.c mp12/system.h +mp12_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp12) \ $(support_includes) endif endif @@ -210,14 +210,14 @@ if TEST_mp13 mp_tests += mp13_node1 mp_screens += mp13/mp13-node1.scn mp_docs += mp13/mp13-node1.doc -mp13_node1_SOURCES = mp13/init.c mp13/task1.c mp13/task2.c mp13/system.h -mp13_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp13) \ +mp13_node1_SOURCES = mp13/init1.c mp13/task1.c mp13/task2.c mp13/system.h +mp13_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp13) \ $(support_includes) mp_tests += mp13_node2 mp_screens += mp13/mp13-node2.scn mp_docs += mp13/mp13-node2.doc -mp13_node2_SOURCES = mp13/init.c mp13/task1.c mp13/task2.c mp13/system.h -mp13_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp13) \ +mp13_node2_SOURCES = mp13/init2.c mp13/task1.c mp13/task2.c mp13/system.h +mp13_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp13) \ $(support_includes) endif endif @@ -227,18 +227,18 @@ if TEST_mp14 mp_tests += mp14_node1 mp_screens += mp14/mp14-node1.scn mp_docs += mp14/mp14-node1.doc -mp14_node1_SOURCES = mp14/init.c mp14/exit.c mp14/delay.c \ +mp14_node1_SOURCES = mp14/init1.c mp14/exit.c mp14/delay.c \ mp14/evtask1.c mp14/evtmtask.c mp14/pttask1.c mp14/smtask1.c \ mp14/msgtask1.c mp14/system.h -mp14_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_mp14) \ +mp14_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp14) \ $(support_includes) mp_tests += mp14_node2 mp_screens += mp14/mp14-node2.scn mp_docs += mp14/mp14-node2.doc -mp14_node2_SOURCES = mp14/init.c mp14/exit.c mp14/delay.c \ +mp14_node2_SOURCES = mp14/init2.c mp14/exit.c mp14/delay.c \ mp14/evtask1.c mp14/evtmtask.c mp14/pttask1.c mp14/smtask1.c \ mp14/msgtask1.c mp14/system.h -mp14_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_mp14) \ +mp14_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mp14) \ $(support_includes) endif endif diff --git a/testsuites/mptests/mp01/init.c b/testsuites/mptests/mp01/init.c deleted file mode 100644 index d5017af643..0000000000 --- a/testsuites/mptests/mp01/init.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_time_of_day time; - char c; - - printf( - "\n\n*** TEST 1 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - if ( Multiprocessing_configuration.node != 1 ) c = 'S'; - else c = 'M'; - - Task_name[ 1 ] = rtems_build_name( c, 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( c, 'A', '2', ' ' ); - Task_name[ 3 ] = rtems_build_name( c, 'A', '3', ' ' ); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - puts( "Creating task 1 (Global)" ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of Task 1" ); - - puts( "Creating task 2 (Global)" ); - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of Task 2" ); - - puts( "Creating task 3 (Local)" ); - status = rtems_task_create( - Task_name[ 3 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of Task 3" ); - - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start of Task 1" ); - - status = rtems_task_start( Task_id[ 2 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start of Task 2" ); - - status = rtems_task_start( Task_id[ 3 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start of Task 3" ); - - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp01/init1.c b/testsuites/mptests/mp01/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp01/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp01/init2.c b/testsuites/mptests/mp01/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp01/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp01/initimpl.h b/testsuites/mptests/mp01/initimpl.h new file mode 100644 index 0000000000..d5017af643 --- /dev/null +++ b/testsuites/mptests/mp01/initimpl.h @@ -0,0 +1,96 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + rtems_time_of_day time; + char c; + + printf( + "\n\n*** TEST 1 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + if ( Multiprocessing_configuration.node != 1 ) c = 'S'; + else c = 'M'; + + Task_name[ 1 ] = rtems_build_name( c, 'A', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( c, 'A', '2', ' ' ); + Task_name[ 3 ] = rtems_build_name( c, 'A', '3', ' ' ); + + build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + + puts( "Creating task 1 (Global)" ); + status = rtems_task_create( + Task_name[ 1 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create of Task 1" ); + + puts( "Creating task 2 (Global)" ); + status = rtems_task_create( + Task_name[ 2 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Task_id[ 2 ] + ); + directive_failed( status, "rtems_task_create of Task 2" ); + + puts( "Creating task 3 (Local)" ); + status = rtems_task_create( + Task_name[ 3 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 3 ] + ); + directive_failed( status, "rtems_task_create of Task 3" ); + + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start of Task 1" ); + + status = rtems_task_start( Task_id[ 2 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start of Task 2" ); + + status = rtems_task_start( Task_id[ 3 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start of Task 3" ); + + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp03/init.c b/testsuites/mptests/mp03/init.c deleted file mode 100644 index 533d32175a..0000000000 --- a/testsuites/mptests/mp03/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 3 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[ Multiprocessing_configuration.node ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp03/init1.c b/testsuites/mptests/mp03/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp03/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp03/init2.c b/testsuites/mptests/mp03/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp03/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp03/initimpl.h b/testsuites/mptests/mp03/initimpl.h new file mode 100644 index 0000000000..533d32175a --- /dev/null +++ b/testsuites/mptests/mp03/initimpl.h @@ -0,0 +1,65 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 3 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[ Multiprocessing_configuration.node ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_NO_PREEMPT, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + + status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); + directive_failed( status, "rtems_timer_create" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp04/init.c b/testsuites/mptests/mp04/init.c deleted file mode 100644 index 3e3d8cd32f..0000000000 --- a/testsuites/mptests/mp04/init.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 4 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[ Multiprocessing_configuration.node ], - Multiprocessing_configuration.node, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp04/init1.c b/testsuites/mptests/mp04/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp04/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp04/init2.c b/testsuites/mptests/mp04/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp04/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp04/initimpl.h b/testsuites/mptests/mp04/initimpl.h new file mode 100644 index 0000000000..3e3d8cd32f --- /dev/null +++ b/testsuites/mptests/mp04/initimpl.h @@ -0,0 +1,60 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 4 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[ Multiprocessing_configuration.node ], + Multiprocessing_configuration.node, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp05/init.c b/testsuites/mptests/mp05/init.c deleted file mode 100644 index a2d4002fde..0000000000 --- a/testsuites/mptests/mp05/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 5 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[Multiprocessing_configuration.node], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp05/init1.c b/testsuites/mptests/mp05/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp05/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp05/init2.c b/testsuites/mptests/mp05/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp05/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp05/initimpl.h b/testsuites/mptests/mp05/initimpl.h new file mode 100644 index 0000000000..a2d4002fde --- /dev/null +++ b/testsuites/mptests/mp05/initimpl.h @@ -0,0 +1,65 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 5 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[Multiprocessing_configuration.node], + 1, + RTEMS_MINIMUM_STACK_SIZE * 2, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + + status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); + directive_failed( status, "rtems_timer_create" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp06/init.c b/testsuites/mptests/mp06/init.c deleted file mode 100644 index 5598d328b0..0000000000 --- a/testsuites/mptests/mp06/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 6 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[Multiprocessing_configuration.node], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp06/init1.c b/testsuites/mptests/mp06/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp06/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp06/init2.c b/testsuites/mptests/mp06/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp06/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp06/initimpl.h b/testsuites/mptests/mp06/initimpl.h new file mode 100644 index 0000000000..5598d328b0 --- /dev/null +++ b/testsuites/mptests/mp06/initimpl.h @@ -0,0 +1,65 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 6 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[Multiprocessing_configuration.node], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + + status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); + directive_failed( status, "rtems_timer_create" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp07/init.c b/testsuites/mptests/mp07/init.c deleted file mode 100644 index 1aa51a3d79..0000000000 --- a/testsuites/mptests/mp07/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 7 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[Multiprocessing_configuration.node], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp07/init1.c b/testsuites/mptests/mp07/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp07/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp07/init2.c b/testsuites/mptests/mp07/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp07/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp07/initimpl.h b/testsuites/mptests/mp07/initimpl.h new file mode 100644 index 0000000000..1aa51a3d79 --- /dev/null +++ b/testsuites/mptests/mp07/initimpl.h @@ -0,0 +1,65 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 7 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[Multiprocessing_configuration.node], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + + status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); + directive_failed( status, "rtems_timer_create" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp08/init.c b/testsuites/mptests/mp08/init.c deleted file mode 100644 index 859b3114bf..0000000000 --- a/testsuites/mptests/mp08/init.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 8 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', '\0' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Creating Sempahore (Global)" ); - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 1, - RTEMS_GLOBAL, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - } - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[ Multiprocessing_configuration.node ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (Global)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp08/init1.c b/testsuites/mptests/mp08/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp08/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp08/init2.c b/testsuites/mptests/mp08/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp08/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp08/initimpl.h b/testsuites/mptests/mp08/initimpl.h new file mode 100644 index 0000000000..859b3114bf --- /dev/null +++ b/testsuites/mptests/mp08/initimpl.h @@ -0,0 +1,74 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 8 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', '\0' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Creating Sempahore (Global)" ); + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_GLOBAL, + RTEMS_NO_PRIORITY, + &Semaphore_id[ 1 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + } + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[ Multiprocessing_configuration.node ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp09/init.c b/testsuites/mptests/mp09/init.c deleted file mode 100644 index 97237c34f1..0000000000 --- a/testsuites/mptests/mp09/init.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 9 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Creating Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 3, - 16, - RTEMS_GLOBAL, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create" ); - } - - puts( "Creating Test_task (local)" ); - status = rtems_task_create( - Task_name[Multiprocessing_configuration.node], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task (local)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp09/init1.c b/testsuites/mptests/mp09/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp09/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp09/init2.c b/testsuites/mptests/mp09/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp09/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp09/initimpl.h b/testsuites/mptests/mp09/initimpl.h new file mode 100644 index 0000000000..97237c34f1 --- /dev/null +++ b/testsuites/mptests/mp09/initimpl.h @@ -0,0 +1,74 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 9 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Creating Message Queue (Global)" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + 16, + RTEMS_GLOBAL, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create" ); + } + + puts( "Creating Test_task (local)" ); + status = rtems_task_create( + Task_name[Multiprocessing_configuration.node], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (local)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp10/init.c b/testsuites/mptests/mp10/init.c deleted file mode 100644 index b5c5a200f4..0000000000 --- a/testsuites/mptests/mp10/init.c +++ /dev/null @@ -1,144 +0,0 @@ -/* Init - * - * This routine is the initialization routine for this test program. - * Other than creating all objects needed by this test, if this routine - * is running on node one, it acquires a global semaphore to - * force all other tasks to pend. If running on node two, this task - * sleeps for a while, and then deletes two local tasks which are - * waiting on a remote message queue or a semaphore. - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 10 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - Task_name[ 3 ] = rtems_build_name( 'S', 'A', '3', ' ' ); - - Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); - - Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Creating Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 3, - 16, - RTEMS_GLOBAL, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create" ); - - puts( "Creating Semaphore (Global)" ); - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 0, - RTEMS_GLOBAL | RTEMS_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - - status = rtems_task_wake_after( 10 * rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - - } else { - - puts( "Creating Test_task 1 (local)" ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task 1 (local)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Test_task 2 (local)" ); - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task 2 (local)" ); - status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Test_task 3 (local)" ); - status = rtems_task_create( - Task_name[ 3 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task 3 (local)" ); - status = rtems_task_start( Task_id[ 3 ], Test_task2, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Sleeping for 1 seconds ..." ); - status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "Deleting Test_task2" ); - status = rtems_task_delete( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_delete of Task 2" ); - - puts( "Deleting Test_task1" ); - status = rtems_task_delete( Task_id[ 1 ] ); - directive_failed( status, "rtems_task_delete of Task 1" ); - - puts( "Restarting Test_task3" ); - status = rtems_task_restart( Task_id[ 3 ], 1 ); - directive_failed( status, "rtems_task_restart of Task 3" ); - - } - puts( "*** END OF TEST 10 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp10/init1.c b/testsuites/mptests/mp10/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp10/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp10/init2.c b/testsuites/mptests/mp10/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp10/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp10/initimpl.h b/testsuites/mptests/mp10/initimpl.h new file mode 100644 index 0000000000..b5c5a200f4 --- /dev/null +++ b/testsuites/mptests/mp10/initimpl.h @@ -0,0 +1,144 @@ +/* Init + * + * This routine is the initialization routine for this test program. + * Other than creating all objects needed by this test, if this routine + * is running on node one, it acquires a global semaphore to + * force all other tasks to pend. If running on node two, this task + * sleeps for a while, and then deletes two local tasks which are + * waiting on a remote message queue or a semaphore. + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-2009. + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 10 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); + Task_name[ 3 ] = rtems_build_name( 'S', 'A', '3', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Creating Message Queue (Global)" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + 16, + RTEMS_GLOBAL, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create" ); + + puts( "Creating Semaphore (Global)" ); + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 0, + RTEMS_GLOBAL | RTEMS_PRIORITY, + RTEMS_NO_PRIORITY, + &Semaphore_id[ 1 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + + status = rtems_task_wake_after( 10 * rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + + } else { + + puts( "Creating Test_task 1 (local)" ); + status = rtems_task_create( + Task_name[ 1 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task 1 (local)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Test_task 2 (local)" ); + status = rtems_task_create( + Task_name[ 2 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 2 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task 2 (local)" ); + status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Test_task 3 (local)" ); + status = rtems_task_create( + Task_name[ 3 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 3 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task 3 (local)" ); + status = rtems_task_start( Task_id[ 3 ], Test_task2, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Sleeping for 1 seconds ..." ); + status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "Deleting Test_task2" ); + status = rtems_task_delete( Task_id[ 2 ] ); + directive_failed( status, "rtems_task_delete of Task 2" ); + + puts( "Deleting Test_task1" ); + status = rtems_task_delete( Task_id[ 1 ] ); + directive_failed( status, "rtems_task_delete of Task 1" ); + + puts( "Restarting Test_task3" ); + status = rtems_task_restart( Task_id[ 3 ], 1 ); + directive_failed( status, "rtems_task_restart of Task 3" ); + + } + puts( "*** END OF TEST 10 ***" ); + rtems_test_exit( 0 ); +} diff --git a/testsuites/mptests/mp11/init.c b/testsuites/mptests/mp11/init.c deleted file mode 100644 index e44b151597..0000000000 --- a/testsuites/mptests/mp11/init.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Init - * - * This routine is the initialization and test routine for - * this test program. It attempts to create more global - * objects than are configured (zero should be configured). - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -uint8_t my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT; - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id junk_id; - rtems_status_code status; - - printf( - "\n\n*** TEST 11 -- NODE %" PRIu32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); - - Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Attempting to create Test_task (Global)" ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_GLOBAL, - &junk_id - ); - fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" ); - puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" ); - - puts( "Attempting to create Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 3, - 16, - RTEMS_GLOBAL, - &junk_id - ); - fatal_directive_status( - status, - RTEMS_TOO_MANY, - "rtems_message_queue_create" - ); - puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" ); - - puts( "Attempting to create Semaphore (Global)" ); - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 1, - RTEMS_GLOBAL, - RTEMS_NO_PRIORITY, - &junk_id - ); - fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" ); - puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" ); - - puts( "Attempting to create Partition (Global)" ); - status = rtems_partition_create( - 1, - (uint8_t *) my_partition, - 128, - 64, - RTEMS_GLOBAL, - &junk_id - ); - fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" ); - puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" ); - } - puts( "*** END OF TEST 11 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp11/init1.c b/testsuites/mptests/mp11/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp11/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp11/init2.c b/testsuites/mptests/mp11/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp11/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp11/initimpl.h b/testsuites/mptests/mp11/initimpl.h new file mode 100644 index 0000000000..e44b151597 --- /dev/null +++ b/testsuites/mptests/mp11/initimpl.h @@ -0,0 +1,106 @@ +/* Init + * + * This routine is the initialization and test routine for + * this test program. It attempts to create more global + * objects than are configured (zero should be configured). + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +uint8_t my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT; + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_id junk_id; + rtems_status_code status; + + printf( + "\n\n*** TEST 11 -- NODE %" PRIu32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Attempting to create Test_task (Global)" ); + status = rtems_task_create( + Task_name[ 1 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_GLOBAL, + &junk_id + ); + fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" ); + puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" ); + + puts( "Attempting to create Message Queue (Global)" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + 16, + RTEMS_GLOBAL, + &junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_message_queue_create" + ); + puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" ); + + puts( "Attempting to create Semaphore (Global)" ); + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_GLOBAL, + RTEMS_NO_PRIORITY, + &junk_id + ); + fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" ); + puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" ); + + puts( "Attempting to create Partition (Global)" ); + status = rtems_partition_create( + 1, + (uint8_t *) my_partition, + 128, + 64, + RTEMS_GLOBAL, + &junk_id + ); + fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" ); + puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" ); + } + puts( "*** END OF TEST 11 ***" ); + rtems_test_exit( 0 ); +} diff --git a/testsuites/mptests/mp12/init.c b/testsuites/mptests/mp12/init.c deleted file mode 100644 index 7486e664c6..0000000000 --- a/testsuites/mptests/mp12/init.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Init - * - * This routine is the initialization routine and test code for - * global partitions. It creates a global partition, obtains and - * releases a buffer, and deletes the partition. The partition - * is created on node one, and an attempt is made to delete it - * by node two. - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -uint8_t Partition_area[ 1024 ] CPU_STRUCTURE_ALIGNMENT; - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - void *bufaddr; - - printf( - "\n\n*** TEST 12 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' ); - - puts( "Got to initialization task" ); - - if ( Multiprocessing_configuration.node == 2 ) { - status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "Getting ID of remote Partition (Global)" ); - - do { - status = rtems_partition_ident( - Partition_name[ 1 ], - RTEMS_SEARCH_ALL_NODES, - &Partition_id[ 1 ] - ); - } while ( !rtems_is_status_successful( status ) ); - - puts( "Attempting to delete remote Partition (Global)" ); - status = rtems_partition_delete( Partition_id[ 1 ] ); - fatal_directive_status( - status, - RTEMS_ILLEGAL_ON_REMOTE_OBJECT, - "rtems_partition_delete" - ); - puts( - "rtems_partition_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT" - ); - - puts( "Obtaining a buffer from the global partition" ); - status = rtems_partition_get_buffer( Partition_id[ 1 ], &bufaddr ); - directive_failed( status, "rtems_partition_get_buffer" ); - printf( "Address returned was : 0x%p\n", bufaddr ); - - puts( "Releasing a buffer to the global partition" ); - status = rtems_partition_return_buffer( Partition_id[ 1 ], bufaddr ); - directive_failed( status, "rtems_partition_return_buffer" ); - - status = rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - } - else { - puts( "Creating Partition (Global)" ); - status = rtems_partition_create( - Partition_name[ 1 ], - Partition_area, - 128, - 64, - RTEMS_GLOBAL, - &Partition_id[ 1 ] - ); - directive_failed( status, "rtems_partition_create" ); - - puts( "Sleeping for two seconds" ); - status = rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "Deleting Partition (Global)" ); - status = rtems_partition_delete( Partition_id[ 1 ] ); - directive_failed( status, "rtems_partition_delete" ); - } - puts( "*** END OF TEST 12 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp12/init1.c b/testsuites/mptests/mp12/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp12/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp12/init2.c b/testsuites/mptests/mp12/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp12/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp12/initimpl.h b/testsuites/mptests/mp12/initimpl.h new file mode 100644 index 0000000000..7486e664c6 --- /dev/null +++ b/testsuites/mptests/mp12/initimpl.h @@ -0,0 +1,114 @@ +/* Init + * + * This routine is the initialization routine and test code for + * global partitions. It creates a global partition, obtains and + * releases a buffer, and deletes the partition. The partition + * is created on node one, and an attempt is made to delete it + * by node two. + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-2009. + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +uint8_t Partition_area[ 1024 ] CPU_STRUCTURE_ALIGNMENT; + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + void *bufaddr; + + printf( + "\n\n*** TEST 12 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' ); + + puts( "Got to initialization task" ); + + if ( Multiprocessing_configuration.node == 2 ) { + status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "Getting ID of remote Partition (Global)" ); + + do { + status = rtems_partition_ident( + Partition_name[ 1 ], + RTEMS_SEARCH_ALL_NODES, + &Partition_id[ 1 ] + ); + } while ( !rtems_is_status_successful( status ) ); + + puts( "Attempting to delete remote Partition (Global)" ); + status = rtems_partition_delete( Partition_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_ILLEGAL_ON_REMOTE_OBJECT, + "rtems_partition_delete" + ); + puts( + "rtems_partition_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT" + ); + + puts( "Obtaining a buffer from the global partition" ); + status = rtems_partition_get_buffer( Partition_id[ 1 ], &bufaddr ); + directive_failed( status, "rtems_partition_get_buffer" ); + printf( "Address returned was : 0x%p\n", bufaddr ); + + puts( "Releasing a buffer to the global partition" ); + status = rtems_partition_return_buffer( Partition_id[ 1 ], bufaddr ); + directive_failed( status, "rtems_partition_return_buffer" ); + + status = rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + } + else { + puts( "Creating Partition (Global)" ); + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_area, + 128, + 64, + RTEMS_GLOBAL, + &Partition_id[ 1 ] + ); + directive_failed( status, "rtems_partition_create" ); + + puts( "Sleeping for two seconds" ); + status = rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "Deleting Partition (Global)" ); + status = rtems_partition_delete( Partition_id[ 1 ] ); + directive_failed( status, "rtems_partition_delete" ); + } + puts( "*** END OF TEST 12 ***" ); + rtems_test_exit( 0 ); +} diff --git a/testsuites/mptests/mp13/init.c b/testsuites/mptests/mp13/init.c deleted file mode 100644 index af5456919b..0000000000 --- a/testsuites/mptests/mp13/init.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - printf( - "\n\n*** TEST 13 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); - - Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Creating Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 3, - 16, - RTEMS_GLOBAL, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create" ); - - puts( "Creating Semaphore (Global)" ); - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 1, - RTEMS_GLOBAL | RTEMS_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain" ); - } - - puts( "Creating Test_task 1 (local)" ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task 1 (local)" ); - status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Test_task 2 (local)" ); - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Test_task 2 (local)" ); - status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 ); - directive_failed( status, "rtems_task_start" ); - - if ( Multiprocessing_configuration.node == 1 ) { - status = rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "*** END OF TEST 13 ***" ); - rtems_test_exit( 0 ); - } - puts( "Deleting initialization task" ); - rtems_task_exit(); -} diff --git a/testsuites/mptests/mp13/init1.c b/testsuites/mptests/mp13/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp13/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp13/init2.c b/testsuites/mptests/mp13/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp13/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp13/initimpl.h b/testsuites/mptests/mp13/initimpl.h new file mode 100644 index 0000000000..af5456919b --- /dev/null +++ b/testsuites/mptests/mp13/initimpl.h @@ -0,0 +1,115 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-2009. + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf( + "\n\n*** TEST 13 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Creating Message Queue (Global)" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + 16, + RTEMS_GLOBAL, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create" ); + + puts( "Creating Semaphore (Global)" ); + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_GLOBAL | RTEMS_PRIORITY, + RTEMS_NO_PRIORITY, + &Semaphore_id[ 1 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + + status = rtems_semaphore_obtain( + Semaphore_id[ 1 ], + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + directive_failed( status, "rtems_semaphore_obtain" ); + } + + puts( "Creating Test_task 1 (local)" ); + status = rtems_task_create( + Task_name[ 1 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task 1 (local)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Test_task 2 (local)" ); + status = rtems_task_create( + Task_name[ 2 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 2 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task 2 (local)" ); + status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 ); + directive_failed( status, "rtems_task_start" ); + + if ( Multiprocessing_configuration.node == 1 ) { + status = rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "*** END OF TEST 13 ***" ); + rtems_test_exit( 0 ); + } + puts( "Deleting initialization task" ); + rtems_task_exit(); +} diff --git a/testsuites/mptests/mp14/init.c b/testsuites/mptests/mp14/init.c deleted file mode 100644 index 3591e271f8..0000000000 --- a/testsuites/mptests/mp14/init.c +++ /dev/null @@ -1,198 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. - * 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.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define CONFIGURE_INIT -#include "system.h" - -/* - * This used to be a configuration option. If there is a real need, it can be - * made a configuration option again. - */ -#define MAX_LONG_TEST_DURATION 100 - -uint8_t my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT; - -static rtems_timer_service_routine Stop_Test_TSR( - rtems_id ignored_id, - void *ignored_address -) -{ - Stop_Test = true; -} - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_task_priority previous_priority; - - printf( - "\n\n*** TEST 14 -- NODE %" PRId32 " ***\n", - Multiprocessing_configuration.node - ); - - Stop_Test = false; - - status = rtems_timer_create( - rtems_build_name('S', 'T', 'O', 'P'), - &timer_id - ); - directive_failed( status, "rtems_timer_create" ); - - status = rtems_timer_fire_after( - timer_id, - MAX_LONG_TEST_DURATION * rtems_clock_get_ticks_per_second(), - Stop_Test_TSR, - NULL - ); - directive_failed( status, "rtems_timer_fire_after" ); - - Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); - - Queue_task_name[ 1 ] = rtems_build_name( 'M', 'T', '1', ' ' ); - Queue_task_name[ 2 ] = rtems_build_name( 'M', 'T', '2', ' ' ); - - Partition_task_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' ); - Partition_task_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' ); - - Semaphore_task_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' ); - Semaphore_task_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' ); - - Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); - - Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); - - Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' ); - - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', 'R', ' ' ); - - if ( Multiprocessing_configuration.node == 1 ) { - puts( "Creating Semaphore (Global)" ); - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 1, - RTEMS_GLOBAL, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - - puts( "Creating Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 1, - 16, - RTEMS_GLOBAL, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create" ); - - puts( "Creating Partition (Global)" ); - status = rtems_partition_create( - Partition_name[ 1 ], - (void *)my_partition, - 0x8000, - 0x3800, - RTEMS_GLOBAL, - &Partition_id[ 1 ] - ); - directive_failed( status, "rtems_partition_create" ); - } - - puts( "Creating Event task (Global)" ); - status = rtems_task_create( - Task_name[ Multiprocessing_configuration.node ], - 2, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Event_task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Event task (Global)" ); - status = rtems_task_start( Event_task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Semaphore task (Global)" ); - status = rtems_task_create( - Semaphore_task_name[ Multiprocessing_configuration.node ], - 2, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Semaphore_task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Semaphore task (Global)" ); - status = rtems_task_start( Semaphore_task_id[ 1 ], Semaphore_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Message Queue task (Global)" ); - status = rtems_task_create( - Queue_task_name[ Multiprocessing_configuration.node ], - 2, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Queue_task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - /* argument is index into Buffers */ - puts( "Starting Message Queue task (Global)" ); - status = rtems_task_start( Queue_task_id[ 1 ], Message_queue_task, 1 ); - directive_failed( status, "rtems_task_start" ); - - puts( "Creating Partition task (Global)" ); - status = rtems_task_create( - Partition_task_name[ Multiprocessing_configuration.node ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_GLOBAL, - &Partition_task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - puts( "Starting Partition task (Global)" ); - status = rtems_task_start( Partition_task_id[ 1 ], Partition_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_set_priority( RTEMS_SELF, 2, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - status = rtems_task_ident( - RTEMS_SELF, - RTEMS_SEARCH_ALL_NODES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_ident" ); - - Delayed_events_task( 1 ); -} diff --git a/testsuites/mptests/mp14/init1.c b/testsuites/mptests/mp14/init1.c new file mode 100644 index 0000000000..cfe033db60 --- /dev/null +++ b/testsuites/mptests/mp14/init1.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 1 +#include "initimpl.h" diff --git a/testsuites/mptests/mp14/init2.c b/testsuites/mptests/mp14/init2.c new file mode 100644 index 0000000000..40c2c81592 --- /dev/null +++ b/testsuites/mptests/mp14/init2.c @@ -0,0 +1,2 @@ +#define CONFIGURE_MP_NODE_NUMBER 2 +#include "initimpl.h" diff --git a/testsuites/mptests/mp14/initimpl.h b/testsuites/mptests/mp14/initimpl.h new file mode 100644 index 0000000000..3591e271f8 --- /dev/null +++ b/testsuites/mptests/mp14/initimpl.h @@ -0,0 +1,198 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is a user initialization task and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-2009. + * 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.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +/* + * This used to be a configuration option. If there is a real need, it can be + * made a configuration option again. + */ +#define MAX_LONG_TEST_DURATION 100 + +uint8_t my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT; + +static rtems_timer_service_routine Stop_Test_TSR( + rtems_id ignored_id, + void *ignored_address +) +{ + Stop_Test = true; +} + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + rtems_task_priority previous_priority; + + printf( + "\n\n*** TEST 14 -- NODE %" PRId32 " ***\n", + Multiprocessing_configuration.node + ); + + Stop_Test = false; + + status = rtems_timer_create( + rtems_build_name('S', 'T', 'O', 'P'), + &timer_id + ); + directive_failed( status, "rtems_timer_create" ); + + status = rtems_timer_fire_after( + timer_id, + MAX_LONG_TEST_DURATION * rtems_clock_get_ticks_per_second(), + Stop_Test_TSR, + NULL + ); + directive_failed( status, "rtems_timer_fire_after" ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + Queue_task_name[ 1 ] = rtems_build_name( 'M', 'T', '1', ' ' ); + Queue_task_name[ 2 ] = rtems_build_name( 'M', 'T', '2', ' ' ); + + Partition_task_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' ); + Partition_task_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' ); + + Semaphore_task_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' ); + Semaphore_task_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' ); + + Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', 'R', ' ' ); + + if ( Multiprocessing_configuration.node == 1 ) { + puts( "Creating Semaphore (Global)" ); + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_GLOBAL, + RTEMS_NO_PRIORITY, + &Semaphore_id[ 1 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + + puts( "Creating Message Queue (Global)" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 1, + 16, + RTEMS_GLOBAL, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create" ); + + puts( "Creating Partition (Global)" ); + status = rtems_partition_create( + Partition_name[ 1 ], + (void *)my_partition, + 0x8000, + 0x3800, + RTEMS_GLOBAL, + &Partition_id[ 1 ] + ); + directive_failed( status, "rtems_partition_create" ); + } + + puts( "Creating Event task (Global)" ); + status = rtems_task_create( + Task_name[ Multiprocessing_configuration.node ], + 2, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Event_task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Event task (Global)" ); + status = rtems_task_start( Event_task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Semaphore task (Global)" ); + status = rtems_task_create( + Semaphore_task_name[ Multiprocessing_configuration.node ], + 2, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Semaphore_task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Semaphore task (Global)" ); + status = rtems_task_start( Semaphore_task_id[ 1 ], Semaphore_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Message Queue task (Global)" ); + status = rtems_task_create( + Queue_task_name[ Multiprocessing_configuration.node ], + 2, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Queue_task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + /* argument is index into Buffers */ + puts( "Starting Message Queue task (Global)" ); + status = rtems_task_start( Queue_task_id[ 1 ], Message_queue_task, 1 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Creating Partition task (Global)" ); + status = rtems_task_create( + Partition_task_name[ Multiprocessing_configuration.node ], + 2, + RTEMS_MINIMUM_STACK_SIZE * 2, + RTEMS_TIMESLICE, + RTEMS_GLOBAL, + &Partition_task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Partition task (Global)" ); + status = rtems_task_start( Partition_task_id[ 1 ], Partition_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + status = rtems_task_set_priority( RTEMS_SELF, 2, &previous_priority ); + directive_failed( status, "rtems_task_set_priority" ); + + status = rtems_task_ident( + RTEMS_SELF, + RTEMS_SEARCH_ALL_NODES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_ident" ); + + Delayed_events_task( 1 ); +} -- cgit v1.2.3