RTEMS
taskstart.c
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2014.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
21 
22 #include <rtems/rtems/tasks.h>
23 #include <rtems/score/threadimpl.h>
24 
26  rtems_id id,
27  rtems_task_entry entry_point,
28  rtems_task_argument argument
29 )
30 {
31  Thread_Entry_information entry = {
33  .Kinds = {
34  .Numeric = {
35  .entry = entry_point,
36  .argument = argument
37  }
38  }
39  };
40  Thread_Control *the_thread;
41  ISR_lock_Context lock_context;
42  bool ok;
43 
44  the_thread = _Thread_Get( id, &lock_context );
45 
46  if ( the_thread == NULL ) {
47 #if defined(RTEMS_MULTIPROCESSING)
48  if ( _Thread_MP_Is_remote( id ) ) {
50  }
51 #endif
52 
53  return RTEMS_INVALID_ID;
54  }
55 
56  ok = _Thread_Start( the_thread, &entry, &lock_context );
57 
59 }
Thread entry information.
Definition: thread.h:130
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition: threadget.c:24
rtems_status_code rtems_task_start(rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument)
%
Definition: taskstart.c:25
CPU_Uint32ptr rtems_task_argument
This type is used to represent task argument values.
Definition: tasks.h:115
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
This status code indicates that an object was in wrong state for the requested operation.
Definition: status.h:160
This header file defines the main parts of the Tasks Manager API.
rtems_task(* rtems_task_entry)(rtems_task_argument)
This type defines the entry point of an RTEMS task.
Definition: tasks.h:222
void _Thread_Entry_adaptor_numeric(Thread_Control *executing)
Calls the start kinds numeric entry of the thread.
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
bool _Thread_Start(Thread_Control *the_thread, const Thread_Entry_information *entry, ISR_lock_Context *lock_context)
Starts the specified thread.
Definition: threadstart.c:26
This status code indicates that the operation was illegal on a remote object.
Definition: status.h:177
Inlined Routines from the Thread Handler.
void(* adaptor)(Thread_Control *executing)
Thread entry adaptor.
Definition: thread.h:138
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65