source: rtems/testsuites/mptests/mp12/init.c @ 3652ad35

4.104.114.84.95
Last change on this file since 3652ad35 was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[ac7d5ef0]1/*  Init
2 *
3 *  This routine is the initialization routine and test code for
4 *  global partitions.  It creates a global partition, obtains and
5 *  releases a buffer, and deletes the partition.  The partition
6 *  is created on node one, and an attempt is made to delete it
7 *  by node two.
8 *  This routine is the initialization task for this test program.
9 *  It is a user initialization task and has the responsibility for creating
10 *  and starting the tasks that make up the test.  If the time of day
11 *  clock is required for the test, it should also be set to a known
12 *  value by this function.
13 *
14 *  Input parameters:
15 *    argument - task argument
16 *
17 *  Output parameters:  NONE
18 *
19 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
20 *  On-Line Applications Research Corporation (OAR).
21 *  All rights assigned to U.S. Government, 1994.
22 *
23 *  This material may be reproduced by or for the U.S. Government pursuant
24 *  to the copyright license under the clause at DFARS 252.227-7013.  This
25 *  notice must appear in all copies of this file and its derivatives.
26 *
27 *  $Id$
28 */
29
[3a4ae6c]30#define TEST_INIT
[ac7d5ef0]31#include "system.h"
32
[637df35]33rtems_unsigned8 Partition_area[ 1024 ] CPU_STRUCTURE_ALIGNMENT;
[ac7d5ef0]34
35rtems_task Init(
36  rtems_task_argument argument
37)
38{
39  rtems_status_code  status;
40  void              *bufaddr;
41
42  printf(
43    "\n\n*** TEST 12 -- NODE %d ***\n",
44    Multiprocessing_configuration.node
45   );
46
47  Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
48  Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
49
50  Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' );
51
52  puts( "Got to initialization task" );
53
54  if ( Multiprocessing_configuration.node == 2 )  {
55    status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
56    directive_failed( status, "rtems_task_wake_after" );
57
58    puts( "Getting ID of remote Partition (Global)" );
59
60    do {
61      status = rtems_partition_ident(
62        Partition_name[ 1 ],
63        RTEMS_SEARCH_ALL_NODES,
64        &Partition_id[ 1 ]
65      );
66    } while ( !rtems_is_status_successful( status ) );
67
68    puts( "Attempting to delete remote Partition (Global)" );
69    status = rtems_partition_delete( Partition_id[ 1 ] );
70    fatal_directive_status(
71      status,
72      RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
73      "rtems_partition_delete"
74    );
75    puts(
76     "rtems_partition_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT"
77    );
78
79    puts( "Obtaining a buffer from the global partition" );
80    status = rtems_partition_get_buffer( Partition_id[ 1 ], &bufaddr );
81    directive_failed( status, "rtems_partition_get_buffer" );
82    printf( "Address returned was : 0x%p\n", bufaddr );
83
84    puts( "Releasing a buffer to the global partition" );
85    status = rtems_partition_return_buffer( Partition_id[ 1 ], bufaddr );
86    directive_failed( status, "rtems_partition_return_buffer" );
87
88    status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
89    directive_failed( status, "rtems_task_wake_after" );
90  }
91  else {
92    puts( "Creating Partition (Global)" );
93    status = rtems_partition_create(
94      Partition_name[ 1 ],
95      Partition_area,
96      128,
97      64,
98      RTEMS_GLOBAL,
99      &Partition_id[ 1 ]
100    );
101    directive_failed( status, "rtems_partition_create" );
102
103    puts( "Sleeping for two seconds" );
104    status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
105    directive_failed( status, "rtems_task_wake_after" );
106
107    puts( "Deleting Partition (Global)" );
108    status = rtems_partition_delete( Partition_id[ 1 ] );
109    directive_failed( status, "rtems_partition_delete" );
110 }
111 puts( "*** END OF TEST 12 ***" );
112 exit( 0 );
113}
Note: See TracBrowser for help on using the repository browser.