Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 252 → Rev 253

/shark/trunk/ports/first/include/grubstar.h
18,68 → 18,7
* http://shark.sssup.it
*/
 
 
/*
------------
CVS : $Id: grubstar.h,v 1.1 2003-09-30 09:26:57 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1 $
Last update: $Date: 2003-09-30 09:26:57 $
------------
 
This file contains the budget support for the multiapplication
scheduling algorithm proposed in the framework of the FIRST Project
 
Title:
CBSSTAR
 
Task Models Accepted:
None!
 
Guest Models Accepted:
BUDGET_TASK_MODEL - A task that is attached to a budget
int b; --> the number of the budget which the task is attached to
 
Description:
This module schedule its tasks following the CBS scheme.
Every task is inserted using the guest calls.
The module defines a limited set of budgets that the application
can use. Every guest task will use a particular budget; FIFO
scheduling is used inside a budget to schedule more than one ready
task attached to the same budget.
 
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.
 
This module tries to implement a simplified version of the guest
task interface:
- To insert a guest task, use guest_create
- When a task is dispatched, use guest_dispatch
- When a task have to be suspended, you have to use:
-> preemption: use guest_epilogue
-> synchronization, end: use guest_end
Remember: no check is done on the budget number passed with the model!!!
 
Exceptions raised:
XUNVALID_TASK
This level doesn't support normal tasks, but just guest tasks.
When a task operation is called, an exception is raised.
 
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 is provided to allocate a buffer.
*/
 
/*
* Copyright (C) 2002 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
99,21 → 38,11
*/
 
 
#ifndef __CBSSTAR_H__
#define __CBSSTAR_H__
#ifndef __GRUBSTAR_H__
#define __GRUBSTAR_H__
 
#include <kernel/kern.h>
 
//#include <ll/ll.h>
//#include <kernel/config.h>
//#include <sys/types.h>
//#include <kernel/types.h>
//#include <modules/codes.h>
 
/* -----------------------------------------------------------------------
BUDGET_TASK_MODEL: a model for guest tasks
----------------------------------------------------------------------- */
 
#define BUDGET_PCLASS 0x0600
typedef struct {
128,27 → 57,12
 
 
/* some constants for registering the Module in the right place */
#define CBSSTAR_LEVELNAME "CBSSTAR"
#define CBSSTAR_LEVEL_CODE 106
#define CBSSTAR_LEVEL_VERSION 1
#define GRUBSTAR_LEVELNAME "GRUBSTAR"
#define GRUBSTAR_LEVEL_CODE 106
#define GRUBSTAR_LEVEL_VERSION 1
 
typedef struct {
int command;
void *param;
} CBSSTAR_command_message;
LEVEL GRUBSTAR_register_level(int n, LEVEL master);
 
typedef struct {
int budget;
TIME T,Q;
} CBSSTAR_mod_budget;
 
/* Registration function:
int N Maximum number of budgets allocated for the applications
LEVEL master the level that must be used as master level for the
CBS tasks
*/
LEVEL CBSSTAR_register_level(int n, LEVEL master);
 
/* Allocates a budget to be used for an application.
Input parameters:
Q The budget
159,24 → 73,25
-2 The budgets allocated locally to this module have bandwidth > 1
-3 wrong LEVEL id
*/
int CBSSTAR_setbudget(LEVEL l, TIME Q, TIME T, LEVEL local_scheduler_level, int scheduler_id);
int GRUBSTAR_setbudget(LEVEL l, TIME Q, TIME T, LEVEL local_scheduler_level, int scheduler_id);
 
int CBSSTAR_removebudget(LEVEL l, int budget);
int GRUBSTAR_removebudget(LEVEL l, int budget);
 
int CBSSTAR_adjust_budget(LEVEL l, TIME Q, TIME T, int budget);
int GRUBSTAR_adjust_budget(LEVEL l, TIME Q, TIME T, int budget);
 
int CBSSTAR_getbudgetinfo(LEVEL l, TIME *Q, TIME *T, int budget);
int GRUBSTAR_getbudgetinfo(LEVEL l, TIME *Q, TIME *T, int budget);
 
int CBSSTAR_was_budget_overran(LEVEL l, int budget);
int GRUBSTAR_was_budget_overran(LEVEL l, int budget);
 
int CBSSTAR_is_active(LEVEL l, int budget);
int GRUBSTAR_is_active(LEVEL l, int budget);
 
int CBSSTAR_get_local_scheduler_level_from_budget(LEVEL l, int budget);
int GRUBSTAR_get_local_scheduler_level_from_budget(LEVEL l, int budget);
 
int CBSSTAR_get_local_scheduler_level_from_pid(LEVEL l, PID p);
int GRUBSTAR_get_local_scheduler_level_from_pid(LEVEL l, PID p);
 
int CBSSTAR_get_local_scheduler_id_from_budget(LEVEL l, int budget);
int GRUBSTAR_get_local_scheduler_id_from_budget(LEVEL l, int budget);
 
int CBSSTAR_get_local_scheduler_id_from_pid(LEVEL l, PID p);
int GRUBSTAR_get_local_scheduler_id_from_pid(LEVEL l, PID p);
 
#endif
 
/shark/trunk/ports/first/include/fsf_server.h
1,7 → 1,7
#ifndef _FSF_SERVER_H_
#define _FSF_SERVER_H_
 
#define FSF_CBSSTAR
#define FSF_GRUBSTAR
 
#ifdef FSF_CBSSTAR
 
23,10 → 23,11
#define SERVER_setbudget GRUBSTAR_setbudget
#define SERVER_adjust_budget GRUBSTAR_adjust_budget
#define SERVER_removebudget GRUBSTAR_removebudget
#define SERVER_get_local_scheduler_id_from_server GRUBSTAR_get_local_scheduler_id_from_server
#define SERVER_get_local_scheduler_id_from_budget GRUBSTAR_get_local_scheduler_id_from_budget
#define SERVER_get_local_scheduler_id_from_pid GRUBSTAR_get_local_scheduler_id_from_pid
#define SERVER_get_local_scheduler_level_from_server GRUBSTAR_get_local_scheduler_level_from_server
#define SERVER_get_local_scheduler_level_from_budget GRUBSTAR_get_local_scheduler_level_from_budget
#define SERVER_get_local_scheduler_level_from_pid GRUBSTAR_get_local_scheduler_level_from_pid
#define SERVER_getbudgetinfo GRUBSTAR_getbudgetinfo
 
#endif