forked from M-Labs/artiq
1
0
Fork 0

artiq_personality: port to device.

This commit is contained in:
whitequark 2015-08-02 06:34:11 +03:00
parent aae2923c4c
commit 6db93b34e8
2 changed files with 11 additions and 1 deletions

View File

@ -8,8 +8,14 @@
/* Logging */ /* Logging */
#ifndef NDEBUG #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_LOG0(fmt) fprintf(stderr, "%s: " fmt "\n", __func__)
#define EH_LOG(fmt, ...) fprintf(stderr, "%s: " fmt "\n", __func__, __VA_ARGS__) #define EH_LOG(fmt, ...) fprintf(stderr, "%s: " fmt "\n", __func__, __VA_ARGS__)
#endif
#else #else
#define EH_LOG0(fmt) #define EH_LOG0(fmt)
#define EH_LOG(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( _Unwind_Reason_Code __artiq_personality(
int version, _Unwind_Action actions, uint64_t exceptionClass, int version, _Unwind_Action actions, uint64_t exceptionClass,
struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context) { struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context) {

View File

@ -2,6 +2,7 @@
#define __ARTIQ_PERSONALITY_H #define __ARTIQ_PERSONALITY_H
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
struct artiq_exception { struct artiq_exception {
union { union {
@ -27,7 +28,7 @@ extern "C" {
/* Provided by the runtime */ /* Provided by the runtime */
void __artiq_raise(struct artiq_exception *artiq_exn) void __artiq_raise(struct artiq_exception *artiq_exn)
__attribute__((noreturn)); __attribute__((noreturn));
void __artiq_reraise() void __artiq_reraise(void)
__attribute__((noreturn)); __attribute__((noreturn));
#define artiq_raise_from_c(exnname, exnmsg, exnparam0, exnparam1, exnparam2) \ #define artiq_raise_from_c(exnname, exnmsg, exnparam0, exnparam1, exnparam2) \