Commit 126b11c6 by Chung-Ju Wu Committed by Chung-Ju Wu

[NDS32] Add a function to indentify if FUNC is an interrupt service routine.

	* config/nds32/nds32-isr.c (nds32_isr_function_p): Define new function
	to check if FUNC is an interrupt service routine.
	* config/nds32/nds32-protos.h (nds32_isr_function_p): Declaration.

From-SVN: r214855
parent dd1536a7
2014-09-03 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32-isr.c (nds32_isr_function_p): Define new function
to check if FUNC is an interrupt service routine.
* config/nds32/nds32-protos.h (nds32_isr_function_p): Declaration.
2014-09-03 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.h (machine_function): Add some fields for variadic
arguments implementation.
......@@ -574,4 +574,28 @@ nds32_asm_file_end_for_isr (void)
}
}
/* Return true if FUNC is a isr function. */
bool
nds32_isr_function_p (tree func)
{
tree t_intr;
tree t_excp;
tree t_reset;
tree attrs;
if (TREE_CODE (func) != FUNCTION_DECL)
abort ();
attrs = DECL_ATTRIBUTES (func);
t_intr = lookup_attribute ("interrupt", attrs);
t_excp = lookup_attribute ("exception", attrs);
t_reset = lookup_attribute ("reset", attrs);
return ((t_intr != NULL_TREE)
|| (t_excp != NULL_TREE)
|| (t_reset != NULL_TREE));
}
/* ------------------------------------------------------------------------ */
......@@ -136,6 +136,7 @@ extern void nds32_check_isr_attrs_conflict (tree, tree);
extern void nds32_construct_isr_vectors_information (tree, const char *);
extern void nds32_asm_file_start_for_isr (void);
extern void nds32_asm_file_end_for_isr (void);
extern bool nds32_isr_function_p (tree);
/* Auxiliary functions for cost calculation. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment