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

4.104.114.84.95
Last change on this file since 8fbdf07 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 2.9 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-1999.
18 *  On-Line Applications Research Corporation (OAR).
19 *
20 *  The license and distribution terms for this file may be
21 *  found in the file LICENSE in this distribution or at
22 *  http://www.OARcorp.com/rtems/license.html.
23 *
24 *  $Id$
25 */
26
27#define TEST_INIT
28#include "system.h"
29
30rtems_unsigned8 my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT;
31
32rtems_task Init(
33  rtems_task_argument argument
34)
35{
36  rtems_id          junk_id;
37  rtems_status_code status;
38
39  printf(
40    "\n\n*** TEST 11 -- NODE %d ***\n",
41    Multiprocessing_configuration.node
42  );
43
44  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
45  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
46
47  Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
48
49  Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
50
51  if ( Multiprocessing_configuration.node == 1 ) {
52    puts( "Attempting to create Test_task (Global)" );
53    status = rtems_task_create(
54      Task_name[ 1 ],
55      1,
56      RTEMS_MINIMUM_STACK_SIZE,
57      RTEMS_DEFAULT_MODES,
58      RTEMS_GLOBAL,
59      &junk_id
60    );
61    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" );
62    puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" );
63
64    puts( "Attempting to create Message Queue (Global)" );
65    status = rtems_message_queue_create(
66      Queue_name[ 1 ],
67      3,
68      16,
69      RTEMS_GLOBAL,
70      &junk_id
71    );
72    fatal_directive_status(
73      status,
74      RTEMS_TOO_MANY,
75      "rtems_message_queue_create"
76    );
77    puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
78
79    puts( "Attempting to create Semaphore (Global)" );
80    status = rtems_semaphore_create(
81      Semaphore_name[ 1 ],
82      1,
83      RTEMS_GLOBAL,
84      RTEMS_NO_PRIORITY,
85      &junk_id
86    );
87    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
88    puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
89
90    puts( "Attempting to create Partition (Global)" );
91    status = rtems_partition_create(
92      1,
93      (rtems_unsigned8 *) my_partition,
94      128,
95      64,
96      RTEMS_GLOBAL,
97      &junk_id
98    );
99    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
100    puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
101  }
102  puts( "*** END OF TEST 11 ***" );
103  exit( 0 );
104}
Note: See TracBrowser for help on using the repository browser.