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

5
Last change on this file since ca056e3 was af43554, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/17 at 11:59:11

tests: Remove TEST_INIT

The TEST_EXTERN is a used only by the system.h style tests and they use
CONFIGURE_INIT appropriately.

Update #3170.
Update #3199.

  • 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.org/license/LICENSE.
23 */
24
25#ifdef HAVE_CONFIG_H
26#include "config.h"
27#endif
28
29#define CONFIGURE_INIT
30#include "system.h"
31
32uint8_t   my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT;
33
34rtems_task Init(
35  rtems_task_argument argument
36)
37{
38  rtems_id          junk_id;
39  rtems_status_code status;
40
41  printf(
42    "\n\n*** TEST 11 -- NODE %" PRIu32 " ***\n",
43    Multiprocessing_configuration.node
44  );
45
46  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
47  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
48
49  Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
50
51  Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
52
53  if ( Multiprocessing_configuration.node == 1 ) {
54    puts( "Attempting to create Test_task (Global)" );
55    status = rtems_task_create(
56      Task_name[ 1 ],
57      1,
58      RTEMS_MINIMUM_STACK_SIZE,
59      RTEMS_DEFAULT_MODES,
60      RTEMS_GLOBAL,
61      &junk_id
62    );
63    fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" );
64    puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" );
65
66    puts( "Attempting to create Message Queue (Global)" );
67    status = rtems_message_queue_create(
68      Queue_name[ 1 ],
69      3,
70      16,
71      RTEMS_GLOBAL,
72      &junk_id
73    );
74    fatal_directive_status(
75      status,
76      RTEMS_TOO_MANY,
77      "rtems_message_queue_create"
78    );
79    puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
80
81    puts( "Attempting to create Semaphore (Global)" );
82    status = rtems_semaphore_create(
83      Semaphore_name[ 1 ],
84      1,
85      RTEMS_GLOBAL,
86      RTEMS_NO_PRIORITY,
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      (uint8_t   *) 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  rtems_test_exit( 0 );
106}
Note: See TracBrowser for help on using the repository browser.