X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=nesc.git;a=blobdiff_plain;f=src%2Fnesc-concurrency.c;fp=src%2Fnesc-concurrency.c;h=910fff91853ee782f72785e952c1610ac55f7b8a;hp=3d33631a201a177813c2416b98e248f22415d4da;hb=afe799e7802f38d1f55e1bd2044451ba164743b1;hpb=38be457fa32d3ab0721ec1fc9e5086b745e17468 diff --git a/src/nesc-concurrency.c b/src/nesc-concurrency.c index 3d33631..910fff9 100644 --- a/src/nesc-concurrency.c +++ b/src/nesc-concurrency.c @@ -19,6 +19,8 @@ Boston, MA 02111-1307, USA. */ #include "nesc-cg.h" #include "nesc-concurrency.h" #include "nesc-semantics.h" +#include "machine.h" +#include "c-parse.h" static inline bool is_call_edge(gedge e) { @@ -36,6 +38,19 @@ static void rec_async(gnode n, bool async_caller) return; fn->actual_async = async; + /* Martin Leopold: add an "async" gcc attribute to any async elements for targets + that need to identify functions callable from interrupts. */ + if (fn->definition && target->async_functions_atribute) + { + function_decl fd = CAST(function_decl, fn->definition); + location l = fd->modifiers->location; + region r = parse_region; + word aname = new_word(r, l, str2cstring(r, target->async_functions_atribute)); + target_attribute attr = new_target_attribute(r, l, aname, NULL); + + fd->attributes = attribute_chain(attr, fd->attributes); + } + /* We don't pass async through commands or events that are not declared async to avoid reporting errors for the fns called by the "async but not so declared" command or event */