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

4.104.114.84.9
Last change on this file since 8c27637 was d7a0857, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:31 PM

2003-09-04 Joel Sherrill <joel@…>

  • mp01/init.c, mp01/system.h, mp01/task1.c, mp01/node1/mp01.doc, mp01/node2/mp01.doc, mp02/init.c, mp02/system.h, mp02/task1.c, mp02/node1/mp02.doc, mp02/node2/mp02.doc, mp03/delay.c, mp03/init.c, mp03/system.h, mp03/task1.c, mp03/node1/mp03.doc, mp03/node2/mp03.doc, mp04/init.c, mp04/system.h, mp04/task1.c, mp04/node1/mp04.doc, mp04/node2/mp04.doc, mp05/asr.c, mp05/init.c, mp05/system.h, mp05/task1.c, mp05/node1/mp05.doc, mp05/node2/mp05.doc, mp06/init.c, mp06/system.h, mp06/task1.c, mp06/node1/mp06.doc, mp06/node2/mp06.doc, mp07/init.c, mp07/system.h, mp07/task1.c, mp07/node1/mp07.doc, mp07/node2/mp07.doc, mp08/init.c, mp08/system.h, mp08/task1.c, mp08/node1/mp08.doc, mp08/node2/mp08.doc, mp09/init.c, mp09/recvmsg.c, mp09/sendmsg.c, mp09/system.h, mp09/task1.c, mp09/node1/mp09.doc, mp09/node2/mp09.doc, mp10/init.c, mp10/system.h, mp10/task1.c, mp10/task2.c, mp10/task3.c, mp10/node1/mp10.doc, mp10/node2/mp10.doc, mp11/init.c, mp11/system.h, mp11/node1/mp11.doc, mp11/node2/mp11.doc, mp12/init.c, mp12/system.h, mp12/node1/mp12.doc, mp12/node2/mp12.doc, mp13/init.c, mp13/system.h, mp13/task1.c, mp13/task2.c, mp13/node1/mp13.doc, mp13/node2/mp13.doc, mp14/delay.c, mp14/evtask1.c, mp14/evtmtask.c, mp14/exit.c, mp14/init.c, mp14/msgtask1.c, mp14/pttask1.c, mp14/smtask1.c, mp14/system.h, mp14/node1/mp14.doc, mp14/node2/mp14.doc: URL for license changed.
  • 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.rtems.com/license/LICENSE.
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  rtems_test_exit( 0 );
104}
Note: See TracBrowser for help on using the repository browser.