]> oss.titaniummirror.com Git - nesc.git/blobdiff - src/nesc-concurrency.c
Merge branch 'upstream' (nesc-1.3.2)
[nesc.git] / src / nesc-concurrency.c
index 3d33631a201a177813c2416b98e248f22415d4da..910fff91853ee782f72785e952c1610ac55f7b8a 100644 (file)
@@ -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 */