source: rtems/testsuites/mptests/mp08/init.c @ a4bc4d6e

4.115
Last change on this file since a4bc4d6e was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 2.0 KB
Line 
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 *
14 *  COPYRIGHT (c) 1989-1999.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
28#define CONFIGURE_INIT
29#include "system.h"
30
31rtems_task Init(
32  rtems_task_argument argument
33)
34{
35  rtems_status_code status;
36
37  printf(
38    "\n\n*** TEST 8 -- NODE %" PRIu32 " ***\n",
39    Multiprocessing_configuration.node
40  );
41
42  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
43  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
44
45  Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', '\0' );
46
47  if ( Multiprocessing_configuration.node == 1 ) {
48    puts( "Creating Sempahore (Global)" );
49    status = rtems_semaphore_create(
50      Semaphore_name[ 1 ],
51      1,
52      RTEMS_GLOBAL,
53      RTEMS_NO_PRIORITY,
54      &Semaphore_id[ 1 ]
55    );
56    directive_failed( status, "rtems_semaphore_create" );
57  }
58
59  puts( "Creating Test_task (Global)" );
60  status = rtems_task_create(
61    Task_name[ Multiprocessing_configuration.node ],
62    1,
63    RTEMS_MINIMUM_STACK_SIZE,
64    RTEMS_TIMESLICE,
65    RTEMS_GLOBAL,
66    &Task_id[ 1 ]
67  );
68  directive_failed( status, "rtems_task_create" );
69
70  puts( "Starting Test_task (Global)" );
71  status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
72  directive_failed( status, "rtems_task_start" );
73
74  puts( "Deleting initialization task" );
75  status = rtems_task_delete( RTEMS_SELF );
76  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
77}
Note: See TracBrowser for help on using the repository browser.