source: rtems/cpukit/rtems/src/taskinitusers.c @ a29d2e7

4.104.114.84.95
Last change on this file since a29d2e7 was 1095ec1, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/18/05 at 09:03:45

Include config.h.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  RTEMS Task Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/rtems/status.h>
21#include <rtems/rtems/support.h>
22#include <rtems/rtems/modes.h>
23#include <rtems/score/object.h>
24#include <rtems/score/stack.h>
25#include <rtems/score/states.h>
26#include <rtems/rtems/tasks.h>
27#include <rtems/score/thread.h>
28#include <rtems/score/threadq.h>
29#include <rtems/score/tod.h>
30#include <rtems/score/userext.h>
31#include <rtems/score/wkspace.h>
32#include <rtems/score/apiext.h>
33#include <rtems/score/sysstate.h>
34
35/*PAGE
36 *
37 *  _RTEMS_tasks_Initialize_user_tasks
38 *
39 *  This routine creates and starts all configured user
40 *  initialzation threads.
41 *
42 *  Input parameters: NONE
43 *
44 *  Output parameters:  NONE
45 */
46
47void _RTEMS_tasks_Initialize_user_tasks( void )
48{
49  uint32_t                          index;
50  uint32_t                          maximum;
51  rtems_id                          id;
52  rtems_status_code                 return_value;
53  rtems_initialization_tasks_table *user_tasks;
54
55  /*
56   *  NOTE:  This is slightly different from the Ada implementation.
57   */
58
59  user_tasks = _RTEMS_tasks_User_initialization_tasks;
60  maximum    = _RTEMS_tasks_Number_of_initialization_tasks;
61
62  if ( !user_tasks || maximum == 0 )
63    return;
64
65  for ( index=0 ; index < maximum ; index++ ) {
66    return_value = rtems_task_create(
67      user_tasks[ index ].name,
68      user_tasks[ index ].initial_priority,
69      user_tasks[ index ].stack_size,
70      user_tasks[ index ].mode_set,
71      user_tasks[ index ].attribute_set,
72      &id
73    );
74
75    if ( !rtems_is_status_successful( return_value ) )
76      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
77
78    return_value = rtems_task_start(
79      id,
80      user_tasks[ index ].entry_point,
81      user_tasks[ index ].argument
82    );
83
84    if ( !rtems_is_status_successful( return_value ) )
85      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
86  }
87}
Note: See TracBrowser for help on using the repository browser.