Rev 241 | Rev 267 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
241 | giacomo | 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 | * Copyright (C) 2002 Paolo Gai |
||
23 | * |
||
24 | * This program is free software; you can redistribute it and/or modify |
||
25 | * it under the terms of the GNU General Public License as published by |
||
26 | * the Free Software Foundation; either version 2 of the License, or |
||
27 | * (at your option) any later version. |
||
28 | * |
||
29 | * This program is distributed in the hope that it will be useful, |
||
30 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
31 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
32 | * GNU General Public License for more details. |
||
33 | * |
||
34 | * You should have received a copy of the GNU General Public License |
||
35 | * along with this program; if not, write to the Free Software |
||
36 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
37 | * |
||
38 | */ |
||
39 | |||
40 | |||
253 | giacomo | 41 | #ifndef __GRUBSTAR_H__ |
42 | #define __GRUBSTAR_H__ |
||
241 | giacomo | 43 | |
44 | #include <kernel/kern.h> |
||
45 | |||
46 | #define BUDGET_PCLASS 0x0600 |
||
47 | |||
48 | typedef struct { |
||
49 | TASK_MODEL t; |
||
50 | int b; |
||
51 | } BUDGET_TASK_MODEL; |
||
52 | |||
53 | #define budget_task_default_model(m,buf) \ |
||
54 | task_default_model((m).t, BUDGET_PCLASS), \ |
||
55 | (m).b = (buf); |
||
56 | |||
57 | |||
58 | |||
59 | /* some constants for registering the Module in the right place */ |
||
253 | giacomo | 60 | #define GRUBSTAR_LEVELNAME "GRUBSTAR" |
61 | #define GRUBSTAR_LEVEL_CODE 106 |
||
62 | #define GRUBSTAR_LEVEL_VERSION 1 |
||
241 | giacomo | 63 | |
253 | giacomo | 64 | LEVEL GRUBSTAR_register_level(int n, LEVEL master); |
241 | giacomo | 65 | |
66 | /* Allocates a budget to be used for an application. |
||
67 | Input parameters: |
||
68 | Q The budget |
||
69 | T The period of the budget |
||
70 | Return value: |
||
71 | 0..N The ID of the budget |
||
72 | -1 no more free budgets |
||
73 | -2 The budgets allocated locally to this module have bandwidth > 1 |
||
74 | -3 wrong LEVEL id |
||
75 | */ |
||
253 | giacomo | 76 | int GRUBSTAR_setbudget(LEVEL l, TIME Q, TIME T, LEVEL local_scheduler_level, int scheduler_id); |
241 | giacomo | 77 | |
253 | giacomo | 78 | int GRUBSTAR_removebudget(LEVEL l, int budget); |
241 | giacomo | 79 | |
253 | giacomo | 80 | int GRUBSTAR_adjust_budget(LEVEL l, TIME Q, TIME T, int budget); |
241 | giacomo | 81 | |
253 | giacomo | 82 | int GRUBSTAR_getbudgetinfo(LEVEL l, TIME *Q, TIME *T, int budget); |
241 | giacomo | 83 | |
253 | giacomo | 84 | int GRUBSTAR_was_budget_overran(LEVEL l, int budget); |
241 | giacomo | 85 | |
253 | giacomo | 86 | int GRUBSTAR_is_active(LEVEL l, int budget); |
241 | giacomo | 87 | |
253 | giacomo | 88 | int GRUBSTAR_get_local_scheduler_level_from_budget(LEVEL l, int budget); |
241 | giacomo | 89 | |
253 | giacomo | 90 | int GRUBSTAR_get_local_scheduler_level_from_pid(LEVEL l, PID p); |
241 | giacomo | 91 | |
253 | giacomo | 92 | int GRUBSTAR_get_local_scheduler_id_from_budget(LEVEL l, int budget); |
241 | giacomo | 93 | |
253 | giacomo | 94 | int GRUBSTAR_get_local_scheduler_id_from_pid(LEVEL l, PID p); |
241 | giacomo | 95 | |
96 | #endif |
||
253 | giacomo | 97 |