Subversion Repositories shark

Rev

Rev 3 | 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
 ------------
38 pj 24
 CVS :        $Id: edf.h,v 1.2 2003-01-07 17:12:20 pj Exp $
2 pj 25
 
26
 File:        $File$
38 pj 27
 Revision:    $Revision: 1.2 $
28
 Last update: $Date: 2003-01-07 17:12:20 $
2 pj 29
 ------------
30
 
31
 This file contains the scheduling module EDF (Earliest Deadline First)
32
 
33
 Title:
34
   EDF (Earliest Deadline First)
35
 
36
 Task Models Accepted:
37
   HARD_TASK_MODEL - Hard Tasks (Periodic and Sporadic)
38
     wcet field and mit field must be != 0. They are used to set the wcet
39
       and period of the tasks.
40
     periodicity field can be either PERIODIC or APERIODIC
41
     drel field is ignored
42
 
43
 Guest Models Accepted:
44
   JOB_TASK_MODEL - a single guest task activation
45
     Identified by an absolute deadline and a period.
46
     period field is ignored
47
 
48
 Description:
49
   This module schedule his tasks following the classic EDF scheme.
50
   The task guarantee is based on the factor utilization approach.
51
   The tasks scheduled are periodic and sporadic. The sporadic tasks
52
   are like hard task with periodicity set to APERIODIC; they are guaranteed
53
   as a periodic task with period equal to the minimum interarrival time.
54
   All the task are put in a queue and the scheduling is based on the
55
   deadline value.
56
   NO GUARANTEE is performed on guest tasks. The guarantee must be performed
57
   by the level that inserts guest tasks in the EDF level.
58
 
59
 Exceptions raised:
60
   XUNVALID_GUEST
61
     This level doesn't support guests. When a guest operation
62
     is called, the exception is raised.
63
 
64
   These exceptions are pclass-dependent...
65
   XDEADLINE_MISS
66
     If a task miss his deadline, the exception is raised.
67
 
68
   XWCET_VIOLATION
69
     If a task doesn't end the current cycle before if consume the wcet,
70
     an exception is raised, and the task is put in the EDF_WCET_VIOLATED
71
     state. To reactivate it, use EDF_task_activate via task_activate or
72
     manage directly the EDF data structure. Note that the exception is not
73
     handled properly, an XDEADLINE_MISS exeeption will also be raised at
74
     the period end...
75
 
76
   XACTIVATION
77
     If a sporadic task is activated with a rate that is greather than the
78
     rate declared in the model, this exception is raised and the task is NOT
79
     activated.
80
     This exception is also raised if we are trying to activate a periodic task
81
     stopped with task_sleep before the deadline in which the task_sleep is
82
     called.
83
 
84
 Restrictions & special features:
85
   - This level doesn't manage the main task.
86
   - At init time we can choose if the level have to activate
87
     . the wcet check
88
       (If a task require more time than declared, it is stopped and put in
89
        the state EDF_WCET_VIOLATED; a XWCET_VIOLATION exception is raised)
90
     . the task guarantee algorithm
91
       (when all task are created the system will check that the task_set
92
        will not use more than the available bandwidth)
93
   - The level use the priority and timespec_priority fields.
94
   - A function to return the used bandwidth of a level is provided.
95
   - The guest tasks don't provide the guest_endcycle function
96
 
97
**/
98
 
99
/*
100
 * Copyright (C) 2000 Paolo Gai
101
 *
102
 * This program is free software; you can redistribute it and/or modify
103
 * it under the terms of the GNU General Public License as published by
104
 * the Free Software Foundation; either version 2 of the License, or
105
 * (at your option) any later version.
106
 *
107
 * This program is distributed in the hope that it will be useful,
108
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
109
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
110
 * GNU General Public License for more details.
111
 *
112
 * You should have received a copy of the GNU General Public License
113
 * along with this program; if not, write to the Free Software
114
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
115
 *
116
 */
117
 
118
 
119
#ifndef __EDF_H__
120
#define __EDF_H__
121
 
122
#include <ll/ll.h>
123
#include <kernel/config.h>
124
#include <sys/types.h>
125
#include <kernel/types.h>
126
 
127
 
128
/*+ flags... +*/
129
#define EDF_DISABLE_ALL           0
130
#define EDF_ENABLE_WCET_CHECK     1  /*+ Wcet check enabled     +*/
131
#define EDF_ENABLE_GUARANTEE      2  /*+ Task Guarantee enabled +*/
132
#define EDF_ENABLE_ALL            3  /*+ All flags enabled      +*/
133
 
134
#define EDF_FAILED_GUARANTEE      8  /*+ used in the module, unsettable
135
                                         in EDF_register_level... +*/
136
 
137
 
138
/*+ Registration function:
38 pj 139
    int flag     Options to be used in this level instance...
2 pj 140
 
38 pj 141
    returns the level number at which the module has been registered.
142
+*/
143
LEVEL EDF_register_level(int flag);
144
 
2 pj 145
/*+ Returns the used bandwidth of a level +*/
146
bandwidth_t EDF_usedbandwidth(LEVEL l);
147
 
148
#endif