Subversion Repositories shark

Rev

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
 *   (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: ds.h,v 1.1 2005-02-25 10:53:02 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1 $
28
 Last update: $Date: 2005-02-25 10:53:02 $
29
 ------------
30
 
31
 This file contains the aperiodic server DS (Polling Server)
32
 
33
 Title:
34
   DS (Deferrable Server)
35
 
36
 Task Models Accepted:
37
   SOFT_TASK_MODEL - Soft Tasks
38
     wcet field is ignored
39
     met field is ignored
40
     period field is ignored
41
     periodicity field can be only APERIODIC
42
     arrivals field can be either SAVE or SKIP
43
 
44
 Description:
45
   This module schedule his tasks following the Deferrable Server scheme.
46
 
47
   All the tasks are put in a FIFO (FCFS) queue and at a time only the first
48
   task in the queue is put in the upper level.
49
 
50
   The module remembers pending activations when calling task_sleep...
51
 
52
 Exceptions raised:
53
   XUNVALID_GUEST
54
     This level doesn't support guests. When a guest operation
55
     is called, the exception is raised.
56
 
57
 Restrictions & special features:
58
   - This level doesn't manage the main task.
59
   - At init time we have to specify:
60
     . The Capacity and the period used by the server
61
   - The level don't use the priority field.
62
   - A function to return the used bandwidth of the level is provided.
63
   - if an aperiodic task calls a task_delay when owning a mutex implemented
64
     with shadows, the delay may have no effect, so don't use delay when
65
     using a mutex!!!
66
 
67
**/
68
 
69
/*
70
 * Copyright (C) 2000 Paolo Gai
71
 *
72
 * This program is free software; you can redistribute it and/or modify
73
 * it under the terms of the GNU General Public License as published by
74
 * the Free Software Foundation; either version 2 of the License, or
75
 * (at your option) any later version.
76
 *
77
 * This program is distributed in the hope that it will be useful,
78
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
79
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
80
 * GNU General Public License for more details.
81
 *
82
 * You should have received a copy of the GNU General Public License
83
 * along with this program; if not, write to the Free Software
84
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
85
 *
86
 */
87
 
88
 
89
#ifndef __DS_H__
90
#define __DS_H__
91
 
92
#include <kernel/config.h>
93
#include <sys/types.h>
94
#include <kernel/types.h>
1689 fabio 95
#include <arch/sys/cdefs.h>
961 pj 96
 
97
__BEGIN_DECLS
98
 
99
/*+ 1 - ln(2) +*/
100
#ifndef RM_MINFREEBANDWIDTH
101
#define RM_MINFREEBANDWIDTH 1317922825
102
#endif
103
 
104
/*+ flags... +*/
105
#define DS_DISABLE_ALL           0
106
#define DS_ENABLE_BACKGROUND     1  /*+ Background scheduling enabled +*/
107
#define DS_ENABLE_GUARANTEE_EDF  2  /*+ Task Guarantee enabled +*/
108
#define DS_ENABLE_ALL_EDF        3  /*+ All flags enabled      +*/
109
 
110
#define DS_ENABLE_GUARANTEE_RM   4  /*+ Task Guarantee enabled +*/
111
#define DS_ENABLE_ALL_RM         5  /*+ All flags enabled      +*/
112
 
113
/*+ internal flags +*/
114
#define DS_BACKGROUND            8  /*+ this flag is set when scheduling
115
                                        in background +*/
116
#define DS_BACKGROUND_BLOCK     16  /*+ this flag is set when we want to
117
                                        blocks the background scheduling +*/
118
 
119
/*+ Registration function:
120
    bandwidth_t b Max bandwidth used by the TBS
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
                  TBS tasks
124
    int num,den   used to compute the TBS bandwidth
125
 
126
    returns the level number at which the module has been registered.
127
+*/
128
LEVEL DS_register_level(int flags, LEVEL master, int Cs, int per);
129
 
130
/*+ Returns the used bandwidth of a level +*/
131
bandwidth_t DS_usedbandwidth(LEVEL l);
132
 
133
__END_DECLS
134
#endif