Subversion Repositories shark

Rev

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

Rev Author Line No. Line
2 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
 ------------
24
 CVS :        $Id: cbs.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1.1.1 $
28
 Last update: $Date: 2002-03-29 14:12:51 $
29
 ------------
30
 
31
 This file contains the aperiodic server CBS (Total Bandwidth Server)
32
 
33
 Title:
34
   CBS (Constant Bandwidth Server)
35
 
36
 Task Models Accepted:
37
   SOFT_TASK_MODEL - Soft Tasks
38
     wcet field is ignored
39
     met field must be != 0
40
     period field must be != 0
41
     periodicity field can be either PERIODIC or APERIODIC
42
     arrivals field can be either SAVE or SKIP
43
 
44
 Description:
45
   This module schedule his tasks following the CBS scheme.
46
   (see Luca Abeni and Giorgio Buttazzo,
47
        "Integrating Multimedia Applications in Hard Real-Time Systems"
48
        Proceedings of the IEEE Real-Time Systems Symposium, Madrid, Spain,
49
        December 1998)
50
 
51
   The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
52
   and the CBS level expects that the task is scheduled with the absolute
53
   deadline passed in the model.
54
 
55
   The task guarantee is based on the factor utilization approach.
56
 
57
 Exceptions raised:
58
   XUNVALID_GUEST
59
     This level doesn't support guests. When a guest operation
60
     is called, the exception is raised.
61
 
62
   These exceptions are pclass-dependent...
63
   XDEADLINE_MISS
64
     If a task miss his deadline, the exception is raised.
65
     Normally, a CBS task can't cause the raise of such exception because
66
     if it really use more time than declared the deadline is postponed.
67
 
68
 Restrictions & special features:
69
   - This level doesn't manage the main task.
70
   - At init time we have to specify:
71
       . guarantee check
72
          (when all task are created the system will check that the task_set
73
          will not use more than the available bandwidth)
74
   - A function to return the used bandwidth of the level is provided.
75
   - A function to return the pending activations of the task.
76
 
77
**/
78
 
79
/*
80
 * Copyright (C) 2000 Paolo Gai
81
 *
82
 * This program is free software; you can redistribute it and/or modify
83
 * it under the terms of the GNU General Public License as published by
84
 * the Free Software Foundation; either version 2 of the License, or
85
 * (at your option) any later version.
86
 *
87
 * This program is distributed in the hope that it will be useful,
88
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
89
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
90
 * GNU General Public License for more details.
91
 *
92
 * You should have received a copy of the GNU General Public License
93
 * along with this program; if not, write to the Free Software
94
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
95
 *
96
 */
97
 
98
 
99
#ifndef __CBS_H__
100
#define __CBS_H__
101
 
102
#include <ll/ll.h>
103
#include <kernel/config.h>
104
#include <sys/types.h>
105
#include <kernel/types.h>
106
#include <modules/codes.h>
107
 
108
/*+ flags... +*/
109
#define CBS_DISABLE_ALL           0  /*+ Task Guarantee enabled +*/
110
#define CBS_ENABLE_GUARANTEE      1  /*+ Task Guarantee enabled +*/
111
#define CBS_ENABLE_ALL            1
112
 
113
#define CBS_FAILED_GUARANTEE      8  /*+ used in the module, unsettable
114
                                         in EDF_register_level... +*/
115
 
116
/*+ Registration function:
117
    int flags     Options to be used in this level instance...
118
    LEVEL master  the level that must be used as master level for the
119
                  CBS tasks
120
+*/
121
void CBS_register_level(int flags, LEVEL master);
122
 
123
/*+ Returns the used bandwidth of a level +*/
124
bandwidth_t CBS_usedbandwidth(LEVEL l);
125
 
126
/*+ Returns the number of pending activations of a task.
127
    No control is done if the task is not a CBS task! +*/
128
int CBS_get_nact(LEVEL l, PID p);
129
 
130
 
131
#endif