m68k.c (m68k_attribute_table): Add "interrupt".
authorKazu Hirata <kazu@codesourcery.com>
Sun, 3 Jun 2007 00:43:21 +0000 (00:43 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 3 Jun 2007 00:43:21 +0000 (00:43 +0000)
* config/m68k/m68k.c (m68k_attribute_table): Add "interrupt".
(m68k_get_function_kind): Return m68k_fk_interrupt_handler on
"interrupt".
* doc/extend.texi (interrupt): Mention m68k.

From-SVN: r125290

gcc/ChangeLog
gcc/config/m68k/m68k.c
gcc/doc/extend.texi

index 71bbf0d3d93a398c5707b70dc06cae70c235504a..3f671396097e7f176f712da224e437c2ef392a34 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-03  Kazu Hirata  <kazu@codesourcery.com>
+
+       * config/m68k/m68k.c (m68k_attribute_table): Add "interrupt".
+       (m68k_get_function_kind): Return m68k_fk_interrupt_handler on
+       "interrupt".
+       * doc/extend.texi (interrupt): Mention m68k.
+
 2007-06-02  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.c (ix86_expand_sse_4_operands_builtin): Call
index 87665596726f734cde3704f8d8b3aad19a3995fb..7001e294d1d03a4bfa1f64bb28d6bf33e29c83f3 100644 (file)
@@ -222,6 +222,7 @@ int m68k_last_compare_had_fp_operands;
 static const struct attribute_spec m68k_attribute_table[] =
 {
   /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  { "interrupt", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
   { "interrupt_handler", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
   { "interrupt_thread", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
   { NULL,                0, 0, false, false, false, NULL }
@@ -634,9 +635,10 @@ m68k_cpp_cpu_family (const char *prefix)
   return concat ("__m", prefix, "_family_", m68k_cpu_entry->family, NULL);
 }
 \f
-/* Return m68k_fk_interrupt_handler if FUNC has an "interrupt_handler"
-   attribute and interrupt_thread if FUNC has an "interrupt_thread"
-   attribute.  Otherwise, return m68k_fk_normal_function.  */
+/* Return m68k_fk_interrupt_handler if FUNC has an "interrupt" or
+   "interrupt_handler" attribute and interrupt_thread if FUNC has an
+   "interrupt_thread" attribute.  Otherwise, return
+   m68k_fk_normal_function.  */
 
 enum m68k_function_kind
 m68k_get_function_kind (tree func)
@@ -646,6 +648,10 @@ m68k_get_function_kind (tree func)
   if (TREE_CODE (func) != FUNCTION_DECL)
     return false;
 
+  a = lookup_attribute ("interrupt", DECL_ATTRIBUTES (func));
+  if (a != NULL_TREE)
+    return m68k_fk_interrupt_handler;
+
   a = lookup_attribute ("interrupt_handler", DECL_ATTRIBUTES (func));
   if (a != NULL_TREE)
     return m68k_fk_interrupt_handler;
index 4217eaadb486dbe446f42faa1ff43b39a560ad01..b652bff248dca79e636c45f0b6073dd2ece7ac3a 100644 (file)
@@ -2043,12 +2043,13 @@ This attribute is ignored for R8C target.
 
 @item interrupt
 @cindex interrupt handler functions
-Use this attribute on the ARM, AVR, C4x, CRX, M32C, M32R/D, MS1, and Xstormy16
-ports to indicate that the specified function is an interrupt handler.
-The compiler will generate function entry and exit sequences suitable
-for use in an interrupt handler when this attribute is present.
+Use this attribute on the ARM, AVR, C4x, CRX, M32C, M32R/D, m68k, MS1,
+and Xstormy16 ports to indicate that the specified function is an
+interrupt handler.  The compiler will generate function entry and exit
+sequences suitable for use in an interrupt handler when this attribute
+is present.
 
-Note, interrupt handlers for the Blackfin, m68k, H8/300, H8/300H, H8S, and
+Note, interrupt handlers for the Blackfin, H8/300, H8/300H, H8S, and
 SH processors can be specified via the @code{interrupt_handler} attribute.
 
 Note, on the AVR, interrupts will be enabled inside the function.