aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-05-25 22:29:17 +0000
committerJim Wilson <wilson@gcc.gnu.org>2018-05-25 15:29:17 -0700
commitd0ebdd9fce00f5fbfec615d72f1dedf0cd7762a6 (patch)
treefd44a708cc3f3ebbd9eab6e79f8573f972a67663 /gcc/doc
parentc0e8f02b27afc1a07f30a7597f8ae34094821f9d (diff)
downloadgcc-d0ebdd9fce00f5fbfec615d72f1dedf0cd7762a6.zip
gcc-d0ebdd9fce00f5fbfec615d72f1dedf0cd7762a6.tar.gz
gcc-d0ebdd9fce00f5fbfec615d72f1dedf0cd7762a6.tar.bz2
RISC-V: Add interrupt attribute support.
gcc/ * config/riscv/riscv-protos.h (riscv_epilogue_uses): New. * config/riscv/riscv.c (struct machine_function): Add interrupt_handler_p and attribute_checked_p fields. (riscv_attribute_table): Add interrupt. (riscv_interrupt_type_p): New. (riscv_save_reg_p): Save extra regs for interrupt handler. (riscv_use_save_libcall): Return false for interrupt handler. (riscv_first_stack_step): Add forward declaration. (riscv_compute_frame_info): New local interrupt_save_t1. Set it for interrupt handler with large frame. Use it for saved reg list. (riscv_expand_prologue): Move flag_stack_usage_info support to eliminate duplication. (riscv_expand_epilogue): Generate mret for interrupt handler. (riscv_epilogue_uses): New. (riscv_can_use_return_insn): Return false for interrupt handler. (riscv_function_ok_for_sibcall): Likewise. (riscv_set_current_function): Add interrupt handler support. * config/riscv/riscv.h (EPILOGUE_USES): Call riscv_epilogue_uses. * config/riscv/riscv.md (UNSPECV_MRET): New. (GP_REGNUM): New. (riscv_frflags, riscv_fsflags): Use tab after opcode. (riscv_mret): New. * doc/extend.texi (RISC-V Function Attributes) <interrupt>: New. gcc/testsuite/ * gcc.target/riscv/interrupt-1.c: New. * gcc.target/riscv/interrupt-2.c: New. * gcc.target/riscv/interrupt-3.c: New. * gcc.target/riscv/interrupt-4.c: New. * gcc.target/riscv/interrupt-5.c: New. From-SVN: r260785
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 942548f..c6d23b5 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -5141,6 +5141,12 @@ prologue/epilogue sequences generated by the compiler. Only basic
(@pxref{Basic Asm}). While using extended @code{asm} or a mixture of
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
+
+@item interrupt
+@cindex @code{interrupt} function attribute, RISC-V
+Use this attribute to indicate that the specified function is an interrupt
+handler. The compiler generates function entry and exit sequences suitable
+for use in an interrupt handler when this attribute is present.
@end table
@node RL78 Function Attributes