Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 966 → Rev 965

/shark/trunk/include/modules/intdrive.h
0,0 → 1,61
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* (see the web pages for full authors list)
* Giacomo Guidi <giacomo@gandalf.sssup.it>
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __INTDRIVE_H__
#define __INTDRIVE_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
#define INTDRIVE_CHECK_WCET 1
 
LEVEL INTDRIVE_register_level(TIME capacity, TIME replenish_period, int flag);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t INTDRIVE_usedbandwidth(LEVEL l);
 
/*+ Set the Q-theta value for the server - Return the accepted value +*/
TIME INTDRIVE_set_q_theta(LEVEL l, TIME new_q_theta);
 
__END_DECLS
#endif
/shark/trunk/include/modules/edf.h
0,0 → 1,184
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* Anton Cervin
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: edf.h,v 1.6 2004-06-21 11:40:06 anton Exp $
 
File: $File$
Revision: $Revision: 1.6 $
Last update: $Date: 2004-06-21 11:40:06 $
------------
 
This file contains the scheduling module EDF (Earliest Deadline First)
 
Title:
EDF (Earliest Deadline First)
 
Task Models Accepted:
HARD_TASK_MODEL - Hard Tasks (Periodic and Sporadic)
wcet field and mit field must be != 0. They are used to set the wcet
and period of the tasks.
periodicity field can be either PERIODIC or APERIODIC
drel field must be <= mit. NOTE 1: a drel of 0 is interpreted as mit.
NOTE 2: The utilization of the task is computed as wcet/drel.
offset field specifies a release offset relative to task_activate or
group_activate.
 
Guest Models Accepted:
JOB_TASK_MODEL - a single guest task activation
Identified by an absolute deadline and a period.
period field is ignored
 
Description:
This module schedules periodic and sporadic tasks based on their
absolute deadlines. The task guarantee is based on a simple
utilization approach. The utilization factor of a task is computed
as wcet/drel. (By default, drel = mit.) A periodic task must only
be activated once; subsequent activations are triggered by an
internal timer. By contrast, an sporadic task must be explicitely
activated for each instance. NO GUARANTEE is performed on guest
tasks. The guarantee must be performed by the level that inserts
guest tasks in the EDF level.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests of this type. When a guest
operation is called, the exception is raised.
 
The following exceptions may be raised by the module:
XDEADLINE_MISS
If a task misses its deadline and the EDF_ENABLE_DL_EXCEPTION
flag is set, this exception is raised.
 
XWCET_VIOLATION
If a task executes longer than its declared wcet and the
EDF_ENABLE_WCET_EXCEPTION flag is set, this exception is raised.
 
XACTIVATION
If a sporadic task is activated more often than its declared mit
and the EDF_ENABLE_ACT_EXCEPTION flag is set, this exception is
raised. This exception is also raised if a periodic task is
activated while not in the SLEEP state.
 
Restrictions & special features:
 
- Relative deadlines drel <= mit may be specified.
- An offset > 0 will delay the activation of the task by the same
amount of time. To synchronize a group of tasks, assign suitable
offsets and then use the group_activate function.
- This level doesn't manage the main task.
- The level uses the priority and timespec_priority fields.
- The guest tasks don't provide the guest_endcycle function.
- At init time, the user can specify the behavior in case of
deadline and wcet overruns. The following flags are available:
 
(No flags enabled) - Deadline and wcet overruns are ignored.
Pending periodic jobs are queued and are
eventually scheduled with correct deadlines
according to their original arrival times.
Sporadic tasks that arrive to often are
simply dropped.
EDF_ENABLE_DL_CHECK - When a deadline overrun occurs, the
dl_miss counter of the task is increased.
Same behavior for pending jobs as above.
EDF_ENABLE_WCET_CHECK - When a wcet overrun occurs, the
wcet_miss counter of the task is increased.
Same behavior for pending jobs as above.
EDF_ENABLE_DL_EXCEPTION - When a deadline overrun occurs, an
exception is raised.
EDF_ENABLE_WCET_EXCEPTION - When a wcet overrun occurs, an
exception is raised.
EDF_ENABLE_ACT_EXCEPTION When a periodic or sporadic task is activated
too often, an exception is raised.
 
- The functions EDF_get_dl_miss, EDF_get_wcet_miss, EDF_get_act_miss,
and EDF_get_nact can be used to find out the number of missed
deadlines, the number of wcet overruns, the number of skipped
activations, and the number of currently queued periodic activations.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __EDF_H__
#define __EDF_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/* Level flags */
#define EDF_DISABLE_ALL 0
#define EDF_ENABLE_GUARANTEE 1 /* Task guarantee enabled */
#define EDF_ENABLE_WCET_CHECK 2 /* Wcet monitoring enabled */
#define EDF_ENABLE_DL_CHECK 4 /* Deadline monitoring enabled */
#define EDF_ENABLE_WCET_EXCEPTION 8 /* Wcet overrun exception enabled */
#define EDF_ENABLE_DL_EXCEPTION 16 /* Deadline overrun exception enabled */
#define EDF_ENABLE_ACT_EXCEPTION 32 /* Activation exception enabled */
#define EDF_ENABLE_ALL 63 /* All flags enabled */
 
/* Registration function */
LEVEL EDF_register_level(int flags);
 
 
/**** Public utility functions ****/
 
/* Get the bandwidth used by the level */
bandwidth_t EDF_usedbandwidth(LEVEL l);
 
/* Get the number of missed deadlines for a task */
int EDF_get_dl_miss(PID p);
 
/* Get the number of execution overruns for a task */
int EDF_get_wcet_miss(PID p);
 
/* Get the number of skipped activations for a task */
int EDF_get_act_miss(PID p);
 
/* Get the current number of queued activations for a task */
int EDF_get_nact(PID p);
 
 
__END_DECLS
#endif
/shark/trunk/include/modules/rm.h
0,0 → 1,184
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* Anton Cervin
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: rm.h,v 1.6 2004-06-21 11:40:06 anton Exp $
 
File: $File$
Revision: $Revision: 1.6 $
Last update: $Date: 2004-06-21 11:40:06 $
------------
 
This file contains the scheduling module RM (rate-/deadline-monotonic)
 
Title:
RM (rate-/deadline-monotonic)
 
Task Models Accepted:
HARD_TASK_MODEL - Hard Tasks (Periodic and Sporadic)
wcet field and mit field must be != 0. They are used to set the wcet
and period of the tasks.
periodicity field can be either PERIODIC or APERIODIC
drel field must be <= mit. NOTE 1: a drel of 0 is interpreted as mit.
NOTE 2: The utilization of the task is computed as wcet/drel.
offset field specifies a release offset relative to task_activate or
group_activate.
 
Guest Models Accepted:
JOB_TASK_MODEL - a single guest task activation
Identified by an absolute deadline and a period.
period field is ignored
 
Description:
This module schedules periodic and sporadic tasks based on their
relative deadlines. The task guarantee is based on a simple
utilization approach. The utilization factor of a task is computed
as wcet/drel. (By default, drel = mit.) A periodic task must only
be activated once; subsequent activations are triggered by an
internal timer. By contrast, an sporadic task must be explicitely
activated for each instance. NO GUARANTEE is performed on guest
tasks. The guarantee must be performed by the level that inserts
guest tasks in the RM level.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests of this type. When a guest
operation is called, the exception is raised.
 
The following exceptions may be raised by the module:
XDEADLINE_MISS
If a task misses its deadline and the RM_ENABLE_DL_EXCEPTION
flag is set, this exception is raised.
 
XWCET_VIOLATION
If a task executes longer than its declared wcet and the
RM_ENABLE_WCET_EXCEPTION flag is set, this exception is raised.
 
XACTIVATION
If a sporadic task is activated more often than its declared mit
and the RM_ENABLE_ACT_EXCEPTION flag is set, this exception is
raised. This exception is also raised if a periodic task is
activated while not in the SLEEP state.
 
Restrictions & special features:
 
- Relative deadlines drel <= mit may be specified.
- An offset > 0 will delay the activation of the task by the same
amount of time. To synchronize a group of tasks, assign suitable
offsets and then use the group_activate function.
- This level doesn't manage the main task.
- The level uses the priority and timespec_priority fields.
- The guest tasks don't provide the guest_endcycle function.
- At init time, the user can specify the behavior in case of
deadline and wcet overruns. The following flags are available:
 
(No flags enabled) - Deadline and wcet overruns are ignored.
Pending periodic jobs are queued and are
eventually scheduled with correct deadlines
according to their original arrival times.
Sporadic tasks that arrive to often are
simply dropped.
RM_ENABLE_DL_CHECK - When a deadline overrun occurs, the
dl_miss counter of the task is increased.
Same behavior for pending jobs as above.
RM_ENABLE_WCET_CHECK - When a wcet overrun occurs, the
wcet_miss counter of the task is increased.
Same behavior for pending jobs as above.
RM_ENABLE_DL_EXCEPTION - When a deadline overrun occurs, an
exception is raised.
RM_ENABLE_WCET_EXCEPTION - When a wcet overrun occurs, an
exception is raised.
RM_ENABLE_ACT_EXCEPTION When a periodic or sporadic task is activated
too often, an exception is raised.
 
- The functions RM_get_dl_miss, RM_get_wcet_miss, RM_get_act_miss,
and RM_get_nact can be used to find out the number of missed
deadlines, the number of wcet overruns, the number of skipped
activations, and the number of currently queued periodic activations.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __RM_H__
#define __RM_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/* Level flags */
#define RM_DISABLE_ALL 0
#define RM_ENABLE_GUARANTEE 1 /* Task guarantee enabled */
#define RM_ENABLE_WCET_CHECK 2 /* Wcet monitoring enabled */
#define RM_ENABLE_DL_CHECK 4 /* Deadline monitoring enabled */
#define RM_ENABLE_WCET_EXCEPTION 8 /* Wcet overrun exception enabled */
#define RM_ENABLE_DL_EXCEPTION 16 /* Deadline overrun exception enabled */
#define RM_ENABLE_ACT_EXCEPTION 32 /* Activation exception enabled */
#define RM_ENABLE_ALL 63 /* All flags enabled */
 
/* Registration function */
LEVEL RM_register_level(int flags);
 
 
/**** Public utility functions ****/
 
/* Get the bandwidth used by the level */
bandwidth_t RM_usedbandwidth(LEVEL l);
 
/* Get the number of missed deadlines for a task */
int RM_get_dl_miss(PID p);
 
/* Get the number of execution overruns for a task */
int RM_get_wcet_miss(PID p);
 
/* Get the number of skipped activations for a task */
int RM_get_act_miss(PID p);
 
/* Get the current number of queued activations for a task */
int RM_get_nact(PID p);
 
 
__END_DECLS
#endif
/shark/trunk/include/modules/elastic.h
0,0 → 1,78
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __ELASTIC_H__
#define __ELASTIC_H__
 
#include <kernel/config.h>
#include <kernel/types.h>
 
__BEGIN_DECLS
 
/*+ flags... +*/
#define ELASTIC_DISABLE_ALL 0 /*+ Task Guarantee enabled +*/
#define ELASTIC_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
#define ELASTIC_ENABLE_ALL 1
 
/* C Scaling factor define */
#define SCALING_UNIT 10000
 
LEVEL ELASTIC_register_level(int flags, LEVEL master, ext_bandwidth_t U);
 
int ELASTIC_set_period(PID p, TIME period);
int ELASTIC_get_period(PID p);
 
int ELASTIC_set_Tmin(PID p, TIME Tmin);
int ELASTIC_get_Tmin(PID p);
 
int ELASTIC_set_Tmax(PID p, TIME Tmax);
int ELASTIC_get_Tmax(PID p);
 
int ELASTIC_set_C(PID p, TIME C);
int ELASTIC_get_C(PID p);
 
int ELASTIC_set_E(PID p, int E);
int ELASTIC_get_E(PID p);
 
int ELASTIC_set_beta(PID p, int beta);
int ELASTIC_get_beta(PID p);
 
int ELASTIC_set_bandwidth(LEVEL lev, ext_bandwidth_t);
ext_bandwidth_t ELASTIC_get_bandwidth(LEVEL lev);
 
int ELASTIC_set_scaling_factor(LEVEL level, int scaling_factor);
int ELASTIC_get_scaling_factor(LEVEL level);
 
__END_DECLS
#endif
/shark/trunk/include/modules/cabs.h
0,0 → 1,93
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: cabs.h,v 1.4 2003-09-04 13:36:22 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-09-04 13:36:22 $
------------
 
This file contains the Hartik 3.3.1 CAB functions
 
 
Author: Gerardo Lamastra
Giuseppe Lipari
Date: 9/5/96
 
File: Cabs.H
Revision: 1.1
Date: 14/3/97
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
/* $HEADER+ */
 
#ifndef __CAB_H__
#define __CAB_H__
 
#include <ll/sys/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
#define MAX_CAB_NAME 10 /*+ Max. n. of chars for a CAB +*/
 
#define MAX_CAB 50U /*+ Maximum number of CABs +*/
 
 
typedef int CAB;
 
/*+ This function must be inserted in the __hartik_register_levels__ +*/
void CABS_register_module(void);
 
/* User level CAB primitives */
CAB cab_create(char *name, int dim_mes, BYTE num_mes);
char *cab_reserve(CAB id);
int cab_putmes(CAB id, void *pbuf);
char *cab_getmes(CAB id);
int cab_unget(CAB id, void *pun_mes);
void cab_delete(CAB id);
 
__END_DECLS
#endif /* __CAB_H__ */
 
/shark/trunk/include/modules/hardcbs.h
0,0 → 1,137
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* Giacomo Guidi <giacomo@gandalf.sssup.it>
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
/*
This file contains the aperiodic server CBS (Total Bandwidth Server)
with hard reservation and met/period update
 
Title:
CBS (Constant Bandwidth Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Soft Tasks
wcet field is ignored
met field must be != 0
period field must be != 0
periodicity field can be either PERIODIC or APERIODIC
arrivals field can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the CBS scheme.
(see Luca Abeni and Giorgio Buttazzo,
"Integrating Multimedia Applications in Hard Real-Time Systems"
Proceedings of the IEEE Real-Time Systems Symposium, Madrid, Spain,
December 1998)
 
The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
and the CBS level expects that the task is scheduled with the absolute
deadline passed in the model.
 
The task guarantee is based on the factor utilization approach.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
These exceptions are pclass-dependent...
XDEADLINE_MISS
If a task miss his deadline, the exception is raised.
Normally, a CBS task can't cause the raise of such exception because
if it really use more time than declared the deadline is postponed.
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. guarantee check
(when all task are created the system will check that the task_set
will not use more than the available bandwidth)
- A function to return the used bandwidth of the level is provided.
- A function to return the pending activations of the task.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __HCBS_H__
#define __HCBS_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ flags... +*/
#define HCBS_DISABLE_ALL 0 /*+ Task Guarantee enabled +*/
#define HCBS_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
#define HCBS_ENABLE_ALL 1
 
#define HCBS_SET_PERIOD 0
#define HCBS_GET_PERIOD 1
#define HCBS_SET_MET 2
#define HCBS_GET_MET 3
 
typedef struct {
int command;
TIME param;
 
} HCBS_command_message;
 
/*+ Registration function:
int flags Options to be used in this level instance...
LEVEL master the level that must be used as master level for the
CBS tasks
 
returns the level number at which the module has been registered.
+*/
LEVEL HCBS_register_level(int flags, LEVEL master);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t HCBS_usedbandwidth(LEVEL l);
 
/*+ Returns the number of pending activations of a task.
No control is done if the task is not a CBS task! +*/
int HCBS_get_nact(LEVEL l, PID p);
 
__END_DECLS
#endif
/shark/trunk/include/modules/cbs.h
0,0 → 1,132
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: cbs.h,v 1.4 2003-05-05 07:31:12 pj Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-05-05 07:31:12 $
------------
 
This file contains the aperiodic server CBS (Total Bandwidth Server)
 
Title:
CBS (Constant Bandwidth Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Soft Tasks
wcet field is ignored
met field must be != 0
period field must be != 0
periodicity field can be either PERIODIC or APERIODIC
arrivals field can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the CBS scheme.
(see Luca Abeni and Giorgio Buttazzo,
"Integrating Multimedia Applications in Hard Real-Time Systems"
Proceedings of the IEEE Real-Time Systems Symposium, Madrid, Spain,
December 1998)
 
The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
and the CBS level expects that the task is scheduled with the absolute
deadline passed in the model.
 
The task guarantee is based on the factor utilization approach.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
These exceptions are pclass-dependent...
XDEADLINE_MISS
If a task miss his deadline, the exception is raised.
Normally, a CBS task can't cause the raise of such exception because
if it really use more time than declared the deadline is postponed.
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. guarantee check
(when all task are created the system will check that the task_set
will not use more than the available bandwidth)
- A function to return the used bandwidth of the level is provided.
- A function to return the pending activations of the task.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __CBS_H__
#define __CBS_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ flags... +*/
#define CBS_DISABLE_ALL 0 /*+ Task Guarantee enabled +*/
#define CBS_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
#define CBS_ENABLE_ALL 1
 
/*+ Registration function:
int flags Options to be used in this level instance...
LEVEL master the level that must be used as master level for the
CBS tasks
 
returns the level number at which the module has been registered.
+*/
LEVEL CBS_register_level(int flags, LEVEL master);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t CBS_usedbandwidth(LEVEL l);
 
/*+ Returns the number of pending activations of a task.
No control is done if the task is not a CBS task! +*/
int CBS_get_nact(LEVEL l, PID p);
 
__END_DECLS
#endif
/shark/trunk/include/modules/dummy.h
0,0 → 1,101
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: dummy.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the scheduling module RR (Round Robin)
 
Title:
DUMMY
 
Task Models Accepted:
DUMMY_TASK_MODEL - Dummy process (not usable)
 
Description:
This module creates the dummy task, witch is a special task that
do nothing.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
XUNVALID_DUMMY_OP
The dummy task can't be created, or activated, and so on...
 
Restrictions & special features:
- the task model DUMMY_TASK_MODEL can be used only at init time
to register the dummy process into the system.
- if __HLT_WORKS__ defined in this header file, the dummy task can
perform a hlt istruction to save power...
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __DUMMY_H__
#define __DUMMY_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+
On upper Intel CPUs it is possible to avoid CPU power consumption
when the system is idle issuing the hlt instruction.
This is often available on many 32 bit CPUs...
If it is, simply define the following!!!
+*/
#define __HLT_WORKS__
 
/*+ Registration function
 
returns the level number at which the module has been registered.
+*/
LEVEL dummy_register_level();
 
__END_DECLS
#endif
/shark/trunk/include/modules/nop.h
0,0 → 1,90
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: nop.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the No Protocol (NOP) implementation of mutexes
 
Title:
NOP (Binary Semaphores)
 
Resource Models Accepted:
None
 
Description:
This module implement a mutex interface using extraction and insertion
into scheduling queues.
 
Exceptions raised:
none
 
Restrictions & special features:
- This module is NOT Posix compliant
- This module can manage any number of NOP mutexes.
- A NOP mutex can be statically allocated. To do this, the init function
have to define a macro that puts this information in the mutex
descriptor: mutexlevel = <NOP resource level>; opt = NULL;
for example, if the NOP module is registered at level 1, the macro is
like:
#define MUTEX_INITIALIZER {1,(void *)NULL}
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __NOP_H__
#define __NOP_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL NOP_register_module(void);
 
__END_DECLS
#endif
/shark/trunk/include/modules/npp.h
0,0 → 1,98
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: npp.h,v 1.2 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the Non Preemptive Protocol (NPP)
 
Title:
NPP (Non Preemptive Protocol)
 
Resource Models Accepted:
None
 
Description:
This module implement the Non Preemptive Protocol.
When a task aquire a critical section, it become non-preemptable.
 
A NPP mutex is created passing the NPP_mutexattr structure to mutex_init.
 
Exceptions raised:
XMUTEX_OWNER_KILLED
This exception is raised when a task ends and it owns one or more
mutexes
 
Restrictions & special features:
- This module is NOT Posix compliant
- This module can manage any number of NPP mutexes.
- if a task uses a NPP mutex, it can use only this type of mutex.
- If a task ends (because it reaches the end of the body or because it
is killed by someone) and it owns some mutex, an exception is raised.
- if a mutex unlock is called on a mutex not previously
locked or previously locked by another task an error is returned
- A NPP mutex can be statically allocated. To do this, the init function
have to define a macro that puts this information in the mutex
descriptor: mutexlevel = <NPP resource level>; opt = NULL;
for example, if the NPP module is registered at level 1, the macro is
like:
#define MUTEX_INITIALIZER {1,(void *)NULL}
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __NPP_H__
#define __NPP_H__
 
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
void NPP_register_module(void);
 
__END_DECLS
#endif
/shark/trunk/include/modules/posix.h
0,0 → 1,154
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: posix.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the scheduling module compatible with POSIX
specifications
 
Title:
POSIX version 1
 
Task Models Accepted:
NRT_TASK_MODEL - Non-Realtime Tasks
weight field is ignored
slice field is used to set the slice of a task, if it is !=0
policy field is ignored
inherit field is ignored
 
Description:
This module schedule his tasks following the POSIX specifications...
 
A task can be scheduled in a Round Robin way or in a FIFO way.
The tasks have also a priority field.
 
The slices can be different one task from one another.
 
The module can SAVE or SKIP activations
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- if specified, it creates at init time a task,
called "Main", attached to the function __init__().
- There must be only one module in the system that creates a task
attached to the function __init__().
- The level tries to guarantee that a RR task uses a "full" timeslice
before going to the queue tail. "full" means that a task can execute
a maximum time of slice+sys_tick due to the approx. done by
the Virtual Machine. If a task execute more time than the slice,
the next time it execute less...
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __POSIX_H__
#define __POSIX_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
extern TASK __init__(void *arg);
 
 
 
/*+ Const: +*/
#define POSIX_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/
#define POSIX_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/
 
#define POSIX_MAIN_YES 1 /*+ The level creates the main +*/
#define POSIX_MAIN_NO 0 /*+ The level does'nt create the main +*/
 
/*+ Registration function:
TIME slice the slice for the Round Robin queue
int createmain 1 if the level creates the main task 0 otherwise
struct multiboot_info *mb used if createmain specified
 
returns the level number at which the module has been registered.
+*/
LEVEL POSIX_register_level(TIME slice,
int createmain,
struct multiboot_info *mb,
int prioritylevels);
 
/*+ this function forces the running task to go to his queue tail,
then calls the scheduler and changes the context
(it works only on the POSIX level) +*/
int POSIX_sched_yield(LEVEL l);
 
/* the following functions have to be called with interruptions DISABLED! */
 
/*+ this function returns the maximum level allowed for the POSIX level +*/
int POSIX_get_priority_max(LEVEL l);
 
/*+ this function returns the default timeslice for the POSIX level +*/
int POSIX_rr_get_interval(LEVEL l);
 
/*+ this functions returns some paramaters of a task;
policy must be NRT_RR_POLICY or NRT_FIFO_POLICY;
priority must be in the range [0..prioritylevels]
returns ENOSYS or ESRCH if there are problems +*/
int POSIX_getschedparam(LEVEL l, PID p, int *policy, int *priority);
 
/*+ this functions sets paramaters of a task +*/
int POSIX_setschedparam(LEVEL l, PID p, int policy, int priority);
 
__END_DECLS
#endif
 
/*
MANCANO
13.3.6 GETPRIORITYMin da mettere a 0
*/
/shark/trunk/include/modules/pc.h
0,0 → 1,115
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: pc.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the Priority Ceiling (PC) Protocol
 
Title:
PC (Priority Ceiling protocol)
 
Resource Models Accepted:
PC_RES_MODEL
This model is used to tell a PC level the priority of a task.
 
Description:
This module implement the Priority Ceiling Protocol.
The priority inheritance is made using the shadow field of the
task descriptor. No difference is made upon the task model of the
tasks that use PC mutexes.
 
This module is directly derived from the PI one.
 
A PC mutex is created passing the PC_mutexattr structure to mutex_init.
 
When a task is created, a priority must be assigned to the task. This
priority is specified using a PC_RES_MODEL resource model.
 
Exceptions raised:
XMUTEX_OWNER_KILLED
This exception is raised when a task ends and it owns one or more
mutexes
 
Restrictions & special features:
- This module is NOT Posix compliant
- This module can manage any number of PC mutexes.
- If a task ends (because it reaches the end of the body or because it
is killed by someone) and it owns some mutex, an exception is raised.
- if a mutex unlock is called on a mutex not previously
locked or previously locked by another task an exception is raised
- A PC mutex can't be statically allocated.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __PC_H__
#define __PC_H__
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL PC_register_module(void);
 
/*+ This function gets the ceiling of a PC mutex, and it have to be called
only by a task that owns the mutex.
Returns -1 if the mutex is not a PC mutex, 0 otherwise +*/
int PC_get_mutex_ceiling(const mutex_t *mutex, DWORD *ceiling);
 
/*+ This function sets the ceiling of a PC mutex, and it have to be called
only by a task that owns the mutex.
Returns -1 if the mutex is not a PC mutex, 0 otherwise +*/
int PC_set_mutex_ceiling(mutex_t *mutex, DWORD ceiling, DWORD *old_ceiling);
 
/*+ This function sets the ceiling of a task +*/
void PC_set_task_ceiling(RLEVEL r, PID p, DWORD priority);
 
__END_DECLS
#endif
/shark/trunk/include/modules/hartport.h
0,0 → 1,126
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: hartport.h,v 1.2 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the Hartik 3.3.0's port primitives
 
Title:
HARTPORT (Hartik Ports)
 
Resource Models Accepted:
None
 
Description:
This module contains a port library compatible with the Hartik one.
 
Exceptions raised:
None
 
Restrictions & special features:
- This module is NOT Posix compliant
 
Author: Giuseppe Lipari
Date: 9/5/96
Revision: 2.0
Date: 14/3/97
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __PORT_H__
#define __PORT_H__
 
#include <modules/sem.h>
#include <ll/ll.h>
 
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/* $HEADER- */
//#ifndef __HW_DEP_H__
//#include "hw_dep.h"
//#endif
/* $HEADER+ */
 
typedef short PORT;
 
#define MAX_PORT 15U /*+ Maximum number of ports +*/
#define MAX_PORT_INT 30U /*+ Max num. of port connections +*/
#define MAX_PORT_NAME 20U /*+ Maximum port name length +*/
#define MAX_HASH_ENTRY MAX_PORT /*+ More port stuff +*/
 
 
#define STREAM 1
#define MAILBOX 2
#define STICK 3
 
#define READ 0
#define WRITE 1
 
 
 
/*+ This function must be inserted in the __hartik_register_levels__ +*/
void HARTPORT_init(void);
 
 
/* Debugging functions */
void print_port(void);
void port_write(PORT p);
 
/* User level port primitives */
PORT port_create(char *name, int dim_mes, int num_mes, BYTE type, BYTE access);
PORT port_connect(char *name, int dim_mes, BYTE type, BYTE access);
void port_delete(PORT p);
void port_disconnect(PORT p);
 
WORD port_send(PORT p,void *m,BYTE wait);
WORD port_receive(PORT p,void *m,BYTE wait);
 
__END_DECLS
#endif /* __PORT_H__ */
 
/shark/trunk/include/modules/bd_edf.h
0,0 → 1,63
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Massimiliano Giorgi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
/*
* CVS : $Id: bd_edf.h,v 1.3 2003-03-13 13:39:04 pj Exp $
*
* File: $File$
* Revision: $Revision: 1.3 $
* Last update: $Date: 2003-03-13 13:39:04 $
*/
 
#ifndef __BD_EDF_H__
#define __BD_EDF_H__
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL BD_EDF_register_module(void);
 
TIME bd_edf_getdl(void);
 
__END_DECLS
 
#endif
/shark/trunk/include/modules/srp.h
0,0 → 1,121
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: srp.h,v 1.3 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the Stack Resource Policy (SRP) Protocol
 
Title:
SRP (Stack Resource Policy)
 
Resource Models Accepted:
None
 
Description:
This module implement the Stack Resource policy using the shadow field
of the task descriptor. No difference is made upon the task model of the
tasks that use SRP mutexes.
 
A SRP mutex is created passing the SRP_mutexattr structure to mutex_init.
 
In effect, this module doesn't work correctly if it is
used, for example, with a Round Robin Module; in this case we
can have a task B that preempts A, but when B finishes his timeslice, A
can be scheduled by the RR module, and the SRP can't block it, because
the SRP module can not control preemptions (it works only using the shadow
field at lock and unlock time!!!).
Note that this problen not affect the EDF, RM & co. algorithms... because
if B preempts A, A will never preempts on B...
 
A task that want to use the SRP protocol MUST declare it using a
SRP_RES_MODEL in the task_create. Only the first SRP_RES_MODEL is
considered.
 
A task that want to use a SRP mutex have to declare it with the
SRP_usemutex function as last parameter of a task_create call, AFTER
the specification of the preemption level.
 
Exceptions raised:
XMUTEX_OWNER_KILLED
This exception is raised when a task ends and it owns one or more
mutexes
 
XSRP_UNVALID_LOCK
This exception is raised when a task try to lock a srp mutex but
it don't have the provilege.
 
Restrictions & special features:
- This module is NOT Posix compliant
- This module can manage any number of SRP mutexes.
- If a task ends (because it reaches the end of the body or because it
is killed by someone) and it owns some mutex, an exception is raised.
- if a mutex unlock is called on a mutex not previously
locked or previously locked by another task an exception is raised
- A SRP mutex can not be statically allocated
- The module is incompatible with the primitive TASK_JOIN, so the tasks
that uses SRP can NOT call task_join.
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __SRP_H__
#define __SRP_H__
 
#include <kernel/model.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL SRP_register_module(void);
 
extern __inline__ RES_MODEL *SRP_usemutex(mutex_t *m) {
return (RES_MODEL *)m->opt;
};
 
__END_DECLS
#endif
/shark/trunk/include/modules/rr2.h
0,0 → 1,124
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: rr2.h,v 1.3 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the scheduling module RR (Round Robin)
 
Title:
RR (Round Robin) version 2
 
Task Models Accepted:
NRT_TASK_MODEL - Non-Realtime Tasks
weight field is ignored
slice field is used to set the slice of a task, if it is !=0
policy field is ignored
inherit field is ignored
 
Description:
This module schedule his tasks following the classic round-robin
scheme. The default timeslice is given at registration time and is a
a per-task specification. The default timeslice is used if the slice
field in the NRT_TASK_MODEL is 0.
 
The module can SAVE or SKIP activations
There is another module, RR, thar always SKIP activations...
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- if specified, it creates at init time a task,
called "Main", attached to the function __init__().
- There must be only one module in the system that creates a task
attached to the function __init__().
- The level tries to guarantee that a task uses a "full" timeslice
before going to the queue tail. "full" means that a task can execute
a maximum time of slice+sys_tick due to the approx. done by
the Virtual Machine. If a task execute more time than the slice,
the next time it execute less...
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __RR2_H__
#define __RR2_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
extern TASK __init__(void *arg);
 
 
 
/*+ Const: +*/
#define RR2_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/
#define RR2_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/
 
#define RR2_MAIN_YES 1 /*+ The level creates the main +*/
#define RR2_MAIN_NO 0 /*+ The level does'nt create the main +*/
 
/*+ Registration function:
TIME slice the slice for the Round Robin queue
int createmain 1 if the level creates the main task 0 otherwise
struct multiboot_info *b used if createmain specified
returns the level number at which the module has been registered.
+*/
LEVEL RR2_register_level(TIME slice,
int createmain,
struct multiboot_info *mb);
 
__END_DECLS
#endif
/shark/trunk/include/modules/ds.h
0,0 → 1,134
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: ds.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the aperiodic server DS (Polling Server)
 
Title:
DS (Deferrable Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Soft Tasks
wcet field is ignored
met field is ignored
period field is ignored
periodicity field can be only APERIODIC
arrivals field can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the Deferrable Server scheme.
 
All the tasks are put in a FIFO (FCFS) queue and at a time only the first
task in the queue is put in the upper level.
 
The module remembers pending activations when calling task_sleep...
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. The Capacity and the period used by the server
- The level don't use the priority field.
- A function to return the used bandwidth of the level is provided.
- if an aperiodic task calls a task_delay when owning a mutex implemented
with shadows, the delay may have no effect, so don't use delay when
using a mutex!!!
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __DS_H__
#define __DS_H__
 
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ 1 - ln(2) +*/
#ifndef RM_MINFREEBANDWIDTH
#define RM_MINFREEBANDWIDTH 1317922825
#endif
 
/*+ flags... +*/
#define DS_DISABLE_ALL 0
#define DS_ENABLE_BACKGROUND 1 /*+ Background scheduling enabled +*/
#define DS_ENABLE_GUARANTEE_EDF 2 /*+ Task Guarantee enabled +*/
#define DS_ENABLE_ALL_EDF 3 /*+ All flags enabled +*/
 
#define DS_ENABLE_GUARANTEE_RM 4 /*+ Task Guarantee enabled +*/
#define DS_ENABLE_ALL_RM 5 /*+ All flags enabled +*/
 
/*+ internal flags +*/
#define DS_BACKGROUND 8 /*+ this flag is set when scheduling
in background +*/
#define DS_BACKGROUND_BLOCK 16 /*+ this flag is set when we want to
blocks the background scheduling +*/
 
/*+ Registration function:
bandwidth_t b Max bandwidth used by the TBS
int flags Options to be used in this level instance...
LEVEL master the level that must be used as master level for the
TBS tasks
int num,den used to compute the TBS bandwidth
 
returns the level number at which the module has been registered.
+*/
LEVEL DS_register_level(int flags, LEVEL master, int Cs, int per);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t DS_usedbandwidth(LEVEL l);
 
__END_DECLS
#endif
/shark/trunk/include/modules/ssutils.h
0,0 → 1,110
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: ssutils.h,v 1.2 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains utility functions used into
aperiodic server SS (Sporadic Server)
 
Title:
SS (Sporadic Server) utilities
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __SSUTILS_H__
#define __SSUTILS_H__
 
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/* Max size of replenish queue */
#define SS_MAX_REPLENISH MAX_EVENT
 
/*+ Used to store replenishment events +*/
/* Now we use static allocated array. In this way, no more then
SS_MAX_REPLENISH replenishments can be posted.
typedef struct {
struct timespec rtime;
int ramount;
replenishq *next;
} replenishq;
*/
 
/*+ SS local memory allocator.
Can be used for performance optimization. +*/
void *ss_alloc(DWORD b);
 
/*+ Insert an element at tail of replenish queue
LEVEL l module level
int amount element to insert
 
RETURNS:
0 seccesfull insertion
NIL no more space for insertion +*/
int ssq_inslast(LEVEL l, int amount);
 
/*+ Get first element from replenish queue
LEVEL l module level
 
RETURS: extracted element +*/
int ssq_getfirst(LEVEL l);
 
/*+ Enquire for empty queue
LEVEL l module level
 
RETURS:
0 queue is not empty
1 queue is empty +*/
int ssq_isempty(LEVEL l);
 
__END_DECLS
#endif
/shark/trunk/include/modules/pi.h
0,0 → 1,100
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: pi.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the Priority Inheritance (PI) Protocol
 
Title:
PI (Priority Inheritance protocol)
 
Resource Models Accepted:
None
 
Description:
This module implement the Priority Inheritance Protocol.
The priority inheritance is made using the shadow field of the
task descriptor. No difference is made upon the task model of the
tasks that use PI mutexes.
 
A PI mutex is created passing the PI_mutexattr structure to mutex_init.
 
Exceptions raised:
XMUTEX_OWNER_KILLED
This exception is raised when a task ends and it owns one or more
mutexes
 
Restrictions & special features:
- This module is NOT Posix compliant
- This module can manage any number of PI mutexes.
- If a task ends (because it reaches the end of the body or because it
is killed by someone) and it owns some mutex, an exception is raised.
- if a mutex unlock is called on a mutex not previously
locked or previously locked by another task an exception is raised
- A PI mutex can be statically allocated. To do this, the init function
have to define a macro that puts this information in the mutex
descriptor: mutexlevel = <PI resource level>; opt = NULL;
for example, if the PI module is registered at level 1, the macro is
like:
#define MUTEX_INITIALIZER {1,NULL}
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __PI_H__
#define __PI_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL PI_register_module(void);
 
__END_DECLS
#endif
/shark/trunk/include/modules/nopm.h
0,0 → 1,68
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/**
------------
CVS : $Id: nopm.h,v 1.2 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the No Protocol Multiple lock (NOPM) implementation
of mutexes.
It is like NOP (see nop.h) but the owner of the mutex can issue multiple
lock/unlock on mutex.
**/
 
/*
* Copyright (C) 2000 Massimiliano Giorgi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
 
#ifndef __NOPM_H__
#define __NOPM_H__
 
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
void NOPM_register_module(void);
 
__END_DECLS
#endif
/shark/trunk/include/modules/bd_pscan.h
0,0 → 1,68
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/*
* Copyright (C) 2000 Massimiliano Giorgi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
/*
* CVS : $Id: bd_pscan.h,v 1.3 2003-03-13 13:39:04 pj Exp $
*
* File: $File$
* Revision: $Revision: 1.3 $
* Last update: $Date: 2003-03-13 13:39:04 $
*/
 
#ifndef __BD_PSCAN_H__
#define __BD_PSCAN_H__
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
RLEVEL BD_PSCAN_register_module(void);
 
int bd_pscan_getpriority(void);
 
#define PSCAN_CRITICALPRIORITY 0
#define PSCAN_HIGHPRIORITY 1
#define PSCAN_MEDIUMPRIORITY 2
#define PSCAN_LOWPRIORITY 3
 
__END_DECLS
#endif
/shark/trunk/include/modules/rrsoft.h
0,0 → 1,140
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: rrsoft.h,v 1.3 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the scheduling module RRSOFT (Round Robin for
Hard & Soft Model)
 
Title:
RRSOFT (Round Robin) version 1
 
Task Models Accepted:
NRT_TASK_MODEL - Non-Realtime Tasks
weight field is ignored
slice field is used to set the slice of a task, if it is !=0
policy field is ignored
inherit field is ignored
SOFT_TASK_MODEL - Soft tasks
only the periodicity and the met are used.
HARD_TASK_MODEL - Hard tasks
only the periodicity and the period are used.
 
 
Description:
This module schedule his tasks following the classic round-robin
scheme. The default timeslice is given at registration time and is a
a per-task specification. The default timeslice is used if the slice
field in the NRT_TASK_MODEL is 0.
 
The module can SAVE or SKIP activations
There is another module, RR, thar always SKIP activations...
 
The Module is derived from the RRSOFT, and it accepts only one
kind of task Model (hard, soft or nrt).
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- if specified, it creates at init time a task,
called "Main", attached to the function __init__().
- There must be only one module in the system that creates a task
attached to the function __init__().
- The level tries to guarantee that a task uses a "full" timeslice
before going to the queue tail. "full" means that a task can execute
a maximum time of slice+sys_tick due to the approx. done by
the Virtual Machine. If a task execute more time than the slice,
the next time it execute less...
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __RRSOFT_H__
#define __RRSOFT_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
extern TASK __init__(void *arg);
 
 
 
/*+ Const: +*/
#define RRSOFT_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/
#define RRSOFT_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/
 
#define RRSOFT_MAIN_YES 1 /*+ The level creates the main +*/
#define RRSOFT_MAIN_NO 0 /*+ The level does'nt create the main +*/
 
#define RRSOFT_ONLY_HARD 1 /*+ The level accepts only Hard Tasks +*/
#define RRSOFT_ONLY_SOFT 2 /*+ The level accepts only Soft Tasks +*/
#define RRSOFT_ONLY_NRT 4 /*+ The level accepts only NRT Tasks +*/
 
 
/*+ Registration function:
TIME slice the slice for the Round Robin queue
int createmain 1 if the level creates the main task 0 otherwise
struct multiboot_info *mb used if createmain specified
 
returns the level number at which the module has been registered.
+*/
 
LEVEL RRSOFT_register_level(TIME slice,
int createmain,
struct multiboot_info *mb,
BYTE models);
 
__END_DECLS
#endif
/shark/trunk/include/modules/ps.h
0,0 → 1,135
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: ps.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the aperiodic server PS (Polling Server)
 
Title:
PS (Polling Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Soft Tasks
wcet field is ignored
met field is ignored
period field is ignored
periodicity field can be only APERIODIC
arrivals field can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the Polling Server scheme.
 
All the tasks are put in a FIFO (FCFS) queue and at a time only the first
task in the queue is put in the upper level.
 
The module remembers pending activations when calling task_sleep...
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. The Capacity and the period used by the server
- The level don't use the priority field.
- A function to return the used bandwidth of the level is provided.
- if an aperiodic task calls a task_delay when owning a mutex implemented
with shadows, the delay may have no effect, so don't use delay when
using a mutex!!!
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __PS_H__
#define __PS_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ 1 - ln(2) +*/
#ifndef RM_MINFREEBANDWIDTH
#define RM_MINFREEBANDWIDTH 1317922825
#endif
 
/*+ flags... +*/
#define PS_DISABLE_ALL 0
#define PS_ENABLE_BACKGROUND 1 /*+ Background scheduling enabled +*/
#define PS_ENABLE_GUARANTEE_EDF 2 /*+ Task Guarantee enabled +*/
#define PS_ENABLE_ALL_EDF 3 /*+ All flags enabled +*/
 
#define PS_ENABLE_GUARANTEE_RM 4 /*+ Task Guarantee enabled +*/
#define PS_ENABLE_ALL_RM 5 /*+ All flags enabled +*/
 
/*+ internal flags +*/
#define PS_BACKGROUND 8 /*+ this flag is set when scheduling
in background +*/
#define PS_BACKGROUND_BLOCK 16 /*+ this flag is set when we want to
blocks the background scheduling +*/
 
/*+ Registration function:
bandwidth_t b Max bandwidth used by the TBS
int flags Options to be used in this level instance...
LEVEL master the level that must be used as master level for the
TBS tasks
int num,den used to compute the TBS bandwidth
 
returns the level number at which the module has been registered.
+*/
LEVEL PS_register_level(int flags, LEVEL master, int Cs, int per);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t PS_usedbandwidth(LEVEL l);
 
__END_DECLS
#endif
/shark/trunk/include/modules/rr.h
0,0 → 1,124
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: rr.h,v 1.3 2003-03-13 13:39:04 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:04 $
------------
 
This file contains the scheduling module RR (Round Robin)
 
Title:
RR (Round Robin)
 
Task Models Accepted:
NRT_TASK_MODEL - Non-Realtime Tasks
weight field is ignored
slice field is used to set the slice of a task, if it is !=0
activation field is ignored
policy field is ignored
inherit field is ignored
 
Description:
This module schedule his tasks following the classic round-robin
scheme. The default timeslice is given at registration time and is a
a per-task specification. The default timeslice is used if the slice
field in the NRT_TASK_MODEL is 0.
 
The module always SKIP instances, either if SAVE_ARRIVALS is set!!!
There is another module, RR2, thar remember activations...
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
Restrictions & special features:
- if specified, it creates at init time a task,
called "Main", attached to the function __init__().
- There must be only one module in the system that creates a task
attached to the function __init__().
- The level tries to guarantee that a task uses a "full" timeslice
before going to the queue tail. "full" means that a task can execute
a maximum time of slice+sys_tick due to the approx. done by
the Virtual Machine. If a task execute more time than the slice,
the next time it execute less...
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __RR_H__
#define __RR_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
extern TASK __init__(void *arg);
 
 
 
/*+ Const: +*/
#define RR_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/
#define RR_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/
 
#define RR_MAIN_YES 1 /*+ The level creates the main +*/
#define RR_MAIN_NO 0 /*+ The level does'nt create the main +*/
 
/*+ Registration function:
TIME slice the slice for the Round Robin queue
int createmain 1 if the level creates the main task 0 otherwise
struct multiboot_info *mb used if createmain specified
 
returns the level number at which the module has been registered.
+*/
LEVEL RR_register_level(TIME slice,
int createmain,
struct multiboot_info *mb);
__END_DECLS
#endif
/shark/trunk/include/modules/sem.h
0,0 → 1,105
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: sem.h,v 1.2 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the semaphoric primitives
 
Title:
HARTSEM (Hartik Semaphores)
 
Resource Models Accepted:
None
 
Description:
This module contains a semaphore library compatible with Posix, Plus
an extension to permit post and wait with counters > 1
 
Exceptions raised:
None
 
Restrictions & special features:
- a function isBlocked is provided
- the named semaphores are NOT implemented with a filesystem
- the system supports up to _POSIX_SEM_NSEMS_MAX defined in limits.h
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __MODULES_SEM_H__
#define __MODULES_SEM_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
#define SEM_FAILED NULL
typedef int sem_t;
 
/*+ This function must be inserted in the __hartik_register_levels__ +*/
void SEM_register_module(void);
 
int sem_close(sem_t *sem);
int sem_destroy(sem_t *sem);
int sem_getvalue(sem_t *sem, int *sval);
int sem_init(sem_t *sem, int pshared, unsigned int value);
sem_t *sem_open(const char *name, int oflag, ...);
int sem_post(sem_t *sem);
int sem_trywait(sem_t *sem);
int sem_unlink(const char *name);
int sem_wait(sem_t *sem);
 
 
 
int sem_xpost(sem_t *sem, int n);
int sem_xwait(sem_t *sem, int n, int wait);
 
 
int isBlocked(PID i);
 
__END_DECLS
#endif
/shark/trunk/include/modules/ss.h
0,0 → 1,169
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: ss.h,v 1.3 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the aperiodic server SS (Sporadic Server)
 
Title:
SS (Sporadic Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Soft Tasks
wcet field is ignored
met field is ignored
period field is ignored
periodicity field can be only APERIODIC
arrivals field can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the Sporadic Server scheme.
The scheme is slightly modified respect to classic SS. The server
becomes active at arrival time of a task must be served.
 
All the tasks are put in a FIFO (FCFS) queue and at a time only the first
task in the queue is put in the upper level.
 
The module remembers pending activations when calling task_sleep...
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
XUNVALID_SS_REPLENISH
Indicates an anomalous replenishment situation:
. replenish time fires and no amounts are set
. replenish amount posted when server is not active
. no more space to post a replenish amount
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. The Capacity and the period used by the server
- The level don't use the priority field.
- if an aperiodic task calls a task_delay when owning a mutex implemented
with shadows, the delay may have no effect, so don't use delay when
using a mutex!!!
- On calling task_delay and task_sleep the replenish amount is posted.
This because replenish time may fires when task is sleeping (server
is not active).
- A function to return the used bandwidth of the level is provided.
- A function to return the avail server capacity is provided.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __SS_H__
#define __SS_H__
 
#include <kernel/config.h>
#include <kernel/types.h>
#include <sys/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ 1 - ln(2) +*/
#ifndef RM_MINFREEBANDWIDTH
#define RM_MINFREEBANDWIDTH 1317922825
#endif
 
/*+ Max size of replenish queue +*/
#define SS_MAX_REPLENISH MAX_EVENT
 
/*+ flags... +*/
#define SS_DISABLE_ALL 0
#define SS_ENABLE_BACKGROUND 1 /*+ Background scheduling enabled +*/
#define SS_ENABLE_GUARANTEE_EDF 2 /*+ Task Guarantee enabled +*/
#define SS_ENABLE_ALL_EDF 3 /*+ guarantee+background enabled +*/
 
#define SS_ENABLE_GUARANTEE_RM 4 /*+ Task Guarantee enabled +*/
#define SS_ENABLE_ALL_RM 5 /*+ guarantee+background enabled +*/
 
/*+ internal flags +*/
#define SS_BACKGROUND 8 /*+ this flag is set when scheduling
in background +*/
#define SS_BACKGROUND_BLOCK 16 /*+ this flag is set when we want to
blocks the background scheduling +*/
 
/*+ internal switches +*/
typedef enum {
SS_SERVER_NOTACTIVE, /*+ SS is not active +*/
SS_SERVER_ACTIVE /*+ SS is active +*/
} ss_status;
 
/*+ internal functions +*/
 
/*+ Used to store replenishment events +*/
/* Now we use static allocated array. In this way, no more then
SS_MAX_REPLENISH replenishments can be posted.
typedef struct {
struct timespec rtime;
int ramount;
replenishq *next;
} replenishq;
*/
 
/*+ Registration function:
bandwidth_t b Max bandwidth used by the SS
int flags Options to be used in this level instance...
LEVEL master The level that must be used as master level
int Cs Server capacity
int per Server period
 
returns the level number at which the module has been registered.
+*/
LEVEL SS_register_level(int flags, LEVEL master, int Cs, int per);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t SS_usedbandwidth(LEVEL l);
 
/*+ Returns tha available capacity +*/
int SS_availCs(LEVEL l);
 
__END_DECLS
#endif
/shark/trunk/include/modules/tbs.h
0,0 → 1,157
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
 
/**
------------
CVS : $Id: tbs.h,v 1.3 2003-03-13 13:39:05 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-03-13 13:39:05 $
------------
 
This file contains the aperiodic server TBS (Total Bandwidth Server)
 
Title:
TBS (Total Bandwidth Server)
 
Task Models Accepted:
SOFT_TASK_MODEL - Aperiodic Tasks
wcet field must be != 0
met field is ignored
period field is ignored
periodicity must be APERIODIC
arrivals can be either SAVE or SKIP
 
Description:
This module schedule his tasks following the TBS scheme.
Each task has a deadline assigned with the TBS scheme,
 
wcet
d = max(r , d ) + ----
k k k-1 Us
 
The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
and the TBS level expects that the task is scheduled with the absolute
deadline passed in the model.
 
The task guarantee is based on the factor utilization approach.
The theory guarantees that the task set is schedulable if
Up + Us <= 1
so it is sufficient to add the Us to the bandwidth used by the upper
levels (we suppose that the levels with level number < of the current
can guarantee their task sets basing on the same formula...
 
All the tasks are put in a FIFO (FCFS) queue and at a time only the first
task in the queue is put in the upper level.
 
Exceptions raised:
XUNVALID_GUEST
This level doesn't support guests. When a guest operation
is called, the exception is raised.
 
These exceptions are pclass-dependent...
XDEADLINE_MISS
If a task miss his deadline, the exception is raised.
Normally, a TBS task can't cause the raise of such exception because
if it really use more time than declared a XWCET_VIOLATION is raised
instead.
 
XWCET_VIOLATION
If a task doesn't end the current cycle before if consume the wcet,
an exception is raised, and the task is put in the TBS_WCET_VIOLATED
state. To reactivate it, use TBS_task_activate via task_activate or
manage directly the TBS data structure. Note that if the exception
is not handled properly, an XDEADLINE_MISS exception will also be
raised at the absolute deadline...
 
Restrictions & special features:
- This level doesn't manage the main task.
- At init time we have to specify:
. The bandwidth used by the server
. some flags
. wcet check activated
(If a task require more time than declared, it is stopped and put in
the state TBS_WCET_VIOLATED; a XWCET_VIOLATION exception is raised)
. guarantee check
(when all task are created the system will check that the task_set
will not use more than the available bandwidth)
- The level don't use the priority field.
- A function to return the used bandwidth of the level is provided.
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef __TBS_H__
#define __TBS_H__
 
#include <ll/ll.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/*+ flags... +*/
#define TBS_DISABLE_ALL 0
#define TBS_ENABLE_WCET_CHECK 1 /*+ Wcet check enabled +*/
#define TBS_ENABLE_GUARANTEE 2 /*+ Task Guarantee enabled +*/
#define TBS_ENABLE_ALL 3 /*+ All flags enabled +*/
 
 
/*+ Registration function:
bandwidth_t b Max bandwidth used by the TBS
int flags Options to be used in this level instance...
LEVEL master the level that must be used as master level for the
TBS tasks
int num,den used to compute the TBS bandwidth +*/
void TBS_register_level(int flags, LEVEL master, int num, int den);
 
/*+ Returns the used bandwidth of a level +*/
bandwidth_t TBS_usedbandwidth(LEVEL l);
 
/*+ Returns the number of pending activations of a task, or -1 if the level
is wrong.
No control is done if the task is not a TBS task! +*/
int TBS_get_nact(LEVEL l, PID p);
 
__END_DECLS
#endif
/shark/trunk/include/semaphore.h
20,11 → 20,11
 
/**
------------
CVS : $Id: semaphore.h,v 1.2 2005-02-25 11:00:23 pj Exp $
CVS : $Id: semaphore.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2005-02-25 11:00:23 $
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-03-29 14:12:51 $
------------
 
This file contains the posix semaphore interface
55,6 → 55,6
#ifndef __SEMAPHORE_H__
#define __SEMAPHORE_H__
 
#include <sem/sem/sem.h>
#include <modules/sem.h>
 
#endif