1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Initializes Thread and Executes it |
---|
5 | * |
---|
6 | * @ingroup ScoreThread |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-1999. |
---|
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.com/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/system.h> |
---|
23 | #include <rtems/score/apiext.h> |
---|
24 | #include <rtems/score/context.h> |
---|
25 | #include <rtems/score/interr.h> |
---|
26 | #include <rtems/score/isr.h> |
---|
27 | #include <rtems/score/object.h> |
---|
28 | #include <rtems/score/priority.h> |
---|
29 | #include <rtems/score/states.h> |
---|
30 | #include <rtems/score/sysstate.h> |
---|
31 | #include <rtems/score/thread.h> |
---|
32 | #include <rtems/score/threadq.h> |
---|
33 | #include <rtems/score/userextimpl.h> |
---|
34 | #include <rtems/score/wkspace.h> |
---|
35 | |
---|
36 | bool _Thread_Start( |
---|
37 | Thread_Control *the_thread, |
---|
38 | Thread_Start_types the_prototype, |
---|
39 | void *entry_point, |
---|
40 | void *pointer_argument, |
---|
41 | Thread_Entry_numeric_type numeric_argument |
---|
42 | ) |
---|
43 | { |
---|
44 | if ( _States_Is_dormant( the_thread->current_state ) ) { |
---|
45 | |
---|
46 | the_thread->Start.entry_point = (Thread_Entry) entry_point; |
---|
47 | |
---|
48 | the_thread->Start.prototype = the_prototype; |
---|
49 | the_thread->Start.pointer_argument = pointer_argument; |
---|
50 | the_thread->Start.numeric_argument = numeric_argument; |
---|
51 | |
---|
52 | _Thread_Load_environment( the_thread ); |
---|
53 | |
---|
54 | _Thread_Ready( the_thread ); |
---|
55 | |
---|
56 | _User_extensions_Thread_start( the_thread ); |
---|
57 | |
---|
58 | return true; |
---|
59 | } |
---|
60 | |
---|
61 | return false; |
---|
62 | } |
---|