source: rtems/c/src/tests/mptests/mp11/init.c @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was 7f6a24ab, checked in by Joel Sherrill <joel.sherrill@…>, on 08/28/95 at 15:30:29

Added unused priority ceiling parameter to rtems_semaphore_create.

Rearranged code to created thread handler routines to initialize,
start, restart, and "close/delete" a thread.

Made internal threads their own object class. This now uses the
thread support routines for starting and initializing a thread.

Insured deleted tasks are freed to the Inactive pool associated with the
correct Information block.

Added an RTEMS API specific data area to the thread control block.

Beginnings of removing the word "rtems" from the core.

  • 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      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      (rtems_unsigned8 *) 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  exit( 0 );
108}
Note: See TracBrowser for help on using the repository browser.