Subversion Repositories shark

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 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
 *   (see the web pages for full authors list)
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
 CVS :        $Id: cash.h,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1.1.1 $
27
 Last update: $Date: 2002-09-02 09:37:41 $
28
 ------------
29
 
30
 This file contains the server CBSHD (CASH Algorithm)
31
 
32
 Title:
33
   CBSHD (Constant Bandwidth Server with hard deadlines)
34
 
35
 Task Models Accepted:
36
   ELASTIC_HARD_TASK_MODEL - Elastic Hard Tasks
37
     wcet field must be != 0
38
     cnormal field must be != 0
39
     period field must be != 0
40
 
41
 Description:
42
   This module schedule his tasks following the CBSHD scheme.
43
   (see Marco Caccamo, Giorgio Buttazzo and Lui Sha
44
        "Elastic Feedback Control"
45
        Proceedings of the EUROMICRO 2000)
46
 
47
   The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
48
   and the CBSHD level expects that the task is scheduled with the absolute
49
   deadline passed in the model.
50
 
51
   The task guarantee is based on the factor utilization approach.
52
 
53
 Exceptions raised:
54
   XUNVALID_GUEST
55
     This level doesn't support guests. When a guest operation
56
     is called, the exception is raised.
57
 
58
   These exceptions are pclass-dependent...
59
   XDEADLINE_MISS
60
     If a task miss his deadline, the exception is raised.
61
 
62
 Restrictions & special features:
63
   - This level doesn't manage the main task.
64
   - At init time we have to specify:
65
       . guarantee check
66
          (when all task are created the system will check that the task_set
67
          will not use more than the available bandwidth)
68
   - A function to return the used bandwidth of the level is provided.
69
   - A function to return the pending activations of the task.
70
 
71
**/
72
 
73
/*
74
 * Copyright (C) 2000 Paolo Gai
75
 *
76
 * This program is free software; you can redistribute it and/or modify
77
 * it under the terms of the GNU General Public License as published by
78
 * the Free Software Foundation; either version 2 of the License, or
79
 * (at your option) any later version.
80
 *
81
 * This program is distributed in the hope that it will be useful,
82
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
83
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
84
 * GNU General Public License for more details.
85
 *
86
 * You should have received a copy of the GNU General Public License
87
 * along with this program; if not, write to the Free Software
88
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
89
 *
90
 */
91
 
92
 
93
#ifndef __CBSGHD_H__
94
#define __CBSGHD_H__
95
 
96
#include <ll/ll.h>
97
#include <kernel/config.h>
98
#include <sys/types.h>
99
#include <kernel/types.h>
100
#include <modules/codes.h>
101
 
102
 
103
 
104
 
105
 
106
 
107
 
108
 
109
/*+ flags... +*/
110
#define CBSGHD_ENABLE_GUARANTEE      1  /*+ Task Guarantee enabled +*/
111
#define CBSGHD_ENABLE_ALL            1
112
 
113
#define CBSGHD_FAILED_GUARANTEE      8  /*+ used in the module, unsettabl
114
                                         in EDF_register_level... +*/
115
 
116
 
117
 
118
 
119
 
120
#define ELASTIC_HARD_PCLASS 0x0600                              
121
 
122
#define CBSGHD_LEVELNAME        "CBSGHD base"
123
#define CBSGHD_LEVEL_CODE       106
124
#define CBSGHD_LEVEL_VERSION    1
125
 
126
 
127
/* -----------------------------------------------------------------------
128
   ELASTIC_HARD_TASK_MODEL: elastic hard Tasks
129
   ----------------------------------------------------------------------- */
130
 
131
 
132
typedef struct {
133
  TASK_MODEL t;
134
  TIME cnormal;
135
  TIME period;
136
  TIME wcet;
137
  TIME maxperiod;
138
} ELASTIC_HARD_TASK_MODEL;
139
 
140
#define elastic_hard_task_default_model(m)                             \
141
                        task_default_model((m).t,ELASTIC_HARD_PCLASS), \
142
                        (m).cnormal    = 0,                            \
143
                        (m).period     = 0,                            \
144
                        (m).wcet       = 0,                            \
145
                        (m).maxperiod  = 0
146
#define elastic_hard_task_def_level(m,l)      task_def_level((m).t,l)
147
#define elastic_hard_task_def_arg(m,a)        task_def_arg((m).t,a)
148
#define elastic_hard_task_def_stack(m,s)      task_def_stack((m).t,s)
149
#define elastic_hard_task_def_stackaddr(m,s)  task_def_stackaddr((m).t,s)
150
#define elastic_hard_task_def_group(m,g)      task_def_group((m).t,g)
151
#define elastic_hard_task_def_usemath(m)      task_def_usemath((m).t)
152
#define elastic_hard_task_def_system(m)       task_def_system((m).t)
153
#define elastic_hard_task_def_nokill(m)       task_def_nokill((m).t)
154
#define elastic_hard_task_def_ctrl_jet(m)     task_def_ctrl_jet((m).t)
155
#define elastic_hard_task_def_cnormal(m,c)    (m).cnormal = (c)
156
#define elastic_hard_task_def_period(m,p)     (m).period = (p)
157
#define elastic_hard_task_def_wcet(m,w)       (m).wcet = (w)
158
#define elastic_hard_task_def_maxperiod(m,p)  (m).maxperiod = (p)       
159
#define elastic_hard_task_def_joinable(m)     task_def_joinable((m).t)
160
#define elastic_hard_task_def_unjoinable(m)   task_def_unjoinable((m).t)
161
 
162
 
163
 
164
 
165
/*+ Registration function:
166
    int flags     Options to be used in this level instance...
167
    LEVEL master  the level that must be used as master level for the
168
                  CBSGHD tasks
169
+*/
170
void CBSGHD_register_level(int flags, LEVEL master);
171
 
172
/*+ Returns the used bandwidth of a level +*/
173
bandwidth_t CBSGHD_usedbandwidth(LEVEL l);
174
 
175
#endif
176