Rev 961 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
961 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * Massimiliano Giorgi <massy@gandalf.sssup.it> |
||
11 | * Luca Abeni <luca@gandalf.sssup.it> |
||
12 | * Giacomo Guidi <giacomo@gandalf.sssup.it> |
||
13 | * |
||
14 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
15 | * |
||
16 | * http://www.sssup.it |
||
17 | * http://retis.sssup.it |
||
18 | * http://shark.sssup.it |
||
19 | */ |
||
20 | |||
21 | /* |
||
22 | |||
23 | This file contains the aperiodic server CBS (Total Bandwidth Server) |
||
24 | with hard reservation and met/period update |
||
25 | |||
26 | Title: |
||
27 | CBS (Constant Bandwidth Server) |
||
28 | |||
29 | Task Models Accepted: |
||
30 | SOFT_TASK_MODEL - Soft Tasks |
||
31 | wcet field is ignored |
||
32 | met field must be != 0 |
||
33 | period field must be != 0 |
||
34 | periodicity field can be either PERIODIC or APERIODIC |
||
35 | arrivals field can be either SAVE or SKIP |
||
36 | |||
37 | Description: |
||
38 | This module schedule his tasks following the CBS scheme. |
||
39 | (see Luca Abeni and Giorgio Buttazzo, |
||
40 | "Integrating Multimedia Applications in Hard Real-Time Systems" |
||
41 | Proceedings of the IEEE Real-Time Systems Symposium, Madrid, Spain, |
||
42 | December 1998) |
||
43 | |||
44 | The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL, |
||
45 | and the CBS level expects that the task is scheduled with the absolute |
||
46 | deadline passed in the model. |
||
47 | |||
48 | The task guarantee is based on the factor utilization approach. |
||
49 | |||
50 | Exceptions raised: |
||
51 | XUNVALID_GUEST |
||
52 | This level doesn't support guests. When a guest operation |
||
53 | is called, the exception is raised. |
||
54 | |||
55 | These exceptions are pclass-dependent... |
||
56 | XDEADLINE_MISS |
||
57 | If a task miss his deadline, the exception is raised. |
||
58 | Normally, a CBS task can't cause the raise of such exception because |
||
59 | if it really use more time than declared the deadline is postponed. |
||
60 | |||
61 | Restrictions & special features: |
||
62 | - This level doesn't manage the main task. |
||
63 | - At init time we have to specify: |
||
64 | . guarantee check |
||
65 | (when all task are created the system will check that the task_set |
||
66 | will not use more than the available bandwidth) |
||
67 | - A function to return the used bandwidth of the level is provided. |
||
68 | - A function to return the pending activations of the task. |
||
69 | |||
70 | **/ |
||
71 | |||
72 | /* |
||
73 | * Copyright (C) 2000 Paolo Gai |
||
74 | * |
||
75 | * This program is free software; you can redistribute it and/or modify |
||
76 | * it under the terms of the GNU General Public License as published by |
||
77 | * the Free Software Foundation; either version 2 of the License, or |
||
78 | * (at your option) any later version. |
||
79 | * |
||
80 | * This program is distributed in the hope that it will be useful, |
||
81 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
82 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
83 | * GNU General Public License for more details. |
||
84 | * |
||
85 | * You should have received a copy of the GNU General Public License |
||
86 | * along with this program; if not, write to the Free Software |
||
87 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
88 | * |
||
89 | */ |
||
90 | |||
91 | |||
92 | #ifndef __HCBS_H__ |
||
93 | #define __HCBS_H__ |
||
94 | |||
95 | #include <ll/ll.h> |
||
96 | #include <kernel/config.h> |
||
97 | #include <sys/types.h> |
||
98 | #include <kernel/types.h> |
||
1689 | fabio | 99 | #include <arch/sys/cdefs.h> |
961 | pj | 100 | |
101 | __BEGIN_DECLS |
||
102 | |||
103 | /*+ flags... +*/ |
||
104 | #define HCBS_DISABLE_ALL 0 /*+ Task Guarantee enabled +*/ |
||
105 | #define HCBS_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/ |
||
106 | #define HCBS_ENABLE_ALL 1 |
||
107 | |||
108 | #define HCBS_SET_PERIOD 0 |
||
109 | #define HCBS_GET_PERIOD 1 |
||
110 | #define HCBS_SET_MET 2 |
||
111 | #define HCBS_GET_MET 3 |
||
112 | |||
113 | typedef struct { |
||
114 | |||
115 | int command; |
||
116 | TIME param; |
||
117 | |||
118 | } HCBS_command_message; |
||
119 | |||
120 | /*+ Registration function: |
||
121 | int flags Options to be used in this level instance... |
||
122 | LEVEL master the level that must be used as master level for the |
||
123 | CBS tasks |
||
124 | |||
125 | returns the level number at which the module has been registered. |
||
126 | +*/ |
||
127 | LEVEL HCBS_register_level(int flags, LEVEL master); |
||
128 | |||
129 | /*+ Returns the used bandwidth of a level +*/ |
||
130 | bandwidth_t HCBS_usedbandwidth(LEVEL l); |
||
131 | |||
132 | /*+ Returns the number of pending activations of a task. |
||
133 | No control is done if the task is not a CBS task! +*/ |
||
134 | int HCBS_get_nact(LEVEL l, PID p); |
||
135 | |||
136 | __END_DECLS |
||
137 | #endif |