1 | Constant Bandwidth Server Scheduler API |
---|
2 | ####################################### |
---|
3 | |
---|
4 | .. index:: cbs |
---|
5 | |
---|
6 | Introduction |
---|
7 | ============ |
---|
8 | |
---|
9 | Unlike simple schedulers, the Constant Bandwidth Server (CBS) requires |
---|
10 | a special API for tasks to indicate their scheduling parameters. |
---|
11 | The directives provided by the CBS API are: |
---|
12 | |
---|
13 | - ``rtems_cbs_initialize`` - Initialize the CBS library |
---|
14 | |
---|
15 | - ``rtems_cbs_cleanup`` - Cleanup the CBS library |
---|
16 | |
---|
17 | - ``rtems_cbs_create_server`` - Create a new bandwidth server |
---|
18 | |
---|
19 | - ``rtems_cbs_attach_thread`` - Attach a thread to server |
---|
20 | |
---|
21 | - ``rtems_cbs_detach_thread`` - Detach a thread from server |
---|
22 | |
---|
23 | - ``rtems_cbs_destroy_server`` - Destroy a bandwidth server |
---|
24 | |
---|
25 | - ``rtems_cbs_get_server_id`` - Get an ID of a server |
---|
26 | |
---|
27 | - ``rtems_cbs_get_parameters`` - Get scheduling parameters of a server |
---|
28 | |
---|
29 | - ``rtems_cbs_set_parameters`` - Set scheduling parameters of a server |
---|
30 | |
---|
31 | - ``rtems_cbs_get_execution_time`` - Get elapsed execution time |
---|
32 | |
---|
33 | - ``rtems_cbs_get_remaining_budget`` - Get remainig execution time |
---|
34 | |
---|
35 | - ``rtems_cbs_get_approved_budget`` - Get scheduler approved execution time |
---|
36 | |
---|
37 | Background |
---|
38 | ========== |
---|
39 | |
---|
40 | Constant Bandwidth Server Definitions |
---|
41 | ------------------------------------- |
---|
42 | .. index:: CBS parameters |
---|
43 | |
---|
44 | .. index:: rtems_cbs_parameters |
---|
45 | |
---|
46 | The Constant Bandwidth Server API enables tasks to communicate with |
---|
47 | the scheduler and indicate its scheduling parameters. The scheduler |
---|
48 | has to be set up first (by defining ``CONFIGURE_SCHEDULER_CBS`` macro). |
---|
49 | |
---|
50 | The difference to a plain EDF is the presence of servers. |
---|
51 | It is a budget aware extention of the EDF scheduler, therefore, tasks |
---|
52 | attached to servers behave in a similar way as with EDF unless they |
---|
53 | exceed their budget. |
---|
54 | |
---|
55 | The intention of servers is reservation of a certain computation |
---|
56 | time (budget) of the processor for all subsequent periods. The structure``rtems_cbs_parameters`` determines the behavior of |
---|
57 | a server. It contains ``deadline`` which is equal to period, |
---|
58 | and ``budget`` which is the time the server is allowed to |
---|
59 | spend on CPU per each period. The ratio between those two parameters |
---|
60 | yields the maximum percentage of the CPU the server can use |
---|
61 | (bandwidth). Moreover, thanks to this limitation the overall |
---|
62 | utilization of CPU is under control, and the sum of bandwidths |
---|
63 | of all servers in the system yields the overall reserved portion |
---|
64 | of processor. The rest is still available for ordinary tasks that |
---|
65 | are not attached to any server. |
---|
66 | |
---|
67 | In order to make the server effective to the executing tasks, |
---|
68 | tasks have to be attached to the servers. The``rtems_cbs_server_id`` is a type denoting an id of a server |
---|
69 | and ``rtems_id`` a type for id of tasks. |
---|
70 | |
---|
71 | Handling Periodic Tasks |
---|
72 | ----------------------- |
---|
73 | .. index:: CBS periodic tasks |
---|
74 | |
---|
75 | Each taskâs execution begins with a default background priority |
---|
76 | (see the chapter Scheduling Concepts to understand the concept of |
---|
77 | priorities in EDF). Once you decide the tasks should start periodic |
---|
78 | execution, you have two possibilities. Either you use only the Rate |
---|
79 | Monotonic manager which takes care of periodic behavior, or you declare |
---|
80 | deadline and budget using the CBS API in which case these properties |
---|
81 | are constant for all subsequent periods, unless you change them using |
---|
82 | the CBS API again. Task now only has to indicate and end of |
---|
83 | each period using ``rtems_rate_monotonic_period``. |
---|
84 | |
---|
85 | Registering a Callback Function |
---|
86 | ------------------------------- |
---|
87 | .. index:: CBS overrun handler |
---|
88 | |
---|
89 | In case tasks attached to servers are not aware of their execution time |
---|
90 | and happen to exceed it, the scheduler does not guarantee execution any |
---|
91 | more and pulls the priority of the task to background, which would |
---|
92 | possibly lead to immediate preemption (if there is at least one ready |
---|
93 | task with a higher pirority). However, the task is not blocked but a |
---|
94 | callback function is invoked. The callback function |
---|
95 | (``rtems_cbs_budget_overrun``) might be optionally registered upon |
---|
96 | a server creation (``rtems_cbs_create_server``). |
---|
97 | |
---|
98 | This enables the user to define what should happen in case of budget |
---|
99 | overrun. There is obviously no space for huge operations because the |
---|
100 | priority is down and not real time any more, however, you still can at |
---|
101 | least in release resources for other tasks, restart the task or log an |
---|
102 | error information. Since the routine is called directly from kernel, |
---|
103 | use ``printk()`` instead of ``printf()``. |
---|
104 | |
---|
105 | The calling convention of the callback function is:.. index:: rtems_asr |
---|
106 | |
---|
107 | .. code:: c |
---|
108 | |
---|
109 | void overrun_handler( |
---|
110 | rtems_cbs_server_id server_id |
---|
111 | ); |
---|
112 | |
---|
113 | Limitations |
---|
114 | ----------- |
---|
115 | .. index:: CBS limitations |
---|
116 | |
---|
117 | When using this scheduler you have to keep in mind several things: |
---|
118 | |
---|
119 | - it_limitations |
---|
120 | |
---|
121 | - In the current implementation it is possible to attach only |
---|
122 | a single task to each server. |
---|
123 | |
---|
124 | - If you have a task attached to a server and you voluntatily |
---|
125 | block it in the beginning of its execution, its priority will be |
---|
126 | probably pulled to background upon unblock, thus not guaranteed |
---|
127 | deadline any more. This is because you are effectively raising |
---|
128 | computation time of the task. When unbocking, you should be always |
---|
129 | sure that the ratio between remaining computation time and remaining |
---|
130 | deadline is not higher that the utilization you have agreed with the |
---|
131 | scheduler. |
---|
132 | |
---|
133 | Operations |
---|
134 | ========== |
---|
135 | |
---|
136 | Setting up a server |
---|
137 | ------------------- |
---|
138 | |
---|
139 | The directive ``rtems_cbs_create_server`` is used to create a new |
---|
140 | server that is characterized by ``rtems_cbs_parameters``. You also |
---|
141 | might want to register the ``rtems_cbs_budget_overrun`` callback |
---|
142 | routine. After this step tasks can be attached to the server. The directive``rtems_cbs_set_parameters`` can change the scheduling parameters |
---|
143 | to avoid destroying and creating a new server again. |
---|
144 | |
---|
145 | Attaching Task to a Server |
---|
146 | -------------------------- |
---|
147 | |
---|
148 | If a task is attached to a server using ``rtems_cbs_attach_thread``, |
---|
149 | the taskâs computation time per period is limited by the server and |
---|
150 | the deadline (period) of task is equal to deadline of the server which |
---|
151 | means if you conclude a period using ``rate_monotonic_period``, |
---|
152 | the length of next period is always determined by the serverâs property. |
---|
153 | |
---|
154 | The task has a guaranteed bandwidth given by the server but should not |
---|
155 | exceed it, otherwise the priority is pulled to background until the |
---|
156 | start of next period and the ``rtems_cbs_budget_overrun`` callback |
---|
157 | function is invoked. |
---|
158 | |
---|
159 | When attaching a task to server, the preemptability flag of the task |
---|
160 | is raised, otherwise it would not be possible to control the execution |
---|
161 | of the task. |
---|
162 | |
---|
163 | Detaching Task from a Server |
---|
164 | ---------------------------- |
---|
165 | |
---|
166 | The directive ``rtems_cbs_detach_thread`` is just an inverse |
---|
167 | operation to the previous one, the task continues its execution with |
---|
168 | the initial priority. |
---|
169 | |
---|
170 | Preemptability of the task is restored to the initial value. |
---|
171 | |
---|
172 | Examples |
---|
173 | -------- |
---|
174 | |
---|
175 | The following example presents a simple common use of the API. |
---|
176 | |
---|
177 | You can see the initialization and cleanup call here, if there are |
---|
178 | multiple tasks in the system, it is obvious that the initialization |
---|
179 | should be called before creating the task. |
---|
180 | |
---|
181 | Notice also that in this case we decided to register an overrun handler, |
---|
182 | instead of which there could be ``NULL``. This handler just prints |
---|
183 | a message to terminal, what else may be done here depends on a specific |
---|
184 | application. |
---|
185 | |
---|
186 | During the periodic execution, remaining budget should be watched |
---|
187 | to avoid overrun. |
---|
188 | .. code:: c |
---|
189 | |
---|
190 | void overrun_handler ( |
---|
191 | rtems_cbs_server_id server_id |
---|
192 | ) |
---|
193 | { |
---|
194 | printk( "Budget overrun, fixing the task\\n" ); |
---|
195 | return; |
---|
196 | } |
---|
197 | rtems_task Tasks_Periodic( |
---|
198 | rtems_task_argument argument |
---|
199 | ) |
---|
200 | { |
---|
201 | rtems_id rmid; |
---|
202 | rtems_cbs_server_id server_id; |
---|
203 | rtems_cbs_parameters params; |
---|
204 | params.deadline = 10; |
---|
205 | params.budget = 4; |
---|
206 | rtems_cbs_initialize(); |
---|
207 | rtems_cbs_create_server( ¶ms, &overrun_handler, &server_id ) |
---|
208 | rtems_cbs_attach_thread( server_id, SELF ); |
---|
209 | rtems_rate_monotonic_create( argument, &rmid ); |
---|
210 | while ( 1 ) { |
---|
211 | if (rtems_rate_monotonic_period(rmid, params.deadline)==RTEMS_TIMEOUT) |
---|
212 | break; |
---|
213 | /* Perform some periodic action \*/ |
---|
214 | } |
---|
215 | rtems_rate_monotonic_delete( rmid ); |
---|
216 | rtems_cbs_cleanup(); |
---|
217 | exit( 1 ); |
---|
218 | } |
---|
219 | |
---|
220 | Directives |
---|
221 | ========== |
---|
222 | |
---|
223 | This section details the Constant Bandwidth Serverâs directives. |
---|
224 | A subsection is dedicated to each of this managerâs directives |
---|
225 | and describes the calling sequence, related constants, usage, |
---|
226 | and status codes. |
---|
227 | |
---|
228 | CBS_INITIALIZE - Initialize the CBS library |
---|
229 | ------------------------------------------- |
---|
230 | .. index:: initialize the CBS library |
---|
231 | |
---|
232 | **CALLING SEQUENCE:** |
---|
233 | |
---|
234 | .. index:: rtems_cbs_initialize |
---|
235 | |
---|
236 | .. code:: c |
---|
237 | |
---|
238 | int rtems_cbs_initialize( void ); |
---|
239 | |
---|
240 | **DIRECTIVE STATUS CODES:** |
---|
241 | |
---|
242 | ``RTEMS_CBS_OK`` - successful initialization |
---|
243 | ``RTEMS_CBS_ERROR_NO_MEMORY`` - not enough memory for data |
---|
244 | |
---|
245 | **DESCRIPTION:** |
---|
246 | |
---|
247 | This routine initializes the library in terms of allocating necessary memory |
---|
248 | for the servers. In case not enough memory is available in the system,``RTEMS_CBS_ERROR_NO_MEMORY`` is returned, otherwise``RTEMS_CBS_OK``. |
---|
249 | |
---|
250 | **NOTES:** |
---|
251 | |
---|
252 | Additional memory per each server is allocated upon invocation of``rtems_cbs_create_server``. |
---|
253 | |
---|
254 | Tasks in the system are not influenced, they still keep executing |
---|
255 | with their initial parameters. |
---|
256 | |
---|
257 | CBS_CLEANUP - Cleanup the CBS library |
---|
258 | ------------------------------------- |
---|
259 | .. index:: cleanup the CBS library |
---|
260 | |
---|
261 | **CALLING SEQUENCE:** |
---|
262 | |
---|
263 | .. index:: rtems_cbs_cleanup |
---|
264 | |
---|
265 | .. code:: c |
---|
266 | |
---|
267 | int rtems_cbs_cleanup( void ); |
---|
268 | |
---|
269 | **DIRECTIVE STATUS CODES:** |
---|
270 | |
---|
271 | ``RTEMS_CBS_OK`` - always successful |
---|
272 | |
---|
273 | **DESCRIPTION:** |
---|
274 | |
---|
275 | This routine detaches all tasks from their servers, destroys all servers |
---|
276 | and returns memory back to the system. |
---|
277 | |
---|
278 | **NOTES:** |
---|
279 | |
---|
280 | All tasks continue executing with their initial priorities. |
---|
281 | |
---|
282 | CBS_CREATE_SERVER - Create a new bandwidth server |
---|
283 | ------------------------------------------------- |
---|
284 | .. index:: create a new bandwidth server |
---|
285 | |
---|
286 | **CALLING SEQUENCE:** |
---|
287 | |
---|
288 | .. index:: rtems_cbs_create_server |
---|
289 | |
---|
290 | .. code:: c |
---|
291 | |
---|
292 | int rtems_cbs_create_server ( |
---|
293 | rtems_cbs_parameters \*params, |
---|
294 | rtems_cbs_budget_overrun budget_overrun_callback, |
---|
295 | rtems_cbs_server_id \*server_id |
---|
296 | ); |
---|
297 | |
---|
298 | **DIRECTIVE STATUS CODES:** |
---|
299 | |
---|
300 | ``RTEMS_CBS_OK`` - successfully created |
---|
301 | ``RTEMS_CBS_ERROR_NO_MEMORY`` - not enough memory for data |
---|
302 | ``RTEMS_CBS_ERROR_FULL`` - maximum servers exceeded |
---|
303 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
304 | |
---|
305 | **DESCRIPTION:** |
---|
306 | |
---|
307 | This routine prepares an instance of a constant bandwidth server. |
---|
308 | The input parameter ``rtems_cbs_parameters`` specifies scheduling |
---|
309 | parameters of the server (period and budget). If these are not valid,``RTEMS_CBS_ERROR_INVALID_PARAMETER`` is returned. |
---|
310 | The ``budget_overrun_callback`` is an optional callback function, which is |
---|
311 | invoked in case the serverâs budget within one period is exceeded. |
---|
312 | Output parameter ``server_id`` becomes an id of the newly created server. |
---|
313 | If there is not enough memory, the ``RTEMS_CBS_ERROR_NO_MEMORY`` |
---|
314 | is returned. If the maximum server count in the system is exceeded,``RTEMS_CBS_ERROR_FULL`` is returned. |
---|
315 | |
---|
316 | **NOTES:** |
---|
317 | |
---|
318 | No task execution is being influenced so far. |
---|
319 | |
---|
320 | CBS_ATTACH_THREAD - Attach a thread to server |
---|
321 | --------------------------------------------- |
---|
322 | .. index:: attach a thread to server |
---|
323 | |
---|
324 | **CALLING SEQUENCE:** |
---|
325 | |
---|
326 | .. index:: rtems_cbs_attach_thread |
---|
327 | |
---|
328 | .. code:: c |
---|
329 | |
---|
330 | int rtems_cbs_attach_thread ( |
---|
331 | rtems_cbs_server_id server_id, |
---|
332 | rtems_id task_id |
---|
333 | ); |
---|
334 | |
---|
335 | **DIRECTIVE STATUS CODES:** |
---|
336 | |
---|
337 | ``RTEMS_CBS_OK`` - successfully attached |
---|
338 | ``RTEMS_CBS_ERROR_FULL`` - server maximum tasks exceeded |
---|
339 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
340 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
341 | |
---|
342 | **DESCRIPTION:** |
---|
343 | |
---|
344 | Attaches a task (``task_id``) to a server (``server_id``). |
---|
345 | The server has to be previously created. Now, the task starts |
---|
346 | to be scheduled according to the server parameters and not |
---|
347 | using initial priority. This implementation allows only one task |
---|
348 | per server, if the user tries to bind another task to the same |
---|
349 | server, ``RTEMS_CBS_ERROR_FULL`` is returned. |
---|
350 | |
---|
351 | **NOTES:** |
---|
352 | |
---|
353 | Tasks attached to servers become preemptible. |
---|
354 | |
---|
355 | CBS_DETACH_THREAD - Detach a thread from server |
---|
356 | ----------------------------------------------- |
---|
357 | .. index:: detach a thread from server |
---|
358 | |
---|
359 | **CALLING SEQUENCE:** |
---|
360 | |
---|
361 | .. index:: rtems_cbs_detach_thread |
---|
362 | |
---|
363 | .. code:: c |
---|
364 | |
---|
365 | int rtems_cbs_detach_thread ( |
---|
366 | rtems_cbs_server_id server_id, |
---|
367 | rtems_id task_id |
---|
368 | ); |
---|
369 | |
---|
370 | **DIRECTIVE STATUS CODES:** |
---|
371 | |
---|
372 | ``RTEMS_CBS_OK`` - successfully detached |
---|
373 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
374 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
375 | |
---|
376 | **DESCRIPTION:** |
---|
377 | |
---|
378 | This directive detaches a thread from server. The task continues its |
---|
379 | execution with initial priority. |
---|
380 | |
---|
381 | **NOTES:** |
---|
382 | |
---|
383 | The server can be reused for any other task. |
---|
384 | |
---|
385 | CBS_DESTROY_SERVER - Destroy a bandwidth server |
---|
386 | ----------------------------------------------- |
---|
387 | .. index:: destroy a bandwidth server |
---|
388 | |
---|
389 | **CALLING SEQUENCE:** |
---|
390 | |
---|
391 | .. index:: rtems_cbs_destroy_server |
---|
392 | |
---|
393 | .. code:: c |
---|
394 | |
---|
395 | int rtems_cbs_destroy_server ( |
---|
396 | rtems_cbs_server_id server_id |
---|
397 | ); |
---|
398 | |
---|
399 | **DIRECTIVE STATUS CODES:** |
---|
400 | |
---|
401 | ``RTEMS_CBS_OK`` - successfully destroyed |
---|
402 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
403 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
404 | |
---|
405 | **DESCRIPTION:** |
---|
406 | |
---|
407 | This directive destroys a server. If any task was attached to the server, |
---|
408 | the task is detached and continues its execution according to EDF rules |
---|
409 | with initial properties. |
---|
410 | |
---|
411 | **NOTES:** |
---|
412 | |
---|
413 | This again enables one more task to be created. |
---|
414 | |
---|
415 | CBS_GET_SERVER_ID - Get an ID of a server |
---|
416 | ----------------------------------------- |
---|
417 | .. index:: get an ID of a server |
---|
418 | |
---|
419 | **CALLING SEQUENCE:** |
---|
420 | |
---|
421 | .. index:: rtems_cbs_get_server_id |
---|
422 | |
---|
423 | .. code:: c |
---|
424 | |
---|
425 | int rtems_cbs_get_server_id ( |
---|
426 | rtems_id task_id, |
---|
427 | rtems_cbs_server_id \*server_id |
---|
428 | ); |
---|
429 | |
---|
430 | **DIRECTIVE STATUS CODES:** |
---|
431 | |
---|
432 | ``RTEMS_CBS_OK`` - successful |
---|
433 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
434 | |
---|
435 | **DESCRIPTION:** |
---|
436 | |
---|
437 | This directive returns an id of server belonging to a given task. |
---|
438 | |
---|
439 | CBS_GET_PARAMETERS - Get scheduling parameters of a server |
---|
440 | ---------------------------------------------------------- |
---|
441 | .. index:: get scheduling parameters of a server |
---|
442 | |
---|
443 | **CALLING SEQUENCE:** |
---|
444 | |
---|
445 | .. index:: rtems_cbs_get_parameters |
---|
446 | |
---|
447 | .. code:: c |
---|
448 | |
---|
449 | rtems_cbs_get_parameters ( |
---|
450 | rtems_cbs_server_id server_id, |
---|
451 | rtems_cbs_parameters \*params |
---|
452 | ); |
---|
453 | |
---|
454 | **DIRECTIVE STATUS CODES:** |
---|
455 | |
---|
456 | ``RTEMS_CBS_OK`` - successful |
---|
457 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
458 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
459 | |
---|
460 | **DESCRIPTION:** |
---|
461 | |
---|
462 | This directive returns a structure with current scheduling parameters |
---|
463 | of a given server (period and execution time). |
---|
464 | |
---|
465 | **NOTES:** |
---|
466 | |
---|
467 | It makes no difference if any task is assigned or not. |
---|
468 | |
---|
469 | CBS_SET_PARAMETERS - Set scheduling parameters |
---|
470 | ---------------------------------------------- |
---|
471 | .. index:: set scheduling parameters |
---|
472 | |
---|
473 | **CALLING SEQUENCE:** |
---|
474 | |
---|
475 | .. index:: rtems_cbs_set_parameters |
---|
476 | |
---|
477 | .. code:: c |
---|
478 | |
---|
479 | int rtems_cbs_set_parameters ( |
---|
480 | rtems_cbs_server_id server_id, |
---|
481 | rtems_cbs_parameters \*params |
---|
482 | ); |
---|
483 | |
---|
484 | **DIRECTIVE STATUS CODES:** |
---|
485 | |
---|
486 | ``RTEMS_CBS_OK`` - successful |
---|
487 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
488 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
489 | |
---|
490 | **DESCRIPTION:** |
---|
491 | |
---|
492 | This directive sets new scheduling parameters to the server. This operation |
---|
493 | can be performed regardless of whether a task is assigned or not. |
---|
494 | If a task is assigned, the parameters become effective imediately, therefore it |
---|
495 | is recommended to apply the change between two subsequent periods. |
---|
496 | |
---|
497 | **NOTES:** |
---|
498 | |
---|
499 | There is an upper limit on both period and budget equal to (2^31)-1 ticks. |
---|
500 | |
---|
501 | CBS_GET_EXECUTION_TIME - Get elapsed execution time |
---|
502 | --------------------------------------------------- |
---|
503 | .. index:: get elapsed execution time |
---|
504 | |
---|
505 | **CALLING SEQUENCE:** |
---|
506 | |
---|
507 | .. index:: rtems_cbs_get_execution_time |
---|
508 | |
---|
509 | .. code:: c |
---|
510 | |
---|
511 | int rtems_cbs_get_execution_time ( |
---|
512 | rtems_cbs_server_id server_id, |
---|
513 | time_t \*exec_time, |
---|
514 | time_t \*abs_time |
---|
515 | ); |
---|
516 | |
---|
517 | **DIRECTIVE STATUS CODES:** |
---|
518 | |
---|
519 | ``RTEMS_CBS_OK`` - successful |
---|
520 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
521 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
522 | |
---|
523 | **DESCRIPTION:** |
---|
524 | |
---|
525 | This routine returns consumed execution time (``exec_time``) of a server |
---|
526 | during the current period. |
---|
527 | |
---|
528 | **NOTES:** |
---|
529 | |
---|
530 | Absolute time (``abs_time``) not supported now. |
---|
531 | |
---|
532 | CBS_GET_REMAINING_BUDGET - Get remaining execution time |
---|
533 | ------------------------------------------------------- |
---|
534 | .. index:: get remaining execution time |
---|
535 | |
---|
536 | **CALLING SEQUENCE:** |
---|
537 | |
---|
538 | .. index:: rtems_cbs_get_remaining_budget |
---|
539 | |
---|
540 | .. code:: c |
---|
541 | |
---|
542 | int rtems_cbs_get_remaining_budget ( |
---|
543 | rtems_cbs_server_id server_id, |
---|
544 | time_t \*remaining_budget |
---|
545 | ); |
---|
546 | |
---|
547 | **DIRECTIVE STATUS CODES:** |
---|
548 | |
---|
549 | ``RTEMS_CBS_OK`` - successful |
---|
550 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
551 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
552 | |
---|
553 | **DESCRIPTION:** |
---|
554 | |
---|
555 | This directive returns remaining execution time of a given server for |
---|
556 | current period. |
---|
557 | |
---|
558 | **NOTES:** |
---|
559 | |
---|
560 | If the execution time approaches zero, the assigned task should finish |
---|
561 | computations of the current period. |
---|
562 | |
---|
563 | CBS_GET_APPROVED_BUDGET - Get scheduler approved execution time |
---|
564 | --------------------------------------------------------------- |
---|
565 | .. index:: get scheduler approved execution time |
---|
566 | |
---|
567 | **CALLING SEQUENCE:** |
---|
568 | |
---|
569 | .. index:: rtems_cbs_get_approved_budget |
---|
570 | |
---|
571 | .. code:: c |
---|
572 | |
---|
573 | int rtems_cbs_get_approved_budget ( |
---|
574 | rtems_cbs_server_id server_id, |
---|
575 | time_t \*appr_budget |
---|
576 | ); |
---|
577 | |
---|
578 | **DIRECTIVE STATUS CODES:** |
---|
579 | |
---|
580 | ``RTEMS_CBS_OK`` - successful |
---|
581 | ``RTEMS_CBS_ERROR_INVALID_PARAMETER`` - invalid input argument |
---|
582 | ``RTEMS_CBS_ERROR_NOSERVER`` - server is not valid |
---|
583 | |
---|
584 | **DESCRIPTION:** |
---|
585 | |
---|
586 | This directive returns serverâs approved budget for subsequent periods. |
---|
587 | |
---|
588 | .. COMMENT: COPYRIGHT (c) 1989-2011. |
---|
589 | |
---|
590 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
591 | |
---|
592 | .. COMMENT: All rights reserved. |
---|
593 | |
---|