source: rtems/c/src/tests/mptests/mp11/init.c @ 7c22114b

4.104.114.84.95
Last change on this file since 7c22114b was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • 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#include "system.h"
29#undef EXTERN
30#define EXTERN
31#include "conftbl.h"
32#include "gvar.h"
33
34rtems_unsigned8 my_partition[0x30000];
35
36rtems_task Init(
37  rtems_task_argument argument
38)
39{
40  rtems_id          junk_id;
41  rtems_status_code status;
42
43  printf(
44    "\n\n*** TEST 11 -- NODE %d ***\n",
45    Multiprocessing_configuration.node
46  );
47
48  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
49  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
50
51  Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
52
53  Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
54
55  if ( Multiprocessing_configuration.node == 1 ) {
56    puts( "Attempting to create Test_task (Global)" );
57    status = rtems_task_create(
58      Task_name[ 1 ],
59      1,
60      1024,
61      RTEMS_DEFAULT_MODES,
62      RTEMS_GLOBAL,
63      &junk_id
64    );
65    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" );
66    puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" );
67
68    puts( "Attempting to create Message Queue (Global)" );
69    status = rtems_message_queue_create(
70      Queue_name[ 1 ],
71      3,
72      RTEMS_GLOBAL|RTEMS_LIMIT,
73      &junk_id
74    );
75    fatal_directive_status(
76      status,
77      RTEMS_TOO_MANY,
78      "rtems_message_queue_create"
79    );
80    puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
81
82    puts( "Attempting to create Semaphore (Global)" );
83    status = rtems_semaphore_create(
84      Semaphore_name[ 1 ],
85      1,
86      RTEMS_GLOBAL,
87      &junk_id
88    );
89    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
90    puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
91
92    puts( "Attempting to create Partition (Global)" );
93    status = rtems_partition_create(
94      1,
95      (rtems_unsigned8 *) my_partition,
96      128,
97      64,
98      RTEMS_GLOBAL,
99      &junk_id
100    );
101    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
102    puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
103  }
104  puts( "*** END OF TEST 11 ***" );
105  exit( 0 );
106}
Note: See TracBrowser for help on using the repository browser.