source:
rtems/cpukit/rtems/src/taskstart.c
@
66cb142
Last change on this file since 66cb142 was e266d13, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 13:10:27 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[4c90eb4] | 1 | /** |
2 | * @file | |
[c4d69e2] | 3 | * |
[4c90eb4] | 4 | * @brief RTEMS Start Task |
5 | * @ingroup ClassicTasks Tasks | |
6 | */ | |
7 | ||
8 | /* | |
[3a638ce] | 9 | * COPYRIGHT (c) 1989-2014. |
[c4d69e2] | 10 | * On-Line Applications Research Corporation (OAR). |
11 | * | |
12 | * The license and distribution terms for this file may be | |
13 | * found in the file LICENSE in this distribution or at | |
[c499856] | 14 | * http://www.rtems.org/license/LICENSE. |
[c4d69e2] | 15 | */ |
16 | ||
[1095ec1] | 17 | #if HAVE_CONFIG_H |
18 | #include "config.h" | |
19 | #endif | |
20 | ||
[5618c37a] | 21 | #include <rtems/rtems/tasks.h> |
22 | #include <rtems/score/threadimpl.h> | |
[c4d69e2] | 23 | |
[9c1c574b] | 24 | rtems_status_code rtems_task_start( |
[33829ce] | 25 | rtems_id id, |
26 | rtems_task_entry entry_point, | |
27 | rtems_task_argument argument | |
[c4d69e2] | 28 | ) |
29 | { | |
[ccd5434] | 30 | Thread_Entry_information entry = { |
31 | .adaptor = _Thread_Entry_adaptor_numeric, | |
32 | .Kinds = { | |
33 | .Numeric = { | |
34 | .entry = entry_point, | |
35 | .argument = argument | |
36 | } | |
37 | } | |
38 | }; | |
[33829ce] | 39 | Thread_Control *the_thread; |
40 | ISR_lock_Context lock_context; | |
41 | bool ok; | |
[c4d69e2] | 42 | |
[e266d13] | 43 | the_thread = _Thread_Get( id, &lock_context ); |
[ebe61382] | 44 | |
[33829ce] | 45 | if ( the_thread == NULL ) { |
[ebe61382] | 46 | #if defined(RTEMS_MULTIPROCESSING) |
[33829ce] | 47 | if ( _Thread_MP_Is_remote( id ) ) { |
[ebe61382] | 48 | return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; |
[33829ce] | 49 | } |
[ebe61382] | 50 | #endif |
51 | ||
[33829ce] | 52 | return RTEMS_INVALID_ID; |
[c4d69e2] | 53 | } |
54 | ||
[33829ce] | 55 | ok = _Thread_Start( the_thread, &entry, &lock_context ); |
56 | ||
57 | return ok ? RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE; | |
[c4d69e2] | 58 | } |
Note: See TracBrowser
for help on using the repository browser.