[42d4ebe] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
| 2 | |
---|
[ac7d5ef0] | 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 | * |
---|
[08311cc3] | 16 | * COPYRIGHT (c) 1989-1999. |
---|
[ac7d5ef0] | 17 | * On-Line Applications Research Corporation (OAR). |
---|
| 18 | * |
---|
[42d4ebe] | 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. |
---|
[ac7d5ef0] | 39 | */ |
---|
| 40 | |
---|
[a4bc4d6e] | 41 | #ifdef HAVE_CONFIG_H |
---|
| 42 | #include "config.h" |
---|
| 43 | #endif |
---|
| 44 | |
---|
[81fed4b] | 45 | #define CONFIGURE_INIT |
---|
[ac7d5ef0] | 46 | #include "system.h" |
---|
| 47 | |
---|
| 48 | rtems_task Init( |
---|
| 49 | rtems_task_argument argument |
---|
| 50 | ) |
---|
| 51 | { |
---|
| 52 | rtems_status_code status; |
---|
| 53 | |
---|
| 54 | printf( |
---|
[58397d88] | 55 | "\n\n*** TEST 5 -- NODE %" PRIu32 " ***\n", |
---|
[a00dff42] | 56 | rtems_object_get_local_node() |
---|
[ac7d5ef0] | 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( |
---|
[a00dff42] | 64 | Task_name[rtems_object_get_local_node()], |
---|
[ac7d5ef0] | 65 | 1, |
---|
[38ffa0c] | 66 | RTEMS_MINIMUM_STACK_SIZE * 2, |
---|
[ac7d5ef0] | 67 | RTEMS_TIMESLICE, |
---|
| 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 | Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); |
---|
| 78 | |
---|
| 79 | status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); |
---|
| 80 | directive_failed( status, "rtems_timer_create" ); |
---|
| 81 | |
---|
| 82 | puts( "Deleting initialization task" ); |
---|
[51b3cbca] | 83 | rtems_task_exit(); |
---|
[ac7d5ef0] | 84 | } |
---|