OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp07/] [init.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 158 chris
/*  Init
2
 *
3
 *  This routine is the initialization task for this test program.
4
 *  It is a user initialization task and has the responsibility for creating
5
 *  and starting the tasks that make up the test.  If the time of day
6
 *  clock is required for the test, it should also be set to a known
7
 *  value by this function.
8
 *
9
 *  Input parameters:
10
 *    argument - task argument
11
 *
12
 *  Output parameters:  NONE
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.OARcorp.com/rtems/license.html.
20
 *
21 208 chris
 *  $Id: init.c,v 1.2 2001-09-27 12:02:31 chris Exp $
22 158 chris
 */
23
 
24
#define TEST_INIT
25
#include "system.h"
26
 
27
rtems_extensions_table Extensions = {
28
  Task_create_extension,     /* task create user extension */
29
  Task_start_extension,      /* task start user extension */
30
  Task_restart_extension,    /* task restart user extension */
31
  Task_delete_extension,     /* task delete user extension */
32
  NULL,                      /* task switch user extension */
33
  NULL,                      /* begin user extension */
34
  Task_exit_extension,       /* task exitted user extension */
35
  NULL                       /* fatal error extension */
36
};
37
 
38
rtems_task Init(
39
  rtems_task_argument argument
40
)
41
{
42
  rtems_status_code status;
43
 
44
  puts( "\n\n*** TEST 7 ***" );
45
 
46
  Extension_name[ 1 ] =  rtems_build_name( 'E', 'X', 'T', ' ' );
47
 
48
  status = rtems_extension_create(
49
    Extension_name[ 1 ],
50
    &Extensions,
51
    &Extension_id[ 1 ]
52
  );
53
  directive_failed( status, "rtems_extension_create" );
54
 
55
  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
56
  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
57
  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
58
  Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' );
59
 
60
  status = rtems_task_create(
61
    Task_name[ 1 ],
62
    4,
63
    RTEMS_MINIMUM_STACK_SIZE * 2,
64
    RTEMS_DEFAULT_MODES,
65
    RTEMS_DEFAULT_ATTRIBUTES,
66
    &Task_id[ 1 ]
67
  );
68
  directive_failed( status, "rtems_task_create of TA1" );
69
 
70
  status = rtems_task_create(
71
    Task_name[ 2 ],
72
    4,
73
    RTEMS_MINIMUM_STACK_SIZE * 2,
74
    RTEMS_DEFAULT_MODES,
75
    RTEMS_DEFAULT_ATTRIBUTES,
76
    &Task_id[ 2 ]
77
  );
78
  directive_failed( status, "rtems_task_create of TA2" );
79
 
80
  status = rtems_task_create(
81
    Task_name[ 3 ],
82
    250,
83
    RTEMS_MINIMUM_STACK_SIZE * 2,
84
    RTEMS_DEFAULT_MODES,
85
    RTEMS_DEFAULT_ATTRIBUTES,
86
    &Task_id[ 3 ]
87
  );
88
  directive_failed( status, "rtems_task_create of TA3" );
89
 
90
  status = rtems_task_create(
91
    Task_name[ 4 ],
92
    254,
93
    RTEMS_MINIMUM_STACK_SIZE * 2,
94
    RTEMS_DEFAULT_MODES,
95
    RTEMS_DEFAULT_ATTRIBUTES,
96
    &Task_id[ 4 ]
97
  );
98
  directive_failed( status, "rtems_task_create of TA4" );
99
 
100
  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
101
  directive_failed( status, "rtems_task_start of TA1" );
102
 
103
  status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
104
  directive_failed( status, "rtems_task_start of TA2" );
105
 
106
  status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
107
  directive_failed( status, "rtems_task_start of TA3" );
108
 
109
  status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
110
  directive_failed( status, "rtems_task_start of TA4" );
111
 
112
  status = rtems_task_restart( Task_id[ 3 ], 0 );
113
  directive_failed( status, "rtems_task_restart of TA3" );
114
 
115
  status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
116
  directive_failed( status, "task_set_node of TA1" );
117
  printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
118
  puts  ( "to TA1's priority: 04" );
119
 
120
  status = rtems_task_set_note( Task_id[ 2 ], RTEMS_NOTEPAD_8, 4 );
121
  directive_failed( status, "task_set_node of TA2" );
122
  printf( "INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 " );
123
  puts  ( "to TA2's priority: 04");
124
 
125
  status = rtems_task_delete( RTEMS_SELF );
126
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
127
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.