source: rtems/testsuites/mptests/mp11/init.c @ a4bc4d6e

4.115
Last change on this file since a4bc4d6e was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

  • 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#ifdef HAVE_CONFIG_H
28#include "config.h"
29#endif
30
31#define CONFIGURE_INIT
32#include "system.h"
33
34uint8_t   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 %" PRIu32 " ***\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      RTEMS_MINIMUM_STACK_SIZE,
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      RTEMS_NO_PRIORITY,
89      &junk_id
90    );
91    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
92    puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
93
94    puts( "Attempting to create Partition (Global)" );
95    status = rtems_partition_create(
96      1,
97      (uint8_t   *) my_partition,
98      128,
99      64,
100      RTEMS_GLOBAL,
101      &junk_id
102    );
103    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
104    puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
105  }
106  puts( "*** END OF TEST 11 ***" );
107  rtems_test_exit( 0 );
108}
Note: See TracBrowser for help on using the repository browser.