Subversion Repositories shark

Rev

Rev 404 | Rev 866 | 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     :
267 giacomo 9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *   Michael Trimarchi   <trimarchi@gandalf.sssup.it>
241 giacomo 11
 *   (see the web pages for full authors list)
12
 *
13
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
14
 *
15
 * http://www.sssup.it
16
 * http://retis.sssup.it
17
 * http://shark.sssup.it
18
 */
19
 
20
/*
21
 * Copyright (C) 2002 Paolo Gai
22
 *
23
 * This program is free software; you can redistribute it and/or modify
24
 * it under the terms of the GNU General Public License as published by
25
 * the Free Software Foundation; either version 2 of the License, or
26
 * (at your option) any later version.
27
 *
28
 * This program is distributed in the hope that it will be useful,
29
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31
 * GNU General Public License for more details.
32
 *
33
 * You should have received a copy of the GNU General Public License
34
 * along with this program; if not, write to the Free Software
35
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
36
 *
37
 */
38
 
39
 
253 giacomo 40
#ifndef __GRUBSTAR_H__
41
#define __GRUBSTAR_H__
241 giacomo 42
 
43
#include <kernel/kern.h>
44
 
45
#define BUDGET_PCLASS 0x0600                            
46
 
47
typedef struct {
48
  TASK_MODEL t;
49
  int b;
50
} BUDGET_TASK_MODEL;
51
 
52
#define budget_task_default_model(m,buf)                          \
53
                        task_default_model((m).t, BUDGET_PCLASS), \
54
                        (m).b    = (buf);
55
 
56
 
57
 
58
/* some constants for registering the Module in the right place */
253 giacomo 59
#define GRUBSTAR_LEVELNAME       "GRUBSTAR"
60
#define GRUBSTAR_LEVEL_CODE       106
61
#define GRUBSTAR_LEVEL_VERSION    1
241 giacomo 62
 
253 giacomo 63
LEVEL GRUBSTAR_register_level(int n, LEVEL master);
241 giacomo 64
 
65
/* Allocates a budget to be used for an application.
66
   Input parameters:
67
     Q The budget
68
     T The period of the budget
69
   Return value:
70
     0..N The ID of the budget
71
     -1   no more free budgets
72
     -2   The budgets allocated locally to this module have bandwidth > 1
73
     -3   wrong LEVEL id
74
*/
661 giacomo 75
int GRUBSTAR_setbudget(LEVEL l, TIME Q, TIME T, TIME D, LEVEL local_scheduler_level, int scheduler_id);
241 giacomo 76
 
253 giacomo 77
int GRUBSTAR_removebudget(LEVEL l, int budget);
241 giacomo 78
 
661 giacomo 79
int GRUBSTAR_adjust_budget(LEVEL l, TIME Q, TIME T, TIME D, int budget);
241 giacomo 80
 
661 giacomo 81
int GRUBSTAR_getbudgetinfo(LEVEL l, TIME *Q, TIME *T, TIME *D, int budget);
241 giacomo 82
 
253 giacomo 83
int GRUBSTAR_was_budget_overran(LEVEL l, int budget);
241 giacomo 84
 
253 giacomo 85
int GRUBSTAR_is_active(LEVEL l, int budget);
241 giacomo 86
 
253 giacomo 87
int GRUBSTAR_get_local_scheduler_level_from_budget(LEVEL l, int budget);
241 giacomo 88
 
253 giacomo 89
int GRUBSTAR_get_local_scheduler_level_from_pid(LEVEL l, PID p);
241 giacomo 90
 
253 giacomo 91
int GRUBSTAR_get_local_scheduler_id_from_budget(LEVEL l, int budget);
241 giacomo 92
 
253 giacomo 93
int GRUBSTAR_get_local_scheduler_id_from_pid(LEVEL l, PID p);
241 giacomo 94
 
276 giacomo 95
int GRUBSTAR_get_last_reclaiming(LEVEL l, PID p);
267 giacomo 96
 
340 giacomo 97
int GRUBSTAR_get_remain_capacity(LEVEL l, int budget);
98
 
404 trimarchi 99
bandwidth_t GRUBSTAR_return_bandwidth(LEVEL l);
100
 
241 giacomo 101
#endif
253 giacomo 102