Skip to content

Commit

Permalink
Add artiq_raise_from_c macro.
Browse files Browse the repository at this point in the history
whitequark committed Jul 27, 2015
1 parent edffb40 commit 244ace1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions soc/runtime/artiq_personality.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,19 @@ void __artiq_raise(struct artiq_exception *artiq_exn)
void __artiq_reraise()
__attribute__((noreturn));

#define artiq_raise_from_c(exnname, exnmsg, exnparam0, exnparam1, exnparam2) \
do { \
struct artiq_exception exn = { \
.name = exnname, \
.message = exnmsg, \
.param = { exnparam0, exnparam1, exnparam2 }, \
.file = __FILE__, \
.line = __LINE__, \
.column = 0 \
}; \
__artiq_raise(&exn); \
} while(0)

/* Called by the runtime */
void __artiq_terminate(struct artiq_exception *artiq_exn,
struct artiq_backtrace_item *backtrace,

0 comments on commit 244ace1

Please sign in to comment.