/demos/trunk/jumpball/rrn.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: rrn.c,v 1.5 2004-04-19 13:45:15 giacomo Exp $ |
CVS : $Id: rrn.c,v 1.4 2004-04-18 18:48:22 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.5 $ |
Last update: $Date: 2004-04-19 13:45:15 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2004-04-18 18:48:22 $ |
------------ |
**/ |
77,12 → 77,6 |
#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) |
104,38 → 98,18 |
return TICK; |
} |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
HARTPORT_init(); |
set_shutdown_task(); |
device_drivers_init(); |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
void set_shutdown_task() { |
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() { |
int res; |
169,43 → 143,55 |
} |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
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; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void set_shutdown_task() { |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
NRT_TASK_MODEL nrt; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
nrt_task_default_model(nrt); |
nrt_task_def_system(nrt); |
nrt_task_def_nokill(nrt); |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
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(); |
} |
} |
void call_shutdown_task(void *arg) { |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
device_drivers_close(); |
HARTPORT_init(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
set_shutdown_task(); |
sys_abort_shutdown(0); |
device_drivers_init(); |
return NULL; |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void app_mutex_init(mutex_t *m) |
/demos/trunk/jumpball/rrp.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: rrp.c,v 1.5 2004-04-19 13:45:15 giacomo Exp $ |
CVS : $Id: rrp.c,v 1.4 2004-04-18 18:48:22 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.5 $ |
Last update: $Date: 2004-04-19 13:45:15 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2004-04-18 18:48:22 $ |
------------ |
**/ |
77,12 → 77,6 |
#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) |
104,38 → 98,18 |
return TICK; |
} |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
HARTPORT_init(); |
set_shutdown_task(); |
device_drivers_init(); |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
void set_shutdown_task() { |
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() { |
int res; |
169,43 → 143,55 |
} |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
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; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void set_shutdown_task() { |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
NRT_TASK_MODEL nrt; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
nrt_task_default_model(nrt); |
nrt_task_def_system(nrt); |
nrt_task_def_nokill(nrt); |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
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(); |
} |
} |
void call_shutdown_task(void *arg) { |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
device_drivers_close(); |
HARTPORT_init(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
set_shutdown_task(); |
sys_abort_shutdown(0); |
device_drivers_init(); |
return NULL; |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void app_mutex_init(mutex_t *m) |
/demos/trunk/jumpball/ern.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: ern.c,v 1.5 2004-04-19 13:45:15 giacomo Exp $ |
CVS : $Id: ern.c,v 1.4 2004-04-18 18:48:22 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.5 $ |
Last update: $Date: 2004-04-19 13:45:15 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2004-04-18 18:48:22 $ |
------------ |
**/ |
78,12 → 78,6 |
#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) |
105,38 → 99,18 |
return TICK; |
} |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
HARTPORT_init(); |
set_shutdown_task(); |
device_drivers_init(); |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
void set_shutdown_task() { |
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() { |
int res; |
170,43 → 144,55 |
} |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
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; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void set_shutdown_task() { |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
NRT_TASK_MODEL nrt; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
nrt_task_default_model(nrt); |
nrt_task_def_system(nrt); |
nrt_task_def_nokill(nrt); |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
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(); |
} |
} |
void call_shutdown_task(void *arg) { |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
device_drivers_close(); |
HARTPORT_init(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
set_shutdown_task(); |
sys_abort_shutdown(0); |
device_drivers_init(); |
return NULL; |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void app_mutex_init(mutex_t *m) |
/demos/trunk/jumpball/ecp.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: ecp.c,v 1.5 2004-04-19 13:45:15 giacomo Exp $ |
CVS : $Id: ecp.c,v 1.4 2004-04-18 18:48:22 giacomo Exp $ |
File: $File$ |
Revision: $Revision: 1.5 $ |
Last update: $Date: 2004-04-19 13:45:15 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2004-04-18 18:48:22 $ |
------------ |
**/ |
77,12 → 77,6 |
#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) |
102,38 → 96,18 |
return TICK; |
} |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
HARTPORT_init(); |
set_shutdown_task(); |
device_drivers_init(); |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
KEYB26_close(); |
INPUT26_close(); |
return 0; |
} |
void set_shutdown_task() { |
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() { |
int res; |
167,43 → 141,56 |
} |
int device_drivers_close() { |
FB26_close(FRAME_BUFFER_DEVICE); |
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; |
} |
#define SHUTDOWN_TIMEOUT_SEC 3 |
void set_shutdown_task() { |
void call_shutdown_task(void *arg) |
{ |
struct timespec t; |
NRT_TASK_MODEL nrt; |
sys_gettime(&t); |
t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
nrt_task_default_model(nrt); |
nrt_task_def_system(nrt); |
nrt_task_def_nokill(nrt); |
/* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
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(); |
} |
} |
void call_shutdown_task(void *arg) { |
task_activate(shutdown_task_PID); |
} |
TASK shutdown_task_body(void *arg) { |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
device_drivers_close(); |
HARTPORT_init(); |
sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
set_shutdown_task(); |
sys_abort_shutdown(0); |
device_drivers_init(); |
return NULL; |
sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
__call_main__(mb); |
return (void *)0; |
} |
void app_mutex_init(mutex_t *m) |