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: rr2.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 RR (Round Robin)
32
 
33
 Title:
34
   RR (Round Robin) version 2
35
 
36
 Task Models Accepted:
37
   NRT_TASK_MODEL - Non-Realtime Tasks
38
     weight field is ignored
39
     slice  field is used to set the slice of a task, if it is !=0
40
     policy field is ignored
41
     inherit field is ignored
42
 
43
 Description:
44
   This module schedule his tasks following the classic round-robin
45
   scheme. The default timeslice is given at registration time and is a
46
   a per-task specification. The default timeslice is used if the slice
47
   field in the NRT_TASK_MODEL is 0.
48
 
49
   The module can SAVE or SKIP activations
50
   There is another module, RR, thar always SKIP activations...
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
   - if specified, it creates at init time a task,
59
     called "Main", attached to the function __init__().
60
   - There must be only one module in the system that creates a task
61
     attached to the function __init__().
62
   - The level tries to guarantee that a task uses a "full" timeslice
63
     before going to the queue tail. "full" means that a task can execute
64
     a maximum time of slice+sys_tick due to the approx. done by
65
     the Virtual Machine. If a task execute more time than the slice,
66
     the next time it execute less...
67
 
68
**/
69
 
70
/*
71
 * Copyright (C) 2000 Paolo Gai
72
 *
73
 * This program is free software; you can redistribute it and/or modify
74
 * it under the terms of the GNU General Public License as published by
75
 * the Free Software Foundation; either version 2 of the License, or
76
 * (at your option) any later version.
77
 *
78
 * This program is distributed in the hope that it will be useful,
79
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
80
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81
 * GNU General Public License for more details.
82
 *
83
 * You should have received a copy of the GNU General Public License
84
 * along with this program; if not, write to the Free Software
85
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
86
 *
87
 */
88
 
89
 
90
#ifndef __RR2_H__
91
#define __RR2_H__
92
 
93
#include <ll/ll.h>
94
#include <kernel/config.h>
95
#include <sys/types.h>
96
#include <kernel/types.h>
97
 
98
extern TASK __init__(void *arg);
99
 
100
 
101
 
102
/*+ Const: +*/
103
#define RR2_MINIMUM_SLICE      1000 /*+ Minimum Timeslice +*/
104
#define RR2_MAXIMUM_SLICE    500000 /*+ Maximum Timeslice +*/
105
 
106
#define RR2_MAIN_YES              1 /*+ The level creates the main +*/
107
#define RR2_MAIN_NO               0 /*+ The level does'nt create the main +*/
108
 
109
/*+ Registration function:
110
    TIME slice                the slice for the Round Robin queue
111
    int createmain            1 if the level creates the main task 0 otherwise
38 pj 112
    struct multiboot_info *b used if createmain specified  
113
 
114
    returns the level number at which the module has been registered.
115
+*/
116
LEVEL RR2_register_level(TIME slice,
2 pj 117
                        int createmain,
118
                        struct multiboot_info *mb);
119
 
120
#endif