source: rtems/testsuites/libtests/rtems++/Init.cc @ e93cc2d

4.115
Last change on this file since e93cc2d was e93cc2d, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/11 at 10:04:31

2011-05-20 Sebastian Huber <sebastian.huber@…>

  • rtems++/Init.cc, rtems++/Task1.cc, rtems++/Task2.cc, rtems++/Task3.cc: Added HAVE_CONFIG_H.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1997
11 *  Objective Design Systems Ltd Pty (ODS)
12 *  All rights reserved (R) Objective Design Systems Ltd Pty
13 *
14 *  COPYRIGHT (c) 1989-1999.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
28#define CONFIGURE_INIT
29#include "System.h"
30
31// make global so it lasts past the Init task's stack's life time
32Task1 task_1;
33
34rtems_task Init(rtems_task_argument )
35{
36  puts( "\n\n*** RTEMS++ TEST ***" );
37
38  printf( "INIT - Task.create() - " );
39  task_1.create("TA1 ", 0, RTEMS_MINIMUM_STACK_SIZE);
40  printf("%s\n", task_1.last_status_string());
41
42  printf( "INIT - Task.create() - " );
43  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
44  printf("%s\n", task_1.last_status_string());
45
46  printf( "INIT - Task.create() - " );
47  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
48  printf("%s\n", task_1.last_status_string());
49
50  printf( "INIT - Task.restart() - " );
51  task_1.restart(0);
52  printf("%s\n", task_1.last_status_string());
53
54  printf( "INIT - Task.start(0xDEADDEAD) - " );
55  task_1.start(0xDEADDEAD);
56  printf("%s\n", task_1.last_status_string());
57
58  printf("INIT - Destroy it's self\n");
59
60  // needs to be in C, no C++ object owns the Init task
61  rtems_status_code status  = rtems_task_delete( RTEMS_SELF );
62  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
63}
64
65
66
Note: See TracBrowser for help on using the repository browser.