source: rtems/cpukit/sapi/inline/rtems/cbs.inl @ 27f071cd

4.115
Last change on this file since 27f071cd was 27f071cd, checked in by Alex Ivanov <alexivanov97@…>, on 01/08/13 at 13:13:41

sapi: Doxygen Clean Up Task #1

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/**
2 * @file
3 *
4 * @brief Constants and Structures Associated with the CBS Library
5 *
6 * This include file contains all the constants and structures associated
7 * with the CBS library.
8 *
9 */
10
11/*
12 *  Copyright (C) 2011 Petr Benes.
13 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.com/license/LICENSE.
18 */
19
20#ifndef _RTEMS_CBS_H
21# error "Never use <rtems/cbs.inl> directly; include <rtems/cbs.h> instead."
22#endif
23
24#include <rtems/score/schedulercbs.h>
25
26/**
27 * @brief Initialize the CBS library.
28 *
29 * Initializes the CBS library.
30 *
31 * @return status code.
32 */
33RTEMS_INLINE_ROUTINE int rtems_cbs_initialize ( void )
34{
35  return _Scheduler_CBS_Initialize();
36}
37
38/**
39 * @brief Cleanup resources associated to the CBS Library
40 *
41 * Cleanup resources associated to the CBS Library.
42 *
43 * @return status code.
44 */
45RTEMS_INLINE_ROUTINE int rtems_cbs_cleanup ( void )
46{
47  return _Scheduler_CBS_Cleanup();
48}
49
50/**
51 * @brief Create a new server with specified parameters.
52 *
53 * Create a new server with specified parameters.
54 *
55 * @return status code.
56 */
57RTEMS_INLINE_ROUTINE int rtems_cbs_create_server (
58  rtems_cbs_parameters     *params,
59  rtems_cbs_budget_overrun  budget_overrun_callback,
60  rtems_cbs_server_id      *server_id
61)
62{
63  return _Scheduler_CBS_Create_server(
64             params,
65             budget_overrun_callback,
66             server_id
67         );
68}
69
70/**
71 * @brief Attach a task to an already existing server.
72 *
73 * Attach a task to an already existing server.
74 *
75 * @return status code.
76 */
77RTEMS_INLINE_ROUTINE int rtems_cbs_attach_thread (
78  rtems_cbs_server_id server_id,
79  rtems_id            task_id
80)
81{
82  return _Scheduler_CBS_Attach_thread( server_id, task_id );
83}
84
85/**
86 * @brief Detach from the CBS server.
87 *
88 * Detach from the CBS Server.
89 *
90 * @return status code.
91 */
92RTEMS_INLINE_ROUTINE int rtems_cbs_detach_thread (
93  rtems_cbs_server_id server_id,
94  rtems_id            task_id
95)
96{
97  return _Scheduler_CBS_Detach_thread( server_id, task_id );
98}
99
100/**
101 * @brief Detach all tasks from a server and destroy it.
102 *
103 * Detach all tasks from a server and destroy it.
104 *
105 * @return status code.
106 */
107RTEMS_INLINE_ROUTINE int rtems_cbs_destroy_server (
108  rtems_cbs_server_id server_id
109)
110{
111  return _Scheduler_CBS_Destroy_server( server_id );
112}
113
114/**
115 * @brief Get CBS server id.
116 *
117 * Get a thread server id, or RTEMS_CBS_E_NOT_FOUND if it is not
118 * attached to any server.
119 *
120 * @return status code.
121 */
122RTEMS_INLINE_ROUTINE int rtems_cbs_get_server_id (
123  rtems_id             task_id,
124  rtems_cbs_server_id *server_id
125)
126{
127  return _Scheduler_CBS_Get_server_id( task_id, server_id );
128}
129
130/**
131 * @brief Get CBS parameters.
132 *
133 * Retrieve CBS scheduling parameters.
134 *
135 * @return status code.
136 */
137RTEMS_INLINE_ROUTINE int rtems_cbs_get_parameters (
138  rtems_cbs_server_id   server_id,
139  rtems_cbs_parameters *params
140)
141{
142  return _Scheduler_CBS_Get_parameters( server_id, params );
143}
144
145/**
146 * @brief Set CBS parameters.
147 *
148 * Change CBS scheduling parameters.
149 *
150 * @return status code.
151 */
152RTEMS_INLINE_ROUTINE int rtems_cbs_set_parameters (
153  rtems_cbs_server_id   server_id,
154  rtems_cbs_parameters *params
155)
156{
157  return _Scheduler_CBS_Set_parameters( server_id, params );
158}
159
160/**
161 * @brief Get the CBS get execution time.
162 *
163 * Retrieve time info relative to the current server.
164 *
165 * @return status code.
166 */
167RTEMS_INLINE_ROUTINE int rtems_cbs_get_execution_time (
168  rtems_cbs_server_id    server_id,
169  time_t                *exec_time,
170  time_t                *abs_time
171)
172{
173  return _Scheduler_CBS_Get_execution_time( server_id, exec_time, abs_time );
174}
175
176/**
177 * @brief Get the remaining CBS budget.
178 *
179 * Retrieve remaining budget for the current server instance.
180 *
181 * @return status code.
182 */
183RTEMS_INLINE_ROUTINE int rtems_cbs_get_remaining_budget (
184  rtems_cbs_server_id  server_id,
185  time_t              *remaining_budget
186)
187{
188  return _Scheduler_CBS_Get_remaining_budget( server_id, remaining_budget );
189}
190
191/**
192 * @brief Get the approved CBS budget.
193 *
194 * Retrieve the budget that has been approved for the subsequent
195 * server instances.
196 *
197 * @return status code.
198 */
199RTEMS_INLINE_ROUTINE int rtems_cbs_get_approved_budget (
200  rtems_cbs_server_id  server_id,
201  time_t              *appr_budget
202)
203{
204  return _Scheduler_CBS_Get_approved_budget( server_id, appr_budget );
205}
Note: See TracBrowser for help on using the repository browser.