aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2007-06-03 00:43:21 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2007-06-03 00:43:21 +0000
commit2bccb817ce335a130252ceabd55524ce1b5ffa93 (patch)
tree9d08f042bc977b44fd461ebd592fa70987105930
parent097dbf654dde503a0d2a7e1ae3974291a4161d33 (diff)
downloadgcc-2bccb817ce335a130252ceabd55524ce1b5ffa93.zip
gcc-2bccb817ce335a130252ceabd55524ce1b5ffa93.tar.gz
gcc-2bccb817ce335a130252ceabd55524ce1b5ffa93.tar.bz2
m68k.c (m68k_attribute_table): Add "interrupt".
* 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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/m68k/m68k.c12
-rw-r--r--gcc/doc/extend.texi11
3 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71bbf0d..3f67139 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 8766559..7001e29 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -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);
}
-/* 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;
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 4217eaa..b652bff 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -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.