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

4.115
Last change on this file since 8348518 was 8348518, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/05/11 at 08:53:18

2011-12-05 Ralf Corsépius <ralf.corsepius@…>

  • rtems/src/taskinitusers.c: Fix typos.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *  RTEMS Task Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-2008.
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/config.h>
21#include <rtems/rtems/status.h>
22#include <rtems/rtems/support.h>
23#include <rtems/rtems/modes.h>
24#include <rtems/score/object.h>
25#include <rtems/rtems/rtemsapi.h>
26#include <rtems/score/stack.h>
27#include <rtems/score/states.h>
28#include <rtems/rtems/tasks.h>
29#include <rtems/score/thread.h>
30#include <rtems/score/threadq.h>
31#include <rtems/score/tod.h>
32#include <rtems/score/userext.h>
33#include <rtems/score/wkspace.h>
34#include <rtems/score/apiext.h>
35#include <rtems/score/sysstate.h>
36
37/*
38 *  _RTEMS_tasks_Initialize_user_tasks_body
39 *
40 *  This routine creates and starts all configured user
41 *  initialization threads.
42 *
43 *  Input parameters: NONE
44 *
45 *  Output parameters:  NONE
46 */
47
48void _RTEMS_tasks_Initialize_user_tasks_body( void )
49{
50  uint32_t                          index;
51  uint32_t                          maximum;
52  rtems_id                          id;
53  rtems_status_code                 return_value;
54  rtems_initialization_tasks_table *user_tasks;
55
56  /*
57   *  Move information into local variables
58   */
59  user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table;
60  maximum    = Configuration_RTEMS_API.number_of_initialization_tasks;
61
62  /*
63   *  Verify that we have a set of user tasks to iterate
64   */
65  if ( !user_tasks )
66    return;
67
68  /*
69   *  Now iterate over the initialization tasks and create/start them.
70   */
71  for ( index=0 ; index < maximum ; index++ ) {
72    return_value = rtems_task_create(
73      user_tasks[ index ].name,
74      user_tasks[ index ].initial_priority,
75      user_tasks[ index ].stack_size,
76      user_tasks[ index ].mode_set,
77      user_tasks[ index ].attribute_set,
78      &id
79    );
80    if ( !rtems_is_status_successful( return_value ) )
81      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
82
83    return_value = rtems_task_start(
84      id,
85      user_tasks[ index ].entry_point,
86      user_tasks[ index ].argument
87    );
88    if ( !rtems_is_status_successful( return_value ) )
89      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
90  }
91}
Note: See TracBrowser for help on using the repository browser.