1 | /** |
---|
2 | * @file rtems/itron/task.h |
---|
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_h_ |
---|
17 | #define __RTEMS_ITRON_TASK_h_ |
---|
18 | |
---|
19 | #ifdef __cplusplus |
---|
20 | extern "C" { |
---|
21 | #endif |
---|
22 | |
---|
23 | #include <rtems/itron/object.h> |
---|
24 | #include <rtems/itron/config.h> |
---|
25 | #include <rtems/score/thread.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * This macro evaluates to TRUE if there should be a "context error." |
---|
29 | * This is defined as a blocking directive being issed from |
---|
30 | * task-independent portions or a task in dispatch disabled state. |
---|
31 | * |
---|
32 | * NOTE: Dispatching is disabled in interrupts so this should cover |
---|
33 | * both cases. |
---|
34 | */ |
---|
35 | |
---|
36 | #define _ITRON_Is_in_non_task_state() \ |
---|
37 | (_Thread_Dispatch_disable_level != 0) |
---|
38 | |
---|
39 | /* |
---|
40 | * This is the API specific information required by each thread for |
---|
41 | * the ITRON API to function correctly. |
---|
42 | */ |
---|
43 | |
---|
44 | |
---|
45 | typedef struct { |
---|
46 | uint32_t unused; /* no use for the API extension */ |
---|
47 | /* structure for ITRON identified yet */ |
---|
48 | } ITRON_API_Control; |
---|
49 | |
---|
50 | /* |
---|
51 | * The following defines the information control block used to |
---|
52 | * manage this class of objects. |
---|
53 | */ |
---|
54 | |
---|
55 | ITRON_EXTERN Objects_Information _ITRON_Task_Information; |
---|
56 | |
---|
57 | /* |
---|
58 | * These are used to manage the user initialization tasks. |
---|
59 | */ |
---|
60 | |
---|
61 | ITRON_EXTERN itron_initialization_tasks_table |
---|
62 | *_ITRON_Task_User_initialization_tasks; |
---|
63 | ITRON_EXTERN uint32_t _ITRON_Task_Number_of_initialization_tasks; |
---|
64 | |
---|
65 | |
---|
66 | /* |
---|
67 | * _ITRON_Task_Manager_initialization |
---|
68 | * |
---|
69 | * This routine initializes the ITRON Task Manager. |
---|
70 | */ |
---|
71 | |
---|
72 | void _ITRON_Task_Manager_initialization( |
---|
73 | uint32_t maximum_tasks, |
---|
74 | uint32_t number_of_initialization_tasks, |
---|
75 | itron_initialization_tasks_table *user_tasks |
---|
76 | ); |
---|
77 | |
---|
78 | /* |
---|
79 | * |
---|
80 | * _ITRON_Delete_task |
---|
81 | */ |
---|
82 | |
---|
83 | ER _ITRON_Delete_task( |
---|
84 | Thread_Control *the_thread |
---|
85 | ); |
---|
86 | |
---|
87 | /* XXX remove the need for this. Enable dispatch should not be hidden */ |
---|
88 | |
---|
89 | #define _ITRON_return_errorno( _errno ) \ |
---|
90 | do { \ |
---|
91 | _Thread_Enable_dispatch(); \ |
---|
92 | return _errno; \ |
---|
93 | } while (0); |
---|
94 | |
---|
95 | |
---|
96 | #ifndef __RTEMS_APPLICATION__ |
---|
97 | #include <rtems/itron/task.inl> |
---|
98 | #endif |
---|
99 | |
---|
100 | #ifdef __cplusplus |
---|
101 | } |
---|
102 | #endif |
---|
103 | |
---|
104 | #endif |
---|
105 | /* end of include file */ |
---|