Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1116 → Rev 1115

/demos/trunk/first/cbsstar.c
20,11 → 20,11
 
/*
------------
CVS : $Id: cbsstar.c,v 1.3 2002-11-11 08:17:59 pj Exp $
CVS : $Id: cbsstar.c,v 1.2 2002-10-28 08:16:09 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2002-11-11 08:17:59 $
Revision: $Revision: 1.2 $
Last update: $Date: 2002-10-28 08:16:09 $
------------
 
Read CBSSTAR.h for general details.
130,7 → 130,7
 
PID current; /* the task currently put in execution */
 
IQUEUE tasks; /* a FIFO queue for the tasks handled
QQUEUE tasks; /* a FIFO queue for the tasks handled
using the budget */
};
 
360,6 → 360,9
static void CBSSTAR_task_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static void CBSSTAR_task_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static int CBSSTAR_guest_create(LEVEL l, PID p, TASK_MODEL *m)
{
/* A task has been activated for some reason. Basically, the task is
385,7 → 388,7
/* The budget is not empty, another task is already into the
master module, so the task is inserted at the end of the budget
queue */
iq_insertlast(p,&lev->b[budget->b].tasks);
qq_insertlast(p,&lev->b[budget->b].tasks);
#ifdef CBSSTAR_DEBUG
cbsstar_printf(" ilast");
cbsstar_printq(&lev->b[budget->b].tasks);
423,7 → 426,7
#endif
 
/* check if the buffer has someone else to schedule */
if (iq_query_first(&lev->b[lev->tb[p]].tasks) == NIL) {
if (qq_queryfirst(&lev->b[lev->tb[p]].tasks) == NIL) {
/* the buffer has no tasks! */
lev->b[lev->tb[p]].current = NIL;
}
433,7 → 436,7
struct timespec t;
ll_gettime(TIME_EXACT, &t);
n = iq_getfirst(&lev->b[lev->tb[p]].tasks);
n = qq_getfirst(&lev->b[lev->tb[p]].tasks);
#ifdef CBSSTAR_DEBUG
cbsstar_printf("{p%d n%d}",p,n);
#endif
441,7 → 444,7
}
}
else
iq_extract(p, &lev->b[lev->tb[p]].tasks);
qq_extract(p, &lev->b[lev->tb[p]].tasks);
}
 
static void CBSSTAR_guest_dispatch(LEVEL l, PID p, int nostop)
547,9 → 550,12
static void CBSSTAR_guest_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
static void CBSSTAR_guest_delay(LEVEL l, PID p, DWORD tickdelay)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
 
 
 
/* Registration functions */
 
/*+ Registration function:
603,6 → 609,7
lev->l.task_endcycle = CBSSTAR_task_endcycle;
lev->l.task_end = CBSSTAR_task_end;
lev->l.task_sleep = CBSSTAR_task_sleep;
lev->l.task_delay = CBSSTAR_task_delay;
 
lev->l.guest_create = CBSSTAR_guest_create;
lev->l.guest_detach = CBSSTAR_guest_detach;
614,6 → 621,7
lev->l.guest_endcycle = CBSSTAR_guest_endcycle;
lev->l.guest_end = CBSSTAR_guest_end;
lev->l.guest_sleep = CBSSTAR_guest_sleep;
lev->l.guest_delay = CBSSTAR_guest_delay;
 
/* fill the CBSSTAR descriptor part */
lev->b = (struct budget_struct *)kern_alloc(sizeof(struct budget_struct)*n);
625,7 → 633,7
lev->b[i].dline_timer = 0;
lev->b[i].avail = 0;
lev->b[i].current = -1;
iq_init(&lev->b[i].tasks, &freedesc, 0);
qq_init(&lev->b[i].tasks);
}
 
lev->n = n;
/demos/trunk/first/rmstar.c
18,11 → 18,11
 
/**
------------
CVS : $Id: rmstar.c,v 1.3 2002-11-11 08:17:59 pj Exp $
CVS : $Id: rmstar.c,v 1.2 2002-10-28 08:16:09 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2002-11-11 08:17:59 $
Revision: $Revision: 1.2 $
Last update: $Date: 2002-10-28 08:16:09 $
------------
**/
 
55,7 → 55,7
#include <kernel/trace.h>
 
/* for iqueues */
/* #include "iqueue.h" Now iqueues are the only queue type into the kernel */
#include "iqueue.h"
 
/* for BUDGET_TASK_MODEL */
#include "cbsstar.h"
128,7 → 128,7
rmstar_printf("(E:chk)");
#endif
 
if ((first = iq_query_first(&lev->ready)) != lev->activated) {
if ((first = iq_queryfirst(&lev->ready)) != lev->activated) {
if (lev->activated != NIL)
level_table[ lev->scheduling_level ]->
guest_end(lev->scheduling_level, lev->activated);
283,7 → 283,7
static void RMSTAR_level_status(LEVEL l)
{
RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
PID p = iq_query_first(&lev->ready);
PID p = iq_queryfirst(&lev->ready);
struct timespec temp;
kern_printf("Budget number : %u\n", lev->budget);
304,7 → 304,7
temp.tv_sec,
temp.tv_nsec/1000,
RMSTAR_status_to_a(proc_table[p].status));
p = iq_query_next(p, &lev->ready);
p = proc_table[p].next;
}
}
554,7 → 554,7
/* we finally put the task in the ready queue */
proc_table[p].status = FREE;
iq_insertfirst(p,&freedesc);
q_insertfirst(p,&freedesc);
if (lev->deadline_timer[p] != -1) {
event_delete(lev->deadline_timer[p]);
567,6 → 567,8
static void RMSTAR_task_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static void RMSTAR_task_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
/* Guest Functions
These functions manages a JOB_TASK_MODEL, that is used to put
699,6 → 701,9
static void RMSTAR_guest_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
static void RMSTAR_guest_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
/* Registration functions */
 
/* Registration function:
751,6 → 756,7
lev->l.task_endcycle = RMSTAR_task_endcycle;
lev->l.task_end = RMSTAR_task_end;
lev->l.task_sleep = RMSTAR_task_sleep;
lev->l.task_delay = RMSTAR_task_delay;
 
lev->l.guest_create = RMSTAR_guest_create;
lev->l.guest_detach = RMSTAR_guest_detach;
762,6 → 768,7
lev->l.guest_endcycle = RMSTAR_guest_endcycle;
lev->l.guest_end = RMSTAR_guest_end;
lev->l.guest_sleep = RMSTAR_guest_sleep;
lev->l.guest_delay = RMSTAR_guest_delay;
 
/* fill the RMSTAR descriptor part */
for(i=0; i<MAX_PROC; i++) {
/demos/trunk/first/edfstar.c
18,11 → 18,11
 
/**
------------
CVS : $Id: edfstar.c,v 1.3 2002-11-11 08:17:59 pj Exp $
CVS : $Id: edfstar.c,v 1.2 2002-10-28 08:16:09 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2002-11-11 08:17:59 $
Revision: $Revision: 1.2 $
Last update: $Date: 2002-10-28 08:16:09 $
------------
**/
 
55,9 → 55,7
#include <kernel/trace.h>
 
/* for iqueues */
/* #include "iqueue.h" Now iqueues are the only queue type available
into the kernel */
#include <kernel/iqueue.h>
#include "iqueue.h"
 
/* for BUDGET_TASK_MODEL */
#include "cbsstar.h"
130,7 → 128,7
edfstar_printf("(E:chk)");
#endif
 
if ((first = iq_query_first(&lev->ready)) != lev->activated) {
if ((first = iq_queryfirst(&lev->ready)) != lev->activated) {
if (lev->activated != NIL)
level_table[ lev->scheduling_level ]->
guest_end(lev->scheduling_level, lev->activated);
285,7 → 283,7
static void EDFSTAR_level_status(LEVEL l)
{
EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
PID p = iq_query_first(&lev->ready);
PID p = iq_queryfirst(&lev->ready);
struct timespec temp;
kern_printf("Budget number : %u\n", lev->budget);
306,7 → 304,7
temp.tv_sec,
temp.tv_nsec/1000,
EDFSTAR_status_to_a(proc_table[p].status));
p = iq_query_next(p, &lev->ready);
p = proc_table[p].next;
}
}
555,7 → 553,7
/* we finally put the task in the ready queue */
proc_table[p].status = FREE;
iq_insertfirst(p,&freedesc);
q_insertfirst(p,&freedesc);
if (lev->deadline_timer[p] != -1) {
event_delete(lev->deadline_timer[p]);
568,6 → 566,9
static void EDFSTAR_task_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static void EDFSTAR_task_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
/* Guest Functions
These functions manages a JOB_TASK_MODEL, that is used to put
a guest task in the EDFSTAR ready queue. */
698,6 → 699,9
static void EDFSTAR_guest_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
static void EDFSTAR_guest_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
/* Registration functions */
 
/* Registration function:
750,6 → 754,7
lev->l.task_endcycle = EDFSTAR_task_endcycle;
lev->l.task_end = EDFSTAR_task_end;
lev->l.task_sleep = EDFSTAR_task_sleep;
lev->l.task_delay = EDFSTAR_task_delay;
 
lev->l.guest_create = EDFSTAR_guest_create;
lev->l.guest_detach = EDFSTAR_guest_detach;
761,6 → 766,7
lev->l.guest_endcycle = EDFSTAR_guest_endcycle;
lev->l.guest_end = EDFSTAR_guest_end;
lev->l.guest_sleep = EDFSTAR_guest_sleep;
lev->l.guest_delay = EDFSTAR_guest_delay;
 
/* fill the EDFSTAR descriptor part */
for(i=0; i<MAX_PROC; i++) {
/demos/trunk/first/testiq.c
18,11 → 18,11
 
/*
------------
CVS : $Id: testiq.c,v 1.2 2002-11-11 08:17:59 pj Exp $
CVS : $Id: testiq.c,v 1.1 2002-09-02 10:29:30 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2002-11-11 08:17:59 $
Revision: $Revision: 1.1 $
Last update: $Date: 2002-09-02 10:29:30 $
------------
 
The purpose of this test is to show that two budgets with different
29,9 → 29,6
period and budgets schedules correctly.
2 never ending tasks are involved
 
This test cannot compile because of the fact that QUEUE and QQUEUE
types does not exist anymore!
*/
 
/*
/demos/trunk/first/makefile
12,22 → 12,22
include $(BASE)/config/example.mk
 
test1:
make -f $(SUBMAKE) APP=test1 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test1 INIT= OTHEROBJS="iqueue.o edfstar.o cbsstar.o" OTHERINCL=
 
test2:
make -f $(SUBMAKE) APP=test2 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test2 INIT= OTHEROBJS="iqueue.o edfstar.o cbsstar.o" OTHERINCL=
 
test3:
make -f $(SUBMAKE) APP=test3 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test3 INIT= OTHEROBJS="iqueue.o edfstar.o cbsstar.o" OTHERINCL=
 
test4:
make -f $(SUBMAKE) APP=test4 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test4 INIT= OTHEROBJS="iqueue.o edfstar.o cbsstar.o" OTHERINCL=
 
test5:
make -f $(SUBMAKE) APP=test5 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test5 INIT= OTHEROBJS="iqueue.o edfstar.o cbsstar.o" OTHERINCL=
 
test6:
make -f $(SUBMAKE) APP=test6 INIT= OTHEROBJS="rmstar.o cbsstar.o" OTHERINCL=
make -f $(SUBMAKE) APP=test6 INIT= OTHEROBJS="iqueue.o rmstar.o cbsstar.o" OTHERINCL=
 
#testiq:
# make -f $(SUBMAKE) APP=testiq INIT= OTHEROBJS="iqueue.o " OTHERINCL=
testiq:
make -f $(SUBMAKE) APP=testiq INIT= OTHEROBJS="iqueue.o " OTHERINCL=