X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=nesc.git;a=blobdiff_plain;f=src%2Fnesc-concurrency.c;h=910fff91853ee782f72785e952c1610ac55f7b8a;hp=3d33631a201a177813c2416b98e248f22415d4da;hb=7b54393e237ed8f23c0c74f0a6cbc8de26c5bf98;hpb=57d4530c4d6814fa25338a00cc65b95938c723b6 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 */