1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <rtems/itron.h> |
---|
17 | |
---|
18 | #include <rtems/score/thread.h> |
---|
19 | #include <rtems/score/userext.h> |
---|
20 | #include <rtems/score/wkspace.h> |
---|
21 | #include <rtems/score/apiext.h> |
---|
22 | #include <rtems/score/sysstate.h> |
---|
23 | |
---|
24 | #include <rtems/itron/task.h> |
---|
25 | |
---|
26 | /* |
---|
27 | * _ITRON_Task_Initialize_user_tasks |
---|
28 | * |
---|
29 | * This routine creates and starts all configured user |
---|
30 | * initialzation threads. |
---|
31 | */ |
---|
32 | |
---|
33 | void _ITRON_Task_Initialize_user_tasks_body( void ) |
---|
34 | { |
---|
35 | uint32_t index; |
---|
36 | uint32_t maximum; |
---|
37 | ER return_value; |
---|
38 | itron_initialization_tasks_table *user_tasks; |
---|
39 | |
---|
40 | user_tasks = Configuration_ITRON_API.User_initialization_tasks_table; |
---|
41 | maximum = Configuration_ITRON_API.number_of_initialization_tasks; |
---|
42 | |
---|
43 | if ( !user_tasks || maximum == 0 ) |
---|
44 | return; |
---|
45 | |
---|
46 | for ( index=0 ; index < maximum ; index++ ) { |
---|
47 | |
---|
48 | return_value = cre_tsk( |
---|
49 | user_tasks[ index ].id, |
---|
50 | &user_tasks[ index ].attributes |
---|
51 | ); |
---|
52 | |
---|
53 | if ( return_value != E_OK ) |
---|
54 | _Internal_error_Occurred( INTERNAL_ERROR_ITRON_API, true, return_value ); |
---|
55 | |
---|
56 | return_value = sta_tsk( user_tasks[ index ].id, 0 ); |
---|
57 | |
---|
58 | if ( return_value != E_OK ) |
---|
59 | _Internal_error_Occurred( INTERNAL_ERROR_ITRON_API, true, return_value ); |
---|
60 | |
---|
61 | } |
---|
62 | } |
---|