1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2007. |
---|
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 | |
---|
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/sysstate.h> |
---|
23 | |
---|
24 | #include <rtems/itron/task.h> |
---|
25 | |
---|
26 | |
---|
27 | /* |
---|
28 | * sta_tsk - Start Task |
---|
29 | */ |
---|
30 | |
---|
31 | ER sta_tsk( |
---|
32 | ID tskid, |
---|
33 | INT stacd __attribute__((unused)) |
---|
34 | ) |
---|
35 | { |
---|
36 | register Thread_Control *the_thread; |
---|
37 | Objects_Locations location; |
---|
38 | bool status; |
---|
39 | |
---|
40 | the_thread = _ITRON_Task_Get( tskid, &location ); |
---|
41 | switch ( location ) { |
---|
42 | #if defined(RTEMS_MULTIPROCESSING) |
---|
43 | case OBJECTS_REMOTE: |
---|
44 | #endif |
---|
45 | case OBJECTS_ERROR: |
---|
46 | return _ITRON_Task_Clarify_get_id_error( tskid ); |
---|
47 | |
---|
48 | case OBJECTS_LOCAL: |
---|
49 | |
---|
50 | if ( !_States_Is_dormant( the_thread->current_state ) ) |
---|
51 | _ITRON_return_errorno( E_OBJ ); |
---|
52 | |
---|
53 | status = _Thread_Start( |
---|
54 | the_thread, |
---|
55 | THREAD_START_NUMERIC, /* XXX should be able to say we have no arg */ |
---|
56 | the_thread->Start.entry_point, |
---|
57 | 0, /* XXX supercore forces us to have an arg */ |
---|
58 | 0 /* unused */ |
---|
59 | ); |
---|
60 | |
---|
61 | /* |
---|
62 | * This error can not happen entry_point is checked in create. |
---|
63 | if ( !status ) |
---|
64 | _ITRON_return_errorno( E_OBJ ); |
---|
65 | */ |
---|
66 | |
---|
67 | break; |
---|
68 | } |
---|
69 | |
---|
70 | _ITRON_return_errorno( E_OK ); |
---|
71 | } |
---|