File: rt_task_init.3.html

package info (click to toggle)
rtlinux 3.1pre3-2
  • links: PTS
  • area: non-free
  • in suites: sarge, woody
  • size: 4,892 kB
  • ctags: 4,228
  • sloc: ansic: 26,204; sh: 2,069; makefile: 1,414; perl: 855; tcl: 489; asm: 380; cpp: 42
file content (244 lines) | stat: -rw-r--r-- 3,783 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<HTML
><HEAD
><TITLE
>rt_task_init</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
"></HEAD
><BODY
CLASS="REFENTRY"
><H1
><A
NAME="AEN1"
>rt_task_init</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN5"
></A
><H2
>Name</H2
>rt_task_init&nbsp;--&nbsp;create a realtime task</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>       <I
CLASS="EMPHASIS"
>WARNING</I
> --
       This is an RTLinux v1.x compatibility function.
	For new programs, please see <TT
CLASS="FUNCTION"
>pthread_create(3)</TT
>.

       #define MODULE
       #include &#60;linux/module.h&#62;
       #include &#60;linux/kernel.h&#62;
       #include &#60;linux/version.h&#62;
       #include &#60;linux/errno.h&#62;
       #include &#60;linux/rtf.h&#62;
       #include &#60;asm/rt_irq.h&#62;

       int <TT
CLASS="FUNCTION"
>rt_task_init</TT
>(RT_TASK *<TT
CLASS="PARAMETER"
><I
>task</I
></TT
>, void (*fn)(int <TT
CLASS="PARAMETER"
><I
>data</I
></TT
>), int <TT
CLASS="PARAMETER"
><I
>data</I
></TT
>, int <TT
CLASS="PARAMETER"
><I
>stack_size</I
></TT
>, int <TT
CLASS="PARAMETER"
><I
>priority</I
></TT
>);</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN18"
></A
><H2
>WARNING</H2
><P
>This is an RTLinux v1.x compatibility function.
For new programs, please see <TT
CLASS="FUNCTION"
>pthread_create(3)</TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN22"
></A
><H2
>DESCRIPTION</H2
><P
><TT
CLASS="FUNCTION"
>rt_task_init</TT
> creates a realtime task.  <TT
CLASS="PARAMETER"
><I
>task</I
></TT
> is a structure the space for which must be provided by the application.  <TT
CLASS="PARAMETER"
><I
>task</I
></TT
> must be present during the lifetime of the realtime task;  thus it cannot be an automatic variable.  <TT
CLASS="PARAMETER"
><I
>fn</I
></TT
> is the entry point of the new task.  The parent task can send a one-integer  value  data  to  the  new task.  <TT
CLASS="PARAMETER"
><I
>stack_size</I
></TT
> is the size of the stack to be used by the  new task,  and  <TT
CLASS="PARAMETER"
><I
>priority</I
></TT
> is the priority to be given the task. The highest priority is 1, while  the  lowest  is  <TT
CLASS="PARAMETER"
><I
>RT_LOWEST_PRIORITY</I
></TT
>.</P
><P
>The newly created real-time task is initially dormant.  It is normally made active by a  call  to  <TT
CLASS="FUNCTION"
>rt_task_make_periodic</TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN34"
></A
><H2
>RETURN VALUE</H2
><P
> On  success,  0 is returned.  On failure, a negative value is returned as described below.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN37"
></A
><H2
>ERRORS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-EINVAL</DT
><DD
><P
><TT
CLASS="PARAMETER"
><I
>task</I
></TT
> is already in use by another task.</P
></DD
><DT
>-ENOMEM</DT
><DD
><P
>space could not be allocated for the realtime task.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN49"
></A
><H2
>AUTHOR</H2
><P
>Jerry Epplin, modified by Michael Barabanov (<A
HREF="mailto:baraban@fs mlabs.com"
TARGET="_top"
>baraban@fsmlabs.com</A
>)</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN53"
></A
><H2
>SEE ALSO</H2
><A
HREF="rt_task_delete.3.html"
TARGET="_top"
>rt_task_delete(3)</A
>, <A
HREF="rt_task_make_periodic.3.html"
TARGET="_top"
>rt_task_make_periodic(3)</A
>, <A
HREF="rt_task_suspend.3.html"
TARGET="_top"
>rt_task_suspend(3)</A
>, <A
HREF="rt_task_wait.3.html"
TARGET="_top"
>rt_task_wait(3)</A
>, <A
HREF="pthread_create.3.html"
TARGET="_top"
>pthread_create(3)</A
><P
>1997 Jerry Epplin.</P
><P
>Modifications for RTLinux 2.x and 3.x by Michael Barabanov. 2001 FSMLabs Inc.</P
><P
>All rights reserved.</P
></DIV
></BODY
></HTML
>