Subversion Repositories shark

Rev

Rev 38 | Details | Compare with Previous | 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
 ------------
80 pj 24
 CVS :        $Id: cbs.h,v 1.3 2003-03-13 13:39:04 pj Exp $
2 pj 25
 
26
 File:        $File$
80 pj 27
 Revision:    $Revision: 1.3 $
28
 Last update: $Date: 2003-03-13 13:39:04 $
2 pj 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>
80 pj 106
#include "ll/sys/cdefs.h"
2 pj 107
 
80 pj 108
__BEGIN_DECLS
109
 
2 pj 110
/*+ flags... +*/
111
#define CBS_DISABLE_ALL           0  /*+ Task Guarantee enabled +*/
112
#define CBS_ENABLE_GUARANTEE      1  /*+ Task Guarantee enabled +*/
113
#define CBS_ENABLE_ALL            1
114
 
115
#define CBS_FAILED_GUARANTEE      8  /*+ used in the module, unsettable
116
                                         in EDF_register_level... +*/
117
 
118
/*+ Registration function:
119
    int flags     Options to be used in this level instance...
120
    LEVEL master  the level that must be used as master level for the
121
                  CBS tasks
38 pj 122
 
123
    returns the level number at which the module has been registered.
2 pj 124
+*/
38 pj 125
LEVEL CBS_register_level(int flags, LEVEL master);
2 pj 126
 
127
/*+ Returns the used bandwidth of a level +*/
128
bandwidth_t CBS_usedbandwidth(LEVEL l);
129
 
130
/*+ Returns the number of pending activations of a task.
131
    No control is done if the task is not a CBS task! +*/
132
int CBS_get_nact(LEVEL l, PID p);
133
 
80 pj 134
__END_DECLS
2 pj 135
#endif