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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp19/] [init.c] - Blame information for rev 591

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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
 *  $Id: init.c,v 1.2 2001-09-27 12:02:34 chris Exp $
22
 */
23
 
24
#define TEST_INIT
25
#include "system.h"
26
 
27
rtems_task Init(
28
  rtems_task_argument argument
29
)
30
{
31
  rtems_status_code status;
32
 
33
  puts( "\n\n*** TEST 19 ***" );
34
 
35
  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
36
  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
37
  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
38
  Task_name[ 4 ] =  rtems_build_name( 'T', 'A', '4', ' ' );
39
  Task_name[ 5 ] =  rtems_build_name( 'T', 'A', '5', ' ' );
40
  Task_name[ 6 ] =  rtems_build_name( 'F', 'P', '1', ' ' );
41
 
42
  status = rtems_task_create(
43
    Task_name[ 1 ],
44
    2,
45
    RTEMS_MINIMUM_STACK_SIZE * 4,
46
    RTEMS_DEFAULT_MODES,
47
    RTEMS_FLOATING_POINT,
48
    &Task_id[ 1 ]
49
  );
50
  directive_failed( status, "rtems_task_create of TA1" );
51
 
52
  status = rtems_task_create(
53
    Task_name[ 2 ],
54
    2,
55
    RTEMS_MINIMUM_STACK_SIZE * 4,
56
    RTEMS_DEFAULT_MODES,
57
    RTEMS_DEFAULT_ATTRIBUTES,
58
    &Task_id[ 2 ]
59
  );
60
  directive_failed( status, "rtems_task_create of TA2" );
61
 
62
  status = rtems_task_create(
63
    Task_name[ 3 ],
64
    2,
65
    RTEMS_MINIMUM_STACK_SIZE * 4,
66
    RTEMS_DEFAULT_MODES,
67
    RTEMS_DEFAULT_ATTRIBUTES,
68
    &Task_id[ 3 ]
69
  );
70
  directive_failed( status, "rtems_task_create of TA3" );
71
 
72
  status = rtems_task_create(
73
    Task_name[ 4 ],
74
    2,
75
    RTEMS_MINIMUM_STACK_SIZE * 4,
76
    RTEMS_DEFAULT_MODES,
77
    RTEMS_FLOATING_POINT,
78
    &Task_id[ 4 ]
79
  );
80
  directive_failed( status, "rtems_task_create of TA4" );
81
 
82
  status = rtems_task_create(
83
    Task_name[ 5 ],
84
    2,
85
    RTEMS_MINIMUM_STACK_SIZE * 4,
86
    RTEMS_DEFAULT_MODES,
87
    RTEMS_FLOATING_POINT,
88
    &Task_id[ 5 ]
89
  );
90
  directive_failed( status, "rtems_task_create of TA5" );
91
 
92
  status = rtems_task_create(
93
    Task_name[ 6 ],
94
    1,
95
    RTEMS_MINIMUM_STACK_SIZE * 4,
96
    RTEMS_DEFAULT_MODES,
97
    RTEMS_FLOATING_POINT,
98
    &Task_id[ 6 ]
99
  );
100
  directive_failed( status, "rtems_task_create of FP1" );
101
 
102
  status = rtems_task_start( Task_id[ 6 ], First_FP_task, 0 );
103
  directive_failed( status, "rtems_task_start of FP1" );
104
 
105
  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
106
  directive_failed( status, "rtems_task_start of TA1" );
107
 
108
  status = rtems_task_start( Task_id[ 2 ], Task_1, 0 );
109
  directive_failed( status, "rtems_task_start of TA2" );
110
 
111
  status = rtems_task_start( Task_id[ 3 ], Task_1, 0 );
112
  directive_failed( status, "rtems_task_start of TA3" );
113
 
114
  status = rtems_task_start( Task_id[ 4 ], FP_task, 0 );
115
  directive_failed( status, "rtems_task_start of TA4" );
116
 
117
  status = rtems_task_start( Task_id[ 5 ], FP_task, 0 );
118
  directive_failed( status, "rtems_task_create of TA5" );
119
 
120
  /*
121
   *  Load "task dependent factors" in the context areas
122
   */
123
 
124
 
125
  FP_factors[0] =    0.0;
126
  FP_factors[1] = 1000.1;
127
  FP_factors[2] = 2000.2;
128
  FP_factors[3] = 3000.3;
129
  FP_factors[4] = 4000.4;
130
  FP_factors[5] = 5000.5;
131
  FP_factors[6] = 6000.6;
132
  FP_factors[7] = 7000.7;
133
  FP_factors[8] = 8000.8;
134
  FP_factors[9] = 9000.9;
135
 
136
  INTEGER_factors[0] = 0x0000;
137
  INTEGER_factors[1] = 0x1000;
138
  INTEGER_factors[2] = 0x2000;
139
  INTEGER_factors[3] = 0x3000;
140
  INTEGER_factors[4] = 0x4000;
141
  INTEGER_factors[5] = 0x5000;
142
  INTEGER_factors[6] = 0x6000;
143
  INTEGER_factors[7] = 0x7000;
144
  INTEGER_factors[8] = 0x8000;
145
  INTEGER_factors[9] = 0x9000;
146
 
147
  status = rtems_task_delete( RTEMS_SELF );
148
  directive_failed( status, "rtems_task_delete of TA1" );
149
}

powered by: WebSVN 2.1.0

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