source: rtems/testsuites/mptests/mp11/init.c @ 3235ad9

4.104.114.84.95
Last change on this file since 3235ad9 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 23, 1995 at 7:30:23 PM

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • 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] CPU_STRUCTURE_ALIGNMENT;
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      16,
73      RTEMS_GLOBAL,
74      &junk_id
75    );
76    fatal_directive_status(
77      status,
78      RTEMS_TOO_MANY,
79      "rtems_message_queue_create"
80    );
81    puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
82
83    puts( "Attempting to create Semaphore (Global)" );
84    status = rtems_semaphore_create(
85      Semaphore_name[ 1 ],
86      1,
87      RTEMS_GLOBAL,
88      &junk_id
89    );
90    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
91    puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
92
93    puts( "Attempting to create Partition (Global)" );
94    status = rtems_partition_create(
95      1,
96      (rtems_unsigned8 *) my_partition,
97      128,
98      64,
99      RTEMS_GLOBAL,
100      &junk_id
101    );
102    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
103    puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
104  }
105  puts( "*** END OF TEST 11 ***" );
106  exit( 0 );
107}
Note: See TracBrowser for help on using the repository browser.