Rev 38 | Go to most recent revision | 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 | ------------ |
||
80 | pj | 24 | CVS : $Id: rrsoft.h,v 1.3 2003-03-13 13:39:05 pj Exp $ |
2 | pj | 25 | |
26 | File: $File$ |
||
80 | pj | 27 | Revision: $Revision: 1.3 $ |
28 | Last update: $Date: 2003-03-13 13:39:05 $ |
||
2 | pj | 29 | ------------ |
30 | |||
31 | This file contains the scheduling module RRSOFT (Round Robin for |
||
32 | Hard & Soft Model) |
||
33 | |||
34 | Title: |
||
35 | RRSOFT (Round Robin) version 1 |
||
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 | |||
48 | |||
49 | Description: |
||
50 | This module schedule his tasks following the classic round-robin |
||
51 | scheme. The default timeslice is given at registration time and is a |
||
52 | a per-task specification. The default timeslice is used if the slice |
||
53 | field in the NRT_TASK_MODEL is 0. |
||
54 | |||
55 | The module can SAVE or SKIP activations |
||
56 | There is another module, RR, thar always SKIP activations... |
||
57 | |||
58 | The Module is derived from the RRSOFT, and it accepts only one |
||
59 | kind of task Model (hard, soft or nrt). |
||
60 | |||
61 | Exceptions raised: |
||
62 | XUNVALID_GUEST |
||
63 | This level doesn't support guests. When a guest operation |
||
64 | is called, the exception is raised. |
||
65 | |||
66 | Restrictions & special features: |
||
67 | - if specified, it creates at init time a task, |
||
68 | called "Main", attached to the function __init__(). |
||
69 | - There must be only one module in the system that creates a task |
||
70 | attached to the function __init__(). |
||
71 | - The level tries to guarantee that a task uses a "full" timeslice |
||
72 | before going to the queue tail. "full" means that a task can execute |
||
73 | a maximum time of slice+sys_tick due to the approx. done by |
||
74 | the Virtual Machine. If a task execute more time than the slice, |
||
75 | the next time it execute less... |
||
76 | |||
77 | **/ |
||
78 | |||
79 | /* |
||
80 | * Copyright (C) 2000 Paolo Gai |
||
81 | * |
||
82 | * This program is free software; you can redistribute it and/or modify |
||
83 | * it under the terms of the GNU General Public License as published by |
||
84 | * the Free Software Foundation; either version 2 of the License, or |
||
85 | * (at your option) any later version. |
||
86 | * |
||
87 | * This program is distributed in the hope that it will be useful, |
||
88 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
89 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
90 | * GNU General Public License for more details. |
||
91 | * |
||
92 | * You should have received a copy of the GNU General Public License |
||
93 | * along with this program; if not, write to the Free Software |
||
94 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
95 | * |
||
96 | */ |
||
97 | |||
98 | |||
99 | #ifndef __RRSOFT_H__ |
||
100 | #define __RRSOFT_H__ |
||
101 | |||
102 | #include <ll/ll.h> |
||
103 | #include <kernel/config.h> |
||
104 | #include <sys/types.h> |
||
105 | #include <kernel/types.h> |
||
80 | pj | 106 | #include "ll/sys/cdefs.h" |
2 | pj | 107 | |
80 | pj | 108 | __BEGIN_DECLS |
109 | |||
2 | pj | 110 | extern TASK __init__(void *arg); |
111 | |||
112 | |||
113 | |||
114 | /*+ Const: +*/ |
||
115 | #define RRSOFT_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/ |
||
116 | #define RRSOFT_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/ |
||
117 | |||
118 | #define RRSOFT_MAIN_YES 1 /*+ The level creates the main +*/ |
||
119 | #define RRSOFT_MAIN_NO 0 /*+ The level does'nt create the main +*/ |
||
120 | |||
121 | #define RRSOFT_ONLY_HARD 1 /*+ The level accepts only Hard Tasks +*/ |
||
122 | #define RRSOFT_ONLY_SOFT 2 /*+ The level accepts only Soft Tasks +*/ |
||
123 | #define RRSOFT_ONLY_NRT 4 /*+ The level accepts only NRT Tasks +*/ |
||
124 | |||
125 | |||
126 | /*+ Registration function: |
||
127 | TIME slice the slice for the Round Robin queue |
||
128 | int createmain 1 if the level creates the main task 0 otherwise |
||
38 | pj | 129 | struct multiboot_info *mb used if createmain specified |
130 | |||
131 | returns the level number at which the module has been registered. |
||
132 | +*/ |
||
133 | |||
134 | LEVEL RRSOFT_register_level(TIME slice, |
||
2 | pj | 135 | int createmain, |
136 | struct multiboot_info *mb, |
||
137 | BYTE models); |
||
138 | |||
80 | pj | 139 | __END_DECLS |
2 | pj | 140 | #endif |