Subversion Repositories shark

Rev

Rev 1618 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
961 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: rr.h,v 1.1 2005-02-25 10:45:58 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1 $
28
 Last update: $Date: 2005-02-25 10:45:58 $
29
 ------------
30
 
31
 This file contains the scheduling module RR (Round Robin)
32
 
33
 Title:
34
   RR (Round Robin)
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
     activation field is ignored
41
     policy field is ignored
42
     inherit field is ignored
43
 
44
 Description:
45
   This module schedule his tasks following the classic round-robin
46
   scheme. The default timeslice is given at registration time and is a
47
   a per-task specification. The default timeslice is used if the slice
48
   field in the NRT_TASK_MODEL is 0.
49
 
50
   The module always SKIP instances, either if SAVE_ARRIVALS is set!!!
51
   There is another module, RR2, thar remember activations...
52
 
53
 Exceptions raised:
54
   XUNVALID_GUEST
55
     This level doesn't support guests. When a guest operation
56
     is called, the exception is raised.
57
 
58
 Restrictions & special features:
59
   - if specified, it creates at init time a task,
60
     called "Main", attached to the function __init__().
61
   - There must be only one module in the system that creates a task
62
     attached to the function __init__().
63
   - The level tries to guarantee that a task uses a "full" timeslice
64
     before going to the queue tail. "full" means that a task can execute
65
     a maximum time of slice+sys_tick due to the approx. done by
66
     the Virtual Machine. If a task execute more time than the slice,
67
     the next time it execute less...
68
 
69
**/
70
 
71
/*
72
 * Copyright (C) 2000 Paolo Gai
73
 *
74
 * This program is free software; you can redistribute it and/or modify
75
 * it under the terms of the GNU General Public License as published by
76
 * the Free Software Foundation; either version 2 of the License, or
77
 * (at your option) any later version.
78
 *
79
 * This program is distributed in the hope that it will be useful,
80
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
82
 * GNU General Public License for more details.
83
 *
84
 * You should have received a copy of the GNU General Public License
85
 * along with this program; if not, write to the Free Software
86
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
87
 *
88
 */
89
 
90
 
91
#ifndef __RR_H__
92
#define __RR_H__
93
 
94
#include <ll/ll.h>
95
#include <kernel/config.h>
96
#include <sys/types.h>
97
#include <kernel/types.h>
1621 fabio 98
#include <arch/sys/cdefs.h>
961 pj 99
 
100
__BEGIN_DECLS
101
 
102
extern TASK __init__(void *arg);
103
 
104
 
105
 
106
/*+ Const: +*/
107
#define RR_MINIMUM_SLICE      1000 /*+ Minimum Timeslice +*/
108
#define RR_MAXIMUM_SLICE    500000 /*+ Maximum Timeslice +*/
109
 
110
#define RR_MAIN_YES              1 /*+ The level creates the main +*/
111
#define RR_MAIN_NO               0 /*+ The level does'nt create the main +*/
112
 
113
/*+ Registration function:
114
    TIME slice                the slice for the Round Robin queue
115
    int createmain            1 if the level creates the main task 0 otherwise
116
    struct multiboot_info *mb used if createmain specified  
117
 
118
    returns the level number at which the module has been registered.
119
+*/
120
LEVEL RR_register_level(TIME slice,
121
                       int createmain,
122
                       struct multiboot_info *mb);
123
__END_DECLS
124
#endif