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

4.104.11
Last change on this file since aac75d3b was aac75d3b, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 15, 2008 at 7:21:01 PM

2008-12-15 Joel Sherrill <joel.sherrill@…>

  • itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c, posix/include/rtems/posix/config.h, posix/include/rtems/posix/posixapi.h, rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c, sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Eliminate pointers to API configuration tables in the main configuration table. Reference the main configuration table and the API configuration tables directly using the confdefs.h version rather than obtaining a pointer to it. This eliminated some variables, a potential fatal error, some unnecessary default configuration structures. Overall, about a 4.5% reduction in the code size for minimum and hello on the SPARC.
  • 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/*PAGE
38 *
39 *  _RTEMS_tasks_Initialize_user_tasks_body
40 *
41 *  This routine creates and starts all configured user
42 *  initialzation threads.
43 *
44 *  Input parameters: NONE
45 *
46 *  Output parameters:  NONE
47 */
48
49void _RTEMS_tasks_Initialize_user_tasks_body( void )
50{
51  uint32_t                          index;
52  uint32_t                          maximum;
53  rtems_id                          id;
54  rtems_status_code                 return_value;
55  rtems_initialization_tasks_table *user_tasks;
56  rtems_api_configuration_table    *api_configuration;
57
58
59  api_configuration = &Configuration_RTEMS_API;
60
61  /*
62   *  NOTE:  This is slightly different from the Ada implementation.
63   */
64
65  user_tasks = api_configuration->User_initialization_tasks_table;
66  maximum    = api_configuration->number_of_initialization_tasks;
67
68  if ( !user_tasks || maximum == 0 )
69    return;
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
81    if ( !rtems_is_status_successful( return_value ) )
82      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
83
84    return_value = rtems_task_start(
85      id,
86      user_tasks[ index ].entry_point,
87      user_tasks[ index ].argument
88    );
89
90    if ( !rtems_is_status_successful( return_value ) )
91      _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
92  }
93}
Note: See TracBrowser for help on using the repository browser.