forked from M-Labs/artiq
soc/runtime: provide exception handling services
This commit is contained in:
parent
b37ceb328f
commit
ec7a92983d
|
@ -5,6 +5,7 @@
|
|||
#include "gpio.h"
|
||||
#include "rtio.h"
|
||||
#include "dds.h"
|
||||
#include "exceptions.h"
|
||||
#include "services.h"
|
||||
|
||||
static const struct symbol syscalls[] = {
|
||||
|
@ -19,6 +20,14 @@ static const struct symbol syscalls[] = {
|
|||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static const struct symbol eh[] = {
|
||||
{"push", exception_push},
|
||||
{"pop", exception_pop},
|
||||
{"getid", exception_getid},
|
||||
{"raise", exception_raise},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-int"
|
||||
extern __divsi3, __modsi3, __ledf2, __gedf2, __unorddf2, __eqdf2, __ltdf2,
|
||||
|
@ -80,5 +89,7 @@ void *resolve_service_symbol(const char *name)
|
|||
name += 2;
|
||||
if(strncmp(name, "syscall_", 8) == 0)
|
||||
return find_symbol(syscalls, name + 8);
|
||||
if(strncmp(name, "eh_", 3) == 0)
|
||||
return find_symbol(eh, name + 3);
|
||||
return find_symbol(compiler_rt, name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue