From ec7a92983ddcb78a07f0d182097508cc55c4d883 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 22 Sep 2014 13:19:26 +0800 Subject: [PATCH] soc/runtime: provide exception handling services --- soc/runtime/services.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/soc/runtime/services.c b/soc/runtime/services.c index b306f4578..7d6fd5bab 100644 --- a/soc/runtime/services.c +++ b/soc/runtime/services.c @@ -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); }