Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1381 → Rev 1382

/demos/trunk/base/pcidemo.c
33,66 → 33,14
#include "kernel/kern.h"
#include "unistd.h"
 
#include "drivers/shark_linuxc26.h"
#include "drivers/shark_pci26.h"
 
PID shutdown_task_PID;
 
int device_drivers_init() {
LINUXC26_register_module();
PCI26_init();
 
return 0;
}
 
int device_drivers_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();
}
 
}
 
 
int main (int argc, char *argv[])
{
 
set_shutdown_task();
 
device_drivers_init();
 
cprintf("Init Done...\n");
 
sleep(5);
task_activate(shutdown_task_PID);
sys_end();
return 0;