Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1392 → Rev 1393

/demos/trunk/base/aster8.c
34,7 → 34,7
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* CVS : $Id: aster8.c,v 1.3 2004-04-17 11:36:13 giacomo Exp $
* CVS : $Id: aster8.c,v 1.4 2004-04-21 14:55:05 giacomo Exp $
 
Test for Sporadic Server (ss):
 
53,14 → 53,12
#include "modules/cbs.h"
#include "modules/ss.h"
 
#include <drivers/shark_linuxc26.h>
#include <drivers/shark_input26.h>
#include <drivers/shark_keyb26.h>
 
int num_aster = 0;
#define EDF_LEV 0
#define CBS_LEV 1
#define SS_LEV 2
#define EDF_LEV 1
#define CBS_LEV 2
#define SS_LEV 3
 
#define ASTER_LIM 60
#define DISPLAY_MAX 8
99,60 → 97,7
#endif
 
PID p1,p2,p3,p4,p5;
PID shutdown_task_PID = -1;
 
int device_drivers_init() {
KEYB_PARMS kparms = BASE_KEYB;
LINUXC26_register_module();
 
keyb_def_ctrlC(kparms, NULL);
INPUT26_init();
 
KEYB26_init(&kparms);
 
return 0;
}
 
int device_drivers_close() {
 
KEYB26_close();
 
INPUT26_close();
 
return 0;
 
}
 
TASK shutdown_task_body(void *arg) {
 
device_drivers_close();
 
sys_shutdown_message("-- S.Ha.R.K. Closed --\n");
 
sys_end();
 
return NULL;
 
}
 
void set_shutdown_task() {
 
NRT_TASK_MODEL nrt;
 
nrt_task_default_model(nrt);
 
shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL);
if (shutdown_task_PID == NIL) {
sys_shutdown_message("Error: Cannot create shutdown task\n");
sys_end();
}
 
}
 
TASK asteroide(void)
{
int i;
393,7 → 338,7
for (j=0; j<5; j++) last[j] = 0;
jet_gettable(p, &last[0], 5);
mutex_lock(&m1);
if (proc_table[p].task_level == 1)
if (proc_table[p].task_level == 2)
printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6d ³ %-6d ³ %-4d ³ %-7d ³ %-5d ³ %-5d ³ %-5d ³ %-5d ³ %-5d",
p, (int)sum/(nact==0 ? 1 : nact), (int)max, nact, (int)CBS_get_nact(2,p), (int)last[0], (int)last[1], (int)last[2], (int)last[3], (int)last[4]);
// p, sum/(nact==0 ? 1 : nact), max, proc_table[p].avail_time, proc_table[p].status, proc_table[p].shadow, proc_table[p].timespec_priority.tv_sec,proc_table[p].timespec_priority.tv_nsec/1000 , CBS_get_nact(2,p), last[4]);
411,7 → 356,9
 
void fine(KEY_EVT *e)
{
task_activate(shutdown_task_PID);
 
sys_end();
 
}
 
void mydummyaper(void) {
442,10 → 389,6
SOFT_TASK_MODEL m_aper;
SOFT_TASK_MODEL m_soft;
 
set_shutdown_task();
 
device_drivers_init();
 
#ifdef PIMUTEX
PI_mutexattr_t a;
#endif
500,7 → 443,7
p1 = task_create("Aster",aster,&m,NULL);
if (p1 == -1) {
sys_shutdown_message("test7.c(main): Could not create task <aster> ...");
task_activate(shutdown_task_PID);
sys_end();
return 0;
}
 
509,7 → 452,7
p2 = task_create("Clock",clock,&m,NULL);
if (p2 == -1) {
sys_shutdown_message("test7.c(main): Could not create task <Clock> ...");
task_activate(shutdown_task_PID);
sys_end();
return 0;
}
 
516,7 → 459,7
p3 = task_create("JetControl",jetcontrol,&m_aper,NULL);
if (p3 == -1) {
sys_shutdown_message("test7.c(main): Could not create task <JetControl> ...");
task_activate(shutdown_task_PID);
sys_end();
return 0;
}
 
523,7 → 466,7
p4 = task_create("MyDummyAper",(void *(*)(void*))mydummyaper,&m_aper,NULL);
if (p4 == -1) {
sys_shutdown_message("Could not create task <MyDummyAper> ...");
task_activate(shutdown_task_PID);
sys_end();
return 0;
}
 
530,7 → 473,7
p5 = task_create("MyDummyNRT",(void *(*)(void*))mydummynrt,&m_nrt,NULL);
if (p5 == -1) {
sys_shutdown_message("Could not create task <MyDummyNRT> ...");
task_activate(shutdown_task_PID);
sys_end();
return 0;
}