1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /* Init |
---|
4 | * |
---|
5 | * This routine is the initialization task for this test program. |
---|
6 | * It is a user initialization task and has the responsibility for creating |
---|
7 | * and starting the tasks that make up the test. If the time of day |
---|
8 | * clock is required for the test, it should also be set to a known |
---|
9 | * value by this function. |
---|
10 | * |
---|
11 | * Input parameters: |
---|
12 | * argument - task argument |
---|
13 | * |
---|
14 | * Output parameters: NONE |
---|
15 | * |
---|
16 | * COPYRIGHT (c) 1989-1999. |
---|
17 | * On-Line Applications Research Corporation (OAR). |
---|
18 | * |
---|
19 | * Redistribution and use in source and binary forms, with or without |
---|
20 | * modification, are permitted provided that the following conditions |
---|
21 | * are met: |
---|
22 | * 1. Redistributions of source code must retain the above copyright |
---|
23 | * notice, this list of conditions and the following disclaimer. |
---|
24 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
25 | * notice, this list of conditions and the following disclaimer in the |
---|
26 | * documentation and/or other materials provided with the distribution. |
---|
27 | * |
---|
28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
29 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
34 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
36 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
37 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
38 | * POSSIBILITY OF SUCH DAMAGE. |
---|
39 | */ |
---|
40 | |
---|
41 | #ifdef HAVE_CONFIG_H |
---|
42 | #include "config.h" |
---|
43 | #endif |
---|
44 | |
---|
45 | #define CONFIGURE_INIT |
---|
46 | #include "system.h" |
---|
47 | |
---|
48 | rtems_task Init( |
---|
49 | rtems_task_argument argument |
---|
50 | ) |
---|
51 | { |
---|
52 | rtems_status_code status; |
---|
53 | |
---|
54 | printf( |
---|
55 | "\n\n*** TEST 4 -- NODE %" PRId32 " ***\n", |
---|
56 | rtems_object_get_local_node() |
---|
57 | ); |
---|
58 | |
---|
59 | Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); |
---|
60 | Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); |
---|
61 | |
---|
62 | puts( "Creating Test_task (Global)" ); |
---|
63 | status = rtems_task_create( |
---|
64 | Task_name[ rtems_object_get_local_node() ], |
---|
65 | rtems_object_get_local_node(), |
---|
66 | RTEMS_MINIMUM_STACK_SIZE, |
---|
67 | RTEMS_DEFAULT_MODES, |
---|
68 | RTEMS_GLOBAL, |
---|
69 | &Task_id[ 1 ] |
---|
70 | ); |
---|
71 | directive_failed( status, "rtems_task_create" ); |
---|
72 | |
---|
73 | puts( "Starting Test_task (Global)" ); |
---|
74 | status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); |
---|
75 | directive_failed( status, "rtems_task_start" ); |
---|
76 | |
---|
77 | puts( "Deleting initialization task" ); |
---|
78 | rtems_task_exit(); |
---|
79 | } |
---|