From 2bccb817ce335a130252ceabd55524ce1b5ffa93 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 3 Jun 2007 00:43:21 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/m68k/m68k.c | 12 +++++++++--- gcc/doc/extend.texi | 11 ++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71bbf0d3d93..3f671396097 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-06-03 Kazu Hirata + + * 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 * 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 87665596726..7001e294d1d 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 4217eaadb48..b652bff248d 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.