forked from M-Labs/artiq
1
0
Fork 0

soc/runtime: provide exception handling services

This commit is contained in:
Sebastien Bourdeauducq 2014-09-22 13:19:26 +08:00
parent b37ceb328f
commit ec7a92983d
1 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "gpio.h" #include "gpio.h"
#include "rtio.h" #include "rtio.h"
#include "dds.h" #include "dds.h"
#include "exceptions.h"
#include "services.h" #include "services.h"
static const struct symbol syscalls[] = { static const struct symbol syscalls[] = {
@ -19,6 +20,14 @@ static const struct symbol syscalls[] = {
{NULL, NULL} {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 push
#pragma GCC diagnostic ignored "-Wimplicit-int" #pragma GCC diagnostic ignored "-Wimplicit-int"
extern __divsi3, __modsi3, __ledf2, __gedf2, __unorddf2, __eqdf2, __ltdf2, extern __divsi3, __modsi3, __ledf2, __gedf2, __unorddf2, __eqdf2, __ltdf2,
@ -80,5 +89,7 @@ void *resolve_service_symbol(const char *name)
name += 2; name += 2;
if(strncmp(name, "syscall_", 8) == 0) if(strncmp(name, "syscall_", 8) == 0)
return find_symbol(syscalls, name + 8); return find_symbol(syscalls, name + 8);
if(strncmp(name, "eh_", 3) == 0)
return find_symbol(eh, name + 3);
return find_symbol(compiler_rt, name); return find_symbol(compiler_rt, name);
} }