2015-04-04 22:08:32 +08:00
|
|
|
#include "kernelcpu.h"
|
|
|
|
#include "exceptions.h"
|
|
|
|
#include "comm.h"
|
|
|
|
#include "rtio.h"
|
|
|
|
#include "dds.h"
|
|
|
|
|
2015-04-03 17:44:56 +08:00
|
|
|
void exception_handler(unsigned long vect, unsigned long *sp);
|
|
|
|
void exception_handler(unsigned long vect, unsigned long *sp)
|
|
|
|
{
|
|
|
|
/* TODO: report hardware exception to comm CPU */
|
|
|
|
for(;;);
|
|
|
|
}
|
|
|
|
|
2015-04-04 22:08:32 +08:00
|
|
|
typedef void (*kernel_function)(void);
|
2015-04-03 17:44:56 +08:00
|
|
|
|
|
|
|
int main(void);
|
|
|
|
int main(void)
|
|
|
|
{
|
2015-04-04 22:08:32 +08:00
|
|
|
kernel_function k;
|
|
|
|
void *jb;
|
|
|
|
|
|
|
|
k = (kernel_function)KERNELCPU_MAILBOX;
|
|
|
|
|
|
|
|
jb = exception_push();
|
|
|
|
if(exception_setjmp(jb))
|
|
|
|
KERNELCPU_MAILBOX = KERNEL_RUN_EXCEPTION;
|
|
|
|
else {
|
|
|
|
dds_init();
|
|
|
|
rtio_init();
|
|
|
|
k();
|
|
|
|
exception_pop(1);
|
|
|
|
KERNELCPU_MAILBOX = KERNEL_RUN_FINISHED;
|
|
|
|
}
|
|
|
|
while(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int comm_rpc(int rpc_num, ...);
|
|
|
|
int comm_rpc(int rpc_num, ...)
|
|
|
|
{
|
|
|
|
/* TODO */
|
2015-04-03 17:44:56 +08:00
|
|
|
return 0;
|
|
|
|
}
|