source: rtems/testsuites/mptests/mp11/init.c @ 8bdcfc4

4.104.114.84.95
Last change on this file since 8bdcfc4 was 3652ad35, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/95 at 14:53:29

Minor bug fixes to get all targets compilable and running. The
single biggest changes were the expansion of the workspace size
macro to include other types of objects and the increase in the
minimum stack size for most CPUs.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization and test routine for
4 *  this test program.  It attempts to create more global
5 *  objects than are configured (zero should be configured).
6 *  This routine is the initialization task for this test program.
7 *  It is a user initialization task and has the responsibility for creating
8 *  and starting the tasks that make up the test.  If the time of day
9 *  clock is required for the test, it should also be set to a known
10 *  value by this function.
11 *
12 *  Input parameters:
13 *    argument - task argument
14 *
15 *  Output parameters:  NONE
16 *
17 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
18 *  On-Line Applications Research Corporation (OAR).
19 *  All rights assigned to U.S. Government, 1994.
20 *
21 *  This material may be reproduced by or for the U.S. Government pursuant
22 *  to the copyright license under the clause at DFARS 252.227-7013.  This
23 *  notice must appear in all copies of this file and its derivatives.
24 *
25 *  $Id$
26 */
27
28#define TEST_INIT
29#include "system.h"
30
31rtems_unsigned8 my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT;
32
33rtems_task Init(
34  rtems_task_argument argument
35)
36{
37  rtems_id          junk_id;
38  rtems_status_code status;
39
40  printf(
41    "\n\n*** TEST 11 -- NODE %d ***\n",
42    Multiprocessing_configuration.node
43  );
44
45  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
46  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
47
48  Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
49
50  Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
51
52  if ( Multiprocessing_configuration.node == 1 ) {
53    puts( "Attempting to create Test_task (Global)" );
54    status = rtems_task_create(
55      Task_name[ 1 ],
56      1,
57      RTEMS_MINIMUM_STACK_SIZE,
58      RTEMS_DEFAULT_MODES,
59      RTEMS_GLOBAL,
60      &junk_id
61    );
62    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" );
63    puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" );
64
65    puts( "Attempting to create Message Queue (Global)" );
66    status = rtems_message_queue_create(
67      Queue_name[ 1 ],
68      3,
69      16,
70      RTEMS_GLOBAL,
71      &junk_id
72    );
73    fatal_directive_status(
74      status,
75      RTEMS_TOO_MANY,
76      "rtems_message_queue_create"
77    );
78    puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
79
80    puts( "Attempting to create Semaphore (Global)" );
81    status = rtems_semaphore_create(
82      Semaphore_name[ 1 ],
83      1,
84      RTEMS_GLOBAL,
85      RTEMS_NO_PRIORITY,
86      &junk_id
87    );
88    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
89    puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
90
91    puts( "Attempting to create Partition (Global)" );
92    status = rtems_partition_create(
93      1,
94      (rtems_unsigned8 *) my_partition,
95      128,
96      64,
97      RTEMS_GLOBAL,
98      &junk_id
99    );
100    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
101    puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
102  }
103  puts( "*** END OF TEST 11 ***" );
104  exit( 0 );
105}
Note: See TracBrowser for help on using the repository browser.