From 6db93b34e8c56e93a4438cbbeabf28cf07dcd014 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 2 Aug 2015 06:34:11 +0300 Subject: [PATCH] artiq_personality: port to device. --- soc/runtime/artiq_personality.c | 9 +++++++++ soc/runtime/artiq_personality.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/soc/runtime/artiq_personality.c b/soc/runtime/artiq_personality.c index 9bf259474..9220c0e38 100644 --- a/soc/runtime/artiq_personality.c +++ b/soc/runtime/artiq_personality.c @@ -8,8 +8,14 @@ /* Logging */ #ifndef NDEBUG +#if defined(__or1k__) +#include "log.h" +#define EH_LOG0(fmt) log("%s: " fmt, __func__) +#define EH_LOG(fmt, ...) log("%s: " fmt, __func__, __VA_ARGS__) +#else #define EH_LOG0(fmt) fprintf(stderr, "%s: " fmt "\n", __func__) #define EH_LOG(fmt, ...) fprintf(stderr, "%s: " fmt "\n", __func__, __VA_ARGS__) +#endif #else #define EH_LOG0(fmt) #define EH_LOG(fmt, ...) @@ -312,6 +318,9 @@ static _Unwind_Reason_Code __artiq_uncaught_exception( } } +_Unwind_Reason_Code __artiq_personality( + int version, _Unwind_Action actions, uint64_t exceptionClass, + struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context); _Unwind_Reason_Code __artiq_personality( int version, _Unwind_Action actions, uint64_t exceptionClass, struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context) { diff --git a/soc/runtime/artiq_personality.h b/soc/runtime/artiq_personality.h index fec789d27..1952e7269 100644 --- a/soc/runtime/artiq_personality.h +++ b/soc/runtime/artiq_personality.h @@ -2,6 +2,7 @@ #define __ARTIQ_PERSONALITY_H #include +#include struct artiq_exception { union { @@ -27,7 +28,7 @@ extern "C" { /* Provided by the runtime */ void __artiq_raise(struct artiq_exception *artiq_exn) __attribute__((noreturn)); -void __artiq_reraise() +void __artiq_reraise(void) __attribute__((noreturn)); #define artiq_raise_from_c(exnname, exnmsg, exnparam0, exnparam1, exnparam2) \