1 | /** |
---|
2 | * @file rtems/itron/task.inl |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * COPYRIGHT (c) 1989-1999. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_ITRON_TASK_INL |
---|
17 | #define _RTEMS_ITRON_TASK_INL |
---|
18 | |
---|
19 | #ifdef __cplusplus |
---|
20 | extern "C" { |
---|
21 | #endif |
---|
22 | |
---|
23 | /* |
---|
24 | * _ITRON_Task_Allocate |
---|
25 | */ |
---|
26 | |
---|
27 | #define _ITRON_Task_Allocate( _tskid ) \ |
---|
28 | (Thread_Control *)_ITRON_Objects_Allocate_by_index( \ |
---|
29 | &_ITRON_Task_Information, \ |
---|
30 | (_tskid), \ |
---|
31 | sizeof(Thread_Control) \ |
---|
32 | ) |
---|
33 | |
---|
34 | /* |
---|
35 | * _ITRON_Task_Clarify_allocation_id_error |
---|
36 | */ |
---|
37 | |
---|
38 | #define _ITRON_Task_Clarify_allocation_id_error( _id ) \ |
---|
39 | _ITRON_Objects_Clarify_allocation_id_error( \ |
---|
40 | &_ITRON_Task_Information, (_id) ) |
---|
41 | |
---|
42 | /* |
---|
43 | * _ITRON_Task_Clarify_get_id_error |
---|
44 | */ |
---|
45 | |
---|
46 | #define _ITRON_Task_Clarify_get_id_error( _id ) \ |
---|
47 | _ITRON_Objects_Clarify_get_id_error( &_ITRON_Task_Information, (_id) ) |
---|
48 | |
---|
49 | /* |
---|
50 | * _ITRON_Task_Free |
---|
51 | */ |
---|
52 | |
---|
53 | #define _ITRON_Task_Free( _the_task ) \ |
---|
54 | _ITRON_Objects_Free( &_ITRON_Task_Information, &(_the_task)->Object ) |
---|
55 | |
---|
56 | /*PAGE |
---|
57 | * |
---|
58 | * _ITRON_Task_Get |
---|
59 | */ |
---|
60 | |
---|
61 | /* XXX fix me */ |
---|
62 | static inline Thread_Control *_ITRON_Task_Get ( |
---|
63 | ID id, |
---|
64 | Objects_Locations *location |
---|
65 | ) |
---|
66 | { |
---|
67 | if ( id == 0 ) { |
---|
68 | _Thread_Disable_dispatch(); |
---|
69 | *location = OBJECTS_LOCAL; |
---|
70 | return _Thread_Executing; |
---|
71 | } |
---|
72 | |
---|
73 | return (Thread_Control *) |
---|
74 | _ITRON_Objects_Get( &_ITRON_Task_Information, id, location ); |
---|
75 | } |
---|
76 | |
---|
77 | /*PAGE |
---|
78 | * |
---|
79 | * _ITRON_Task_Is_null |
---|
80 | */ |
---|
81 | |
---|
82 | #define _ITRON_Task_Is_null( _the_task ) \ |
---|
83 | ( (_the_task) == NULL ) |
---|
84 | |
---|
85 | /*PAGE |
---|
86 | * |
---|
87 | * _ITRON_tasks_Priority_to_Core |
---|
88 | */ |
---|
89 | |
---|
90 | #define _ITRON_Task_Priority_to_Core( _ITRON_priority ) \ |
---|
91 | ((Priority_Control) (_ITRON_priority)) |
---|
92 | |
---|
93 | /*PAGE |
---|
94 | * |
---|
95 | * _ITRON_tasks_Core_to_Priority |
---|
96 | */ |
---|
97 | |
---|
98 | #define _ITRON_Task_Core_to_Priority( _core_priority ) \ |
---|
99 | ((PRI) (_core_priority)) |
---|
100 | |
---|
101 | #ifdef __cplusplus |
---|
102 | } |
---|
103 | #endif |
---|
104 | |
---|
105 | #endif |
---|
106 | /* end of include file */ |
---|