source: rtems/testsuites/mptests/mp01/init.c @ 98e4ebf5

4.104.114.84.95
Last change on this file since 98e4ebf5 was 98e4ebf5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/97 at 15:45:54

Fixed typo in the pointer to the license terms.

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[ac7d5ef0]1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is a user initialization task and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the test, it should also be set to a known
7 *  value by this function.
8 *
9 *  Input parameters:
10 *    argument - task argument
11 *
12 *  Output parameters:  NONE
13 *
[03f2154e]14 *  COPYRIGHT (c) 1989-1997.
[ac7d5ef0]15 *  On-Line Applications Research Corporation (OAR).
[03f2154e]16 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]17 *
[98e4ebf5]18 *  The license and distribution terms for this file may be
19 *  found in the file LICENSE in this distribution or at
[03f2154e]20 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]21 *
22 *  $Id$
23 */
24
[3a4ae6c]25#define TEST_INIT
[ac7d5ef0]26#include "system.h"
27
28rtems_task Init(
29  rtems_task_argument argument
30)
31{
32  rtems_status_code status;
33  rtems_time_of_day time;
34  char              c;
35
36  printf(
37    "\n\n*** TEST 1 -- NODE %d ***\n",
38    Multiprocessing_configuration.node
39  );
40
41  if ( Multiprocessing_configuration.node != 1 ) c = 'S';
42  else                                           c = 'M';
43
44  Task_name[ 1 ] = rtems_build_name( c, 'A', '1', ' ' );
45  Task_name[ 2 ] = rtems_build_name( c, 'A', '2', ' ' );
46  Task_name[ 3 ] = rtems_build_name( c, 'A', '3', ' ' );
47
48  build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
49  status = rtems_clock_set( &time );
50  directive_failed( status, "rtems_clock_set" );
51
52  puts( "Creating task 1 (Global)" );
53  status = rtems_task_create(
54    Task_name[ 1 ],
55    1,
[3652ad35]56    RTEMS_MINIMUM_STACK_SIZE,
[ac7d5ef0]57    RTEMS_DEFAULT_MODES,
58    RTEMS_GLOBAL,
59    &Task_id[ 1 ]
60  );
61  directive_failed( status, "rtems_task_create of Task 1" );
62
63  puts( "Creating task 2 (Global)" );
64  status = rtems_task_create(
65    Task_name[ 2 ],
66    1,
[3652ad35]67    RTEMS_MINIMUM_STACK_SIZE,
[ac7d5ef0]68    RTEMS_TIMESLICE,
69    RTEMS_GLOBAL,
70    &Task_id[ 2 ]
71  );
72  directive_failed( status, "rtems_task_create of Task 2" );
73
74  puts( "Creating task 3 (Local)" );
75  status = rtems_task_create(
76    Task_name[ 3 ],
77    1,
[3652ad35]78    RTEMS_MINIMUM_STACK_SIZE,
[ac7d5ef0]79    RTEMS_DEFAULT_MODES,
80    RTEMS_DEFAULT_ATTRIBUTES,
81    &Task_id[ 3 ]
82  );
83  directive_failed( status, "rtems_task_create of Task 3" );
84
85  status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
86  directive_failed( status, "rtems_task_start of Task 1" );
87
88  status = rtems_task_start( Task_id[ 2 ], Test_task, 0 );
89  directive_failed( status, "rtems_task_start of Task 2" );
90
91  status = rtems_task_start( Task_id[ 3 ], Test_task, 0 );
92  directive_failed( status, "rtems_task_start of Task 3" );
93
94  status = rtems_task_delete( RTEMS_SELF );
95  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
96}
Note: See TracBrowser for help on using the repository browser.