Skip to content

Commit

Permalink
artiq_personality: port to device.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Aug 2, 2015
1 parent aae2923 commit 6db93b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions soc/runtime/artiq_personality.c
Expand Up @@ -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, ...)
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion soc/runtime/artiq_personality.h
Expand Up @@ -2,6 +2,7 @@
#define __ARTIQ_PERSONALITY_H

#include <stdint.h>
#include <stddef.h>

struct artiq_exception {
union {
Expand All @@ -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) \
Expand Down

0 comments on commit 6db93b3

Please sign in to comment.