/demos/trunk/base/aster6.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster6.c,v 1.4 2004-04-17 11:36:12 giacomo Exp $ |
* CVS : $Id: aster6.c,v 1.5 2004-04-21 14:55:05 giacomo Exp $ |
this is a part of the classic Hartik demo Aster. |
47,8 → 47,6 |
#include "modules/edf.h" |
#include "modules/cbs.h" |
#include <drivers/shark_linuxc26.h> |
#include <drivers/shark_input26.h> |
#include <drivers/shark_keyb26.h> |
int num_aster = 0; |
87,60 → 85,6 |
#define ASTER_WCET 2000 /* 200*/ |
#endif |
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; |
332,8 → 276,8 |
while(1) { |
mutex_lock(&m1); |
printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster); |
printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0)); |
printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(2)); |
printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(1)); |
printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(3)); |
mutex_unlock(&m1); |
345,8 → 289,8 |
} |
mutex_lock(&m1); |
printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster); |
printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0)); |
printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(2)); |
printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(1)); |
printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(3)); |
mutex_unlock(&m1); |
task_endcycle(); |
} |
377,7 → 321,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 == 2) |
if (proc_table[p].task_level == 3) |
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]); |
393,7 → 337,9 |
void fine(KEY_EVT *e) |
{ |
task_activate(shutdown_task_PID); |
sys_end(); |
} |
int main(int argc, char **argv) |
406,10 → 352,6 |
// int i; |
struct timespec fineprg; |
set_shutdown_task(); |
device_drivers_init(); |
#ifdef PIMUTEX |
PI_mutexattr_t a; |
#endif |
458,7 → 400,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; |
} |
467,7 → 409,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; |
} |
475,7 → 417,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; |
} |
495,7 → 437,7 |
mutex_init(&m1, &a); |
fineprg.tv_sec = 1800; |
fineprg.tv_sec = 20; |
fineprg.tv_nsec = 0; |
kern_event_post(&fineprg,(void (*)(void *))fine,NULL); |
group_activate(1); |
/demos/trunk/base/aster7.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster7.c,v 1.3 2004-04-17 11:36:12 giacomo Exp $ |
* CVS : $Id: aster7.c,v 1.4 2004-04-21 14:55:05 giacomo Exp $ |
this is a part of the classic Hartik demo Aster. |
74,60 → 74,6 |
PID aper_table[APER_MAX]; |
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; |
237,7 → 183,7 |
while(1) { |
printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster); |
printf_xy(62,2,WHITE,"U=%12u",EDF_usedbandwidth(0)); |
printf_xy(62,2,WHITE,"U=%12u",EDF_usedbandwidth(1)); |
task_endcycle(); |
if (++s > 59) { |
245,7 → 191,7 |
m++; |
} |
printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster); |
printf_xy(62,2,WHITE,"U=%12u",EDF_usedbandwidth(0)); |
printf_xy(62,2,WHITE,"U=%12u",EDF_usedbandwidth(1)); |
task_endcycle(); |
} |
} |
285,7 → 231,7 |
void fine(KEY_EVT *e) |
{ |
task_activate(shutdown_task_PID); |
sys_end(); |
} |
297,10 → 243,6 |
SOFT_TASK_MODEL m_aper; |
int i; |
set_shutdown_task(); |
device_drivers_init(); |
KEY_EVT emerg; |
clear(); |
327,7 → 269,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; |
} |
336,19 → 278,19 |
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; |
} |
soft_task_default_model(m_aper); |
soft_task_def_ctrl_jet(m_aper); |
soft_task_def_level(m_aper, 1); |
soft_task_def_level(m_aper, 2); |
soft_task_def_group(m_aper,1); |
soft_task_def_aperiodic(m_aper); |
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; |
} |
357,12 → 299,12 |
soft_task_def_aperiodic(m_aper); |
for (i=0; i<APER_MAX; i++) { |
soft_task_def_level(m_aper, i/4 + 3); |
soft_task_def_level(m_aper, i/4 + 4); |
soft_task_def_arg(m_aper, (void *)(i/4 ? 'Û' : '±')); |
aper_table[i] = task_create("aper",aper_asteroid,&m_aper,NULL); |
if (aper_table[i] == -1) { |
sys_shutdown_message("test7.c(main): Could not create task <aper> ..."); |
task_activate(shutdown_task_PID); |
sys_end(); |
return 0; |
} |
} |
/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; |
} |
/demos/trunk/base/iaster6.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: iaster6.c,v 1.2 2004-04-17 11:36:13 giacomo Exp $ |
CVS : $Id: iaster6.c,v 1.3 2004-04-21 14:55:05 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-17 11:36:13 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2004-04-21 14:55:05 $ |
------------ |
System initialization file |
85,6 → 85,10 |
#include "modules/npp.h" |
#include "modules/nop.h" |
#include <drivers/shark_linuxc26.h> |
#include <drivers/shark_input26.h> |
#include <drivers/shark_keyb26.h> |
/*+ sysyem tick in us +*/ |
#define TICK 1000 |
96,6 → 100,14 |
#define INTDRIVE_T 10000 |
#define INTDRIVE_FLAG 0 |
void call_shutdown_task(void *arg); |
int device_drivers_init(); |
int device_drivers_close(); |
void set_shutdown_task(); |
TASK shutdown_task_body(void *arg); |
PID shutdown_task_PID = 1; |
TIME __kernel_register_levels__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
126,8 → 138,89 |
HARTPORT_init(); |
/* Create the shutdown task. It will be activated at RUNLEVEL |
SHUTDOWN */ |
set_shutdown_task(); |
/* Init the drivers */ |
device_drivers_init(); |
/* Set the shutdown task activation */ |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void set_shutdown_task() { |
/* WARNING: the shutdown task is a background thread. It cannot execute |
if the system is overloaded */ |
NRT_TASK_MODEL nrt; |
nrt_task_default_model(nrt); |
nrt_task_def_system(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(); |
} |
} |
int device_drivers_init() { |
KEYB_PARMS kparms = BASE_KEYB; |
LINUXC26_register_module(); |
INPUT26_init(); |
keyb_def_ctrlC(kparms, NULL); |
KEYB26_init(&kparms); |
return 0; |
} |
int device_drivers_close() { |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
device_drivers_close(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
sys_abort_shutdown(0); |
return NULL; |
} |
/demos/trunk/base/iaster7.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: iaster7.c,v 1.2 2004-04-17 11:36:13 giacomo Exp $ |
CVS : $Id: iaster7.c,v 1.3 2004-04-21 14:55:06 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-17 11:36:13 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2004-04-21 14:55:06 $ |
------------ |
System initialization file |
78,6 → 78,10 |
#include "modules/sem.h" |
#include "modules/hartport.h" |
#include <drivers/shark_linuxc26.h> |
#include <drivers/shark_input26.h> |
#include <drivers/shark_keyb26.h> |
/*+ sysyem tick in us +*/ |
#define TICK 0 |
88,6 → 92,14 |
#define INTDRIVE_T 10000 |
#define INTDRIVE_FLAG 0 |
void call_shutdown_task(void *arg); |
int device_drivers_init(); |
int device_drivers_close(); |
void set_shutdown_task(); |
TASK shutdown_task_body(void *arg); |
PID shutdown_task_PID = 1; |
TIME __kernel_register_levels__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
112,8 → 124,91 |
HARTPORT_init(); |
/* Create the shutdown task. It will be activated at RUNLEVEL |
SHUTDOWN */ |
set_shutdown_task(); |
/* Init the drivers */ |
device_drivers_init(); |
/* Set the shutdown task activation */ |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void set_shutdown_task() { |
/* WARNING: the shutdown task is a background thread. It cannot execute |
if the system is overloaded */ |
NRT_TASK_MODEL nrt; |
nrt_task_default_model(nrt); |
nrt_task_def_system(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(); |
} |
} |
int device_drivers_init() { |
KEYB_PARMS kparms = BASE_KEYB; |
LINUXC26_register_module(); |
INPUT26_init(); |
keyb_def_ctrlC(kparms, NULL); |
KEYB26_init(&kparms); |
return 0; |
} |
int device_drivers_close() { |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
device_drivers_close(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
sys_abort_shutdown(0); |
return NULL; |
} |
/demos/trunk/base/iaster8.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: iaster8.c,v 1.2 2004-04-17 11:36:13 giacomo Exp $ |
CVS : $Id: iaster8.c,v 1.3 2004-04-21 14:55:06 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-17 11:36:13 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2004-04-21 14:55:06 $ |
------------ |
System initialization file |
85,6 → 85,10 |
#include "modules/npp.h" |
#include "modules/nop.h" |
#include <drivers/shark_linuxc26.h> |
#include <drivers/shark_input26.h> |
#include <drivers/shark_keyb26.h> |
/*+ system tick in us +*/ |
#define TICK 1000 |
96,6 → 100,14 |
#define INTDRIVE_T 10000 |
#define INTDRIVE_FLAG 0 |
void call_shutdown_task(void *arg); |
int device_drivers_init(); |
int device_drivers_close(); |
void set_shutdown_task(); |
TASK shutdown_task_body(void *arg); |
PID shutdown_task_PID = 1; |
TIME __kernel_register_levels__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
102,8 → 114,8 |
INTDRIVE_register_level(INTDRIVE_Q,INTDRIVE_T,INTDRIVE_FLAG); |
EDF_register_level(EDF_ENABLE_ALL); |
CBS_register_level(CBS_ENABLE_ALL, 0); |
SS_register_level(SS_ENABLE_GUARANTEE_EDF,0,5000,20000); |
CBS_register_level(CBS_ENABLE_ALL, 1); |
SS_register_level(SS_ENABLE_GUARANTEE_EDF,1,5000,20000); |
RR_register_level(RRTICK, RR_MAIN_YES, mb); |
dummy_register_level(); |
125,9 → 137,92 |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
HARTPORT_init(); |
/* Create the shutdown task. It will be activated at RUNLEVEL |
SHUTDOWN */ |
set_shutdown_task(); |
/* Init the drivers */ |
device_drivers_init(); |
/* Set the shutdown task activation */ |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void set_shutdown_task() { |
/* WARNING: the shutdown task is a background thread. It cannot execute |
if the system is overloaded */ |
NRT_TASK_MODEL nrt; |
nrt_task_default_model(nrt); |
nrt_task_def_system(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(); |
} |
} |
int device_drivers_init() { |
KEYB_PARMS kparms = BASE_KEYB; |
LINUXC26_register_module(); |
INPUT26_init(); |
keyb_def_ctrlC(kparms, NULL); |
KEYB26_init(&kparms); |
return 0; |
} |
int device_drivers_close() { |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
device_drivers_close(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
sys_abort_shutdown(0); |
return NULL; |
} |
/demos/trunk/base/pcidemo.c |
---|
40,8 → 40,6 |
sleep(5); |
sys_end(); |
return 0; |
} |