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: ps.h,v 1.1 2005-02-25 10:40:58 pj Exp $ |
||
25 | |||
26 | File: $File$ |
||
27 | Revision: $Revision: 1.1 $ |
||
28 | Last update: $Date: 2005-02-25 10:40:58 $ |
||
29 | ------------ |
||
30 | |||
31 | This file contains the aperiodic server PS (Polling Server) |
||
32 | |||
33 | Title: |
||
34 | PS (Polling Server) |
||
35 | |||
36 | Task Models Accepted: |
||
37 | SOFT_TASK_MODEL - Soft Tasks |
||
38 | wcet field is ignored |
||
39 | met field is ignored |
||
40 | period field is ignored |
||
41 | periodicity field can be only APERIODIC |
||
42 | arrivals field can be either SAVE or SKIP |
||
43 | |||
44 | Description: |
||
45 | This module schedule his tasks following the Polling Server scheme. |
||
46 | |||
47 | All the tasks are put in a FIFO (FCFS) queue and at a time only the first |
||
48 | task in the queue is put in the upper level. |
||
49 | |||
50 | The module remembers pending activations when calling task_sleep... |
||
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 | - This level doesn't manage the main task. |
||
59 | - At init time we have to specify: |
||
60 | . The Capacity and the period used by the server |
||
61 | - The level don't use the priority field. |
||
62 | - A function to return the used bandwidth of the level is provided. |
||
63 | - if an aperiodic task calls a task_delay when owning a mutex implemented |
||
64 | with shadows, the delay may have no effect, so don't use delay when |
||
65 | using a mutex!!! |
||
66 | |||
67 | **/ |
||
68 | |||
69 | /* |
||
70 | * Copyright (C) 2000 Paolo Gai |
||
71 | * |
||
72 | * This program is free software; you can redistribute it and/or modify |
||
73 | * it under the terms of the GNU General Public License as published by |
||
74 | * the Free Software Foundation; either version 2 of the License, or |
||
75 | * (at your option) any later version. |
||
76 | * |
||
77 | * This program is distributed in the hope that it will be useful, |
||
78 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
79 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
80 | * GNU General Public License for more details. |
||
81 | * |
||
82 | * You should have received a copy of the GNU General Public License |
||
83 | * along with this program; if not, write to the Free Software |
||
84 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
85 | * |
||
86 | */ |
||
87 | |||
88 | |||
89 | #ifndef __PS_H__ |
||
90 | #define __PS_H__ |
||
91 | |||
92 | #include <ll/ll.h> |
||
93 | #include <kernel/config.h> |
||
94 | #include <sys/types.h> |
||
95 | #include <kernel/types.h> |
||
1621 | fabio | 96 | #include <arch/sys/cdefs.h> |
961 | pj | 97 | |
98 | __BEGIN_DECLS |
||
99 | |||
100 | /*+ 1 - ln(2) +*/ |
||
101 | #ifndef RM_MINFREEBANDWIDTH |
||
102 | #define RM_MINFREEBANDWIDTH 1317922825 |
||
103 | #endif |
||
104 | |||
105 | /*+ flags... +*/ |
||
106 | #define PS_DISABLE_ALL 0 |
||
107 | #define PS_ENABLE_BACKGROUND 1 /*+ Background scheduling enabled +*/ |
||
108 | #define PS_ENABLE_GUARANTEE_EDF 2 /*+ Task Guarantee enabled +*/ |
||
109 | #define PS_ENABLE_ALL_EDF 3 /*+ All flags enabled +*/ |
||
110 | |||
111 | #define PS_ENABLE_GUARANTEE_RM 4 /*+ Task Guarantee enabled +*/ |
||
112 | #define PS_ENABLE_ALL_RM 5 /*+ All flags enabled +*/ |
||
113 | |||
114 | /*+ internal flags +*/ |
||
115 | #define PS_BACKGROUND 8 /*+ this flag is set when scheduling |
||
116 | in background +*/ |
||
117 | #define PS_BACKGROUND_BLOCK 16 /*+ this flag is set when we want to |
||
118 | blocks the background scheduling +*/ |
||
119 | |||
120 | /*+ Registration function: |
||
121 | bandwidth_t b Max bandwidth used by the TBS |
||
122 | int flags Options to be used in this level instance... |
||
123 | LEVEL master the level that must be used as master level for the |
||
124 | TBS tasks |
||
125 | int num,den used to compute the TBS bandwidth |
||
126 | |||
127 | returns the level number at which the module has been registered. |
||
128 | +*/ |
||
129 | LEVEL PS_register_level(int flags, LEVEL master, int Cs, int per); |
||
130 | |||
131 | /*+ Returns the used bandwidth of a level +*/ |
||
132 | bandwidth_t PS_usedbandwidth(LEVEL l); |
||
133 | |||
134 | __END_DECLS |
||
135 | #endif |