source: rtems/testsuites/sptests/spcbssched01/init.c

Last change on this file was e7d46b73, checked in by Joel Sherrill <joel@…>, on 03/31/22 at 21:35:18

testsuites/sptests/sp[a-f*]*: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 3.4 KB
Line 
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
48const char rtems_test_name[] = "SPCBSSCHED 1";
49
50rtems_task Init(
51  rtems_task_argument argument
52)
53{
54  rtems_time_of_day time;
55  rtems_status_code status;
56
57  TEST_BEGIN();
58
59  build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
60  status = rtems_clock_set( &time );
61  directive_failed( status, "rtems_clock_set" );
62
63  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
64  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
65  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
66
67  status = rtems_task_create(
68     Task_name[ 1 ],
69     1,
70     RTEMS_MINIMUM_STACK_SIZE * 2,
71     RTEMS_DEFAULT_MODES,
72     RTEMS_DEFAULT_ATTRIBUTES,
73     &Task_id[ 1 ]
74  );
75  directive_failed( status, "rtems_task_create of TA1" );
76
77  status = rtems_task_create(
78     Task_name[ 2 ],
79     1,
80     RTEMS_MINIMUM_STACK_SIZE * 2,
81     RTEMS_DEFAULT_MODES,
82     RTEMS_DEFAULT_ATTRIBUTES,
83     &Task_id[ 2 ]
84  );
85  directive_failed( status, "rtems_task_create of TA2" );
86
87  status = rtems_task_create(
88     Task_name[ 3 ],
89     1,
90     RTEMS_MINIMUM_STACK_SIZE * 3,
91     RTEMS_DEFAULT_MODES,
92     RTEMS_DEFAULT_ATTRIBUTES,
93     &Task_id[ 3 ]
94  );
95  directive_failed( status, "rtems_task_create of TA3" );
96
97  status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
98  directive_failed( status, "rtems_task_start of TA1" );
99
100  status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
101  directive_failed( status, "rtems_task_start of TA2" );
102
103  status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
104  directive_failed( status, "rtems_task_start of TA3" );
105
106  rtems_task_exit();
107}
Note: See TracBrowser for help on using the repository browser.