Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1663 | 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: rrvalue.h,v 1.1 2004-07-05 14:17:15 pj Exp $ |
||
25 | |||
26 | File: $File$ |
||
27 | Revision: $Revision: 1.1 $ |
||
28 | Last update: $Date: 2004-07-05 14:17:15 $ |
||
29 | ------------ |
||
30 | |||
31 | This file contains the scheduling module RRVALUE (Round Robin for |
||
32 | Hard & Soft & Value Model) |
||
33 | |||
34 | Title: |
||
35 | RRVALUE (Round Robin) version 2 |
||
36 | |||
37 | Task Models Accepted: |
||
38 | NRT_TASK_MODEL - Non-Realtime Tasks |
||
39 | weight field is ignored |
||
40 | slice field is used to set the slice of a task, if it is !=0 |
||
41 | policy field is ignored |
||
42 | inherit field is ignored |
||
43 | SOFT_TASK_MODEL - Soft tasks |
||
44 | only the periodicity and the met are used. |
||
45 | HARD_TASK_MODEL - Hard tasks |
||
46 | only the periodicity and the period are used. |
||
47 | VALUE_TASK_MODEL - Value tasks |
||
48 | nothing is used yet |
||
49 | |||
50 | |||
51 | Description: |
||
52 | See the RRSOFT Description. |
||
53 | It also accepts VALUE_TASK Models |
||
54 | |||
55 | Exceptions raised: |
||
56 | XUNVALID_GUEST |
||
57 | This level doesn't support guests. When a guest operation |
||
58 | is called, the exception is raised. |
||
59 | |||
60 | Restrictions & special features: |
||
61 | - if specified, it creates at init time a task, |
||
62 | called "Main", attached to the function __init__(). |
||
63 | - There must be only one module in the system that creates a task |
||
64 | attached to the function __init__(). |
||
65 | - The level tries to guarantee that a task uses a "full" timeslice |
||
66 | before going to the queue tail. "full" means that a task can execute |
||
67 | a maximum time of slice+sys_tick due to the approx. done by |
||
68 | the Virtual Machine. If a task execute more time than the slice, |
||
69 | the next time it execute less... |
||
70 | |||
71 | **/ |
||
72 | |||
73 | /* |
||
74 | * Copyright (C) 2001 Paolo Gai |
||
75 | * |
||
76 | * This program is free software; you can redistribute it and/or modify |
||
77 | * it under the terms of the GNU General Public License as published by |
||
78 | * the Free Software Foundation; either version 2 of the License, or |
||
79 | * (at your option) any later version. |
||
80 | * |
||
81 | * This program is distributed in the hope that it will be useful, |
||
82 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
83 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
84 | * GNU General Public License for more details. |
||
85 | * |
||
86 | * You should have received a copy of the GNU General Public License |
||
87 | * along with this program; if not, write to the Free Software |
||
88 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
89 | * |
||
90 | */ |
||
91 | |||
92 | |||
93 | #ifndef __RRVALUE_H__ |
||
94 | #define __RRVALUE_H__ |
||
95 | |||
96 | #include <ll/ll.h> |
||
97 | #include <kernel/config.h> |
||
98 | #include <sys/types.h> |
||
99 | #include <kernel/types.h> |
||
100 | #include <modules/codes.h> |
||
101 | |||
102 | extern TASK __init__(void *arg); |
||
103 | |||
104 | |||
105 | |||
106 | /*+ Const: +*/ |
||
107 | #define RRVALUE_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/ |
||
108 | #define RRVALUE_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/ |
||
109 | |||
110 | #define RRVALUE_MAIN_YES 1 /*+ The level creates the main +*/ |
||
111 | #define RRVALUE_MAIN_NO 0 /*+ The level does'nt create the main +*/ |
||
112 | |||
113 | #define RRVALUE_ONLY_HARD 1 /*+ The level accepts only Hard Tasks +*/ |
||
114 | #define RRVALUE_ONLY_SOFT 2 /*+ The level accepts only Soft Tasks +*/ |
||
115 | #define RRVALUE_ONLY_NRT 4 /*+ The level accepts only NRT Tasks +*/ |
||
116 | #define RRVALUE_ONLY_VALUE 8 /*+ The level accepts only Value Tasks+*/ |
||
117 | |||
118 | |||
119 | /*+ Registration function: |
||
120 | TIME slice the slice for the Round Robin queue |
||
121 | int createmain 1 if the level creates the main task 0 otherwise |
||
122 | struct multiboot_info *mb used if createmain specified +*/ |
||
123 | void RRVALUE_register_level(TIME slice, |
||
124 | int createmain, |
||
125 | struct multiboot_info *mb, |
||
126 | BYTE models); |
||
127 | |||
128 | #endif |