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: ps.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 PS (Polling Server)
32
 
33
 Title:
34
   PS (Polling 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 Polling 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 __PS_H__
90
#define __PS_H__
91
 
92
#include <ll/ll.h>
93
#include <kernel/config.h>
94
#include <sys/types.h>
95
#include <kernel/types.h>
96
#include <modules/codes.h>
97
 
98
/*+ 1 - ln(2) +*/
99
#ifndef RM_MINFREEBANDWIDTH
100
#define RM_MINFREEBANDWIDTH 1317922825
101
#endif
102
 
103
/*+ flags... +*/
104
#define PS_DISABLE_ALL           0
105
#define PS_ENABLE_BACKGROUND     1  /*+ Background scheduling enabled +*/
106
#define PS_ENABLE_GUARANTEE_EDF  2  /*+ Task Guarantee enabled +*/
107
#define PS_ENABLE_ALL_EDF        3  /*+ All flags enabled      +*/
108
 
109
#define PS_ENABLE_GUARANTEE_RM   4  /*+ Task Guarantee enabled +*/
110
#define PS_ENABLE_ALL_RM         5  /*+ All flags enabled      +*/
111
 
112
/*+ internal flags +*/
113
#define PS_BACKGROUND            8  /*+ this flag is set when scheduling
114
                                        in background +*/
115
#define PS_BACKGROUND_BLOCK     16  /*+ this flag is set when we want to
116
                                        blocks the background scheduling +*/
117
 
118
/*+ Registration function:
119
    bandwidth_t b Max bandwidth used by the TBS
120
    int flags     Options to be used in this level instance...
121
    LEVEL master  the level that must be used as master level for the
122
                  TBS tasks
123
    int num,den   used to compute the TBS bandwidth                      +*/
124
void PS_register_level(int flags, LEVEL master, int Cs, int per);
125
 
126
/*+ Returns the used bandwidth of a level +*/
127
bandwidth_t PS_usedbandwidth(LEVEL l);
128
 
129
#endif