Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1663 | pj | 1 | /** |
2 | This file contains a minimal version of the scheduling module EDF (Earliest Deadline First) |
||
3 | |||
4 | Title: |
||
5 | EDF (Earliest Deadline First) |
||
6 | |||
7 | Task Models Accepted: |
||
8 | HARD_TASK_MODEL - Hard Tasks (Periodic and Sporadic) |
||
9 | wcet field and mit field must be != 0. They are used to set the wcet |
||
10 | and period of the tasks. |
||
11 | periodicity field can be either PERIODIC or APERIODIC |
||
12 | drel field is ignored |
||
13 | |||
14 | Guest Models Accepted: |
||
15 | none |
||
16 | |||
17 | Description: |
||
18 | This module schedule his tasks following the classic EDF scheme. |
||
19 | The task guarantee is based on the factor utilization approach. |
||
20 | The tasks scheduled are periodic and sporadic. The sporadic tasks |
||
21 | are like hard task with periodicity set to APERIODIC; they are guaranteed |
||
22 | as a periodic task with period equal to the minimum interarrival time. |
||
23 | All the task are put in a queue and the scheduling is based on the |
||
24 | deadline value. |
||
25 | NO GUARANTEE is performed on guest tasks. The guarantee must be performed |
||
26 | by the level that inserts guest tasks in the EDF level. |
||
27 | |||
28 | Exceptions raised: |
||
29 | XUNVALID_GUEST |
||
30 | This level doesn't support guests. When a guest operation |
||
31 | is called, the exception is raised. |
||
32 | |||
33 | These exceptions are pclass-dependent... |
||
34 | XDEADLINE_MISS |
||
35 | If a task miss his deadline, the exception is raised. |
||
36 | |||
37 | XACTIVATION |
||
38 | If a sporadic task is activated with a rate that is greather than the |
||
39 | rate declared in the model, this exception is raised and the task is NOT |
||
40 | activated. |
||
41 | This exception is also raised if we are trying to activate a periodic task |
||
42 | stopped with task_sleep before the deadline in which the task_sleep is |
||
43 | called. |
||
44 | |||
45 | Restrictions & special features: |
||
46 | - This level doesn't manage the main task. |
||
47 | - The level use the priority and timespec_priority fields. |
||
48 | - A function to return the used bandwidth of a level is provided. |
||
49 | |||
50 | **/ |
||
51 | |||
52 | /* |
||
53 | * Copyright (C) 2000 Paolo Gai |
||
54 | * |
||
55 | * This program is free software; you can redistribute it and/or modify |
||
56 | * it under the terms of the GNU General Public License as published by |
||
57 | * the Free Software Foundation; either version 2 of the License, or |
||
58 | * (at your option) any later version. |
||
59 | * |
||
60 | * This program is distributed in the hope that it will be useful, |
||
61 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
62 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
63 | * GNU General Public License for more details. |
||
64 | * |
||
65 | * You should have received a copy of the GNU General Public License |
||
66 | * along with this program; if not, write to the Free Software |
||
67 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
68 | * |
||
69 | */ |
||
70 | |||
71 | |||
72 | #ifndef __EDF_H__ |
||
73 | #define __EDF_H__ |
||
74 | |||
75 | #include "valmodel.h" |
||
76 | #include <ll/ll.h> |
||
77 | #include <kernel/config.h> |
||
78 | #include <sys/types.h> |
||
79 | #include <kernel/types.h> |
||
80 | #include <modules/codes.h> |
||
81 | |||
82 | |||
83 | //pic a code and a version not used into the file include/modules/codes.h |
||
84 | #define DOG_LEVELNAME "GROUP5 Scheduling Module" |
||
85 | #define DOG_LEVEL_CODE 167 |
||
86 | #define DOG_LEVEL_VERSION 1 |
||
87 | |||
88 | |||
89 | /*+ flags... +*/ |
||
90 | #define EDF_ENABLE_WCET_CHECK 1 /*+ Wcet check enabled +*/ |
||
91 | #define EDF_ENABLE_GUARANTEE 2 /*+ Task Guarantee enabled +*/ |
||
92 | #define EDF_ENABLE_ALL 3 /*+ All flags enabled +*/ |
||
93 | |||
94 | #define EDF_FAILED_GUARANTEE 8 /*+ used in the module, unsettable |
||
95 | in EDF_register_level... +*/ |
||
96 | |||
97 | |||
98 | /*+ Registration function: |
||
99 | int flag Options to be used in this level instance... +*/ |
||
100 | void EDF_register_level(); |
||
101 | |||
102 | /* checks if the task is accepted */ |
||
103 | int is_accepted(LEVEL l, PID p); |
||
104 | |||
105 | /*+ Returns the used bandwidth of a level +*/ |
||
106 | bandwidth_t EDF_usedbandwidth(LEVEL l); |
||
107 | |||
108 | #endif |