source: rtems/cpukit/itron/src/task.c @ 27b961a

4.104.115
Last change on this file since 27b961a was 27b961a, checked in by Joel Sherrill <joel.sherrill@…>, on 07/03/09 at 20:25:35

2009-07-03 Joel Sherrill <joel.sherrill@…>

  • itron/src/task.c, posix/src/pthread.c, rtems/src/tasks.c, sapi/src/exinit.c, score/include/rtems/score/apiext.h, score/src/apiext.c: No APIs currently implemented use the predriver_hook so disable it until such time as it is used.
  • Property mode set to 100644
File size: 4.5 KB
Line 
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#include <rtems/config.h>
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/apimutex.h>
23#include <rtems/score/sysstate.h>
24
25#include <rtems/itron/task.h>
26
27#if 0
28/*
29 *  _ITRON_Task_Create_extension
30 *
31 *  This routine is an extension routine that is invoked as part
32 *  of creating any type of task or thread in the system.  If the
33 *  task is created via another API, then this routine is invoked
34 *  and this API given the opportunity to initialize its extension
35 *  area.
36 */
37
38bool _ITRON_Task_Create_extension(
39  Thread_Control *executing,
40  Thread_Control *created
41)
42{
43  /*
44   *  Until we actually put data in this structure, do not even
45   *  allocate it.
46   */
47#if 0
48  ITRON_API_Control *api;
49
50  api = _Workspace_Allocate( sizeof( ITRON_API_Control ) );
51
52  if ( !api )
53    return false;
54
55  created->API_Extensions[ THREAD_API_ITRON ] = api;
56#else
57  created->API_Extensions[ THREAD_API_ITRON ] = NULL;
58#endif
59
60  /*
61   *  Initialize the ITRON API extension
62   */
63
64  return true;
65}
66
67/*
68 *  _ITRON_Task_Delete_extension
69 *
70 *  This extension routine is invoked when a task is deleted.
71 */
72
73User_extensions_routine _ITRON_Task_Delete_extension(
74  Thread_Control *executing,
75  Thread_Control *deleted
76)
77{
78  /*
79   *  Until we actually put data in this structure, do not even
80   *  allocate it.
81   */
82#if 0
83  (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_ITRON ] );
84
85  deleted->API_Extensions[ THREAD_API_ITRON ] = NULL;
86#endif
87}
88#endif
89
90/*
91 *  _ITRON_Task_Initialize_user_tasks
92 *
93 *  This routine creates and starts all configured user
94 *  initialzation threads.
95 */
96
97void _ITRON_Task_Initialize_user_tasks( void )
98{
99  if ( _ITRON_Initialize_user_tasks_p )
100    (*_ITRON_Initialize_user_tasks_p)();
101}
102
103/*
104 *  At this point in time, the ITRON API does not need any other
105 *  extensions.  See the POSIX and RTEMS API extensions for
106 *  examples of how they can be used.
107 */
108
109/*
110 *  Extension Tables
111 */
112
113API_extensions_Control _ITRON_Task_API_extensions = {
114  { NULL, NULL },
115  #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
116    NULL,                                   /* predriver */
117  #endif
118  _ITRON_Task_Initialize_user_tasks,        /* postdriver */
119  NULL                                      /* post switch */
120};
121
122/*
123 *  Until ITRON needs this, do not even declare it.
124 */
125#if 0
126User_extensions_Control _ITRON_Task_User_extensions = {
127  { NULL, NULL },
128  { { NULL, NULL }, NULL },
129  {
130    _ITRON_Task_Create_extension,             /* create */
131    NULL,                                     /* start */
132    NULL,                                     /* restart */
133    _ITRON_Task_Delete_extension,             /* delete */
134    NULL,                                     /* switch */
135    NULL,                                     /* begin */
136    NULL,                                     /* exitted */
137    NULL                                      /* fatal */
138  }
139};
140#endif
141
142/*
143 *  _ITRON_Task_Manager_initialization
144 *
145 *  This routine initializes all Task Manager related data structures.
146 *
147 *  Input parameters:
148 *    maximum_tasks       - number of tasks to initialize
149 *
150 *  Output parameters:  NONE
151 */
152
153void _ITRON_Task_Manager_initialization(void)
154{
155
156  _Objects_Initialize_information(
157    &_ITRON_Task_Information,   /* object information table */
158    OBJECTS_ITRON_API,          /* object API */
159    OBJECTS_ITRON_TASKS,        /* object class */
160    Configuration_ITRON_API.maximum_tasks,
161                                /* maximum objects of this class */
162    sizeof( Thread_Control ),   /* size of this object's control block */
163    FALSE,                      /* TRUE if names for this object are strings */
164    ITRON_MAXIMUM_NAME_LENGTH   /* maximum length of each object's name */
165#if defined(RTEMS_MULTIPROCESSING)
166    ,
167    FALSE,                      /* TRUE if this is a global object class */
168    NULL                        /* Proxy extraction support callout */
169#endif
170  );
171
172  /*
173   *  Until ITRON needs this, do not even declare it.
174   */
175  #if 0
176    /*
177     *  Add all the extensions for this API
178     */
179    _User_extensions_Add_API_set( &_ITRON_Task_User_extensions );
180  #endif
181
182  _API_extensions_Add( &_ITRON_Task_API_extensions );
183
184}
Note: See TracBrowser for help on using the repository browser.