Subversion Repositories shark

Rev

Rev 2 | 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
 ------------
24
 CVS :        $Id: ds.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 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>
95
#include <modules/codes.h>
96
 
97
/*+ 1 - ln(2) +*/
98
#ifndef RM_MINFREEBANDWIDTH
99
#define RM_MINFREEBANDWIDTH 1317922825
100
#endif
101
 
102
/*+ flags... +*/
103
#define DS_DISABLE_ALL           0
104
#define DS_ENABLE_BACKGROUND     1  /*+ Background scheduling enabled +*/
105
#define DS_ENABLE_GUARANTEE_EDF  2  /*+ Task Guarantee enabled +*/
106
#define DS_ENABLE_ALL_EDF        3  /*+ All flags enabled      +*/
107
 
108
#define DS_ENABLE_GUARANTEE_RM   4  /*+ Task Guarantee enabled +*/
109
#define DS_ENABLE_ALL_RM         5  /*+ All flags enabled      +*/
110
 
111
/*+ internal flags +*/
112
#define DS_BACKGROUND            8  /*+ this flag is set when scheduling
113
                                        in background +*/
114
#define DS_BACKGROUND_BLOCK     16  /*+ this flag is set when we want to
115
                                        blocks the background scheduling +*/
116
 
117
/*+ Registration function:
118
    bandwidth_t b Max bandwidth used by the TBS
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
                  TBS tasks
122
    int num,den   used to compute the TBS bandwidth                      +*/
123
void DS_register_level(int flags, LEVEL master, int Cs, int per);
124
 
125
/*+ Returns the used bandwidth of a level +*/
126
bandwidth_t DS_usedbandwidth(LEVEL l);
127
 
128
#endif