diff options
author | Jim Wilson <jimw@sifive.com> | 2018-06-06 19:08:36 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2018-06-06 12:08:36 -0700 |
commit | ec74725ce3ed5c96783b76992940d99563c82a47 (patch) | |
tree | 655961162cdfc53ad9be35b0f98b4fa69610333d /gcc/doc/extend.texi | |
parent | 1b58c736db9d28975f596f5175c9f9470723c166 (diff) | |
download | gcc-ec74725ce3ed5c96783b76992940d99563c82a47.zip gcc-ec74725ce3ed5c96783b76992940d99563c82a47.tar.gz gcc-ec74725ce3ed5c96783b76992940d99563c82a47.tar.bz2 |
RISC-V: Add interrupt attribute modes.
gcc/
* config/riscv/riscv.c (enum riscv_privilege_levels): New.
(struct machine_function): New field interrupt_mode.
(riscv_handle_type_attribute): New function. Add forward declaration.
(riscv_attribute_table) <interrupt>: Use riscv_handle_type_attribute.
(riscv_expand_epilogue): Check interrupt_mode field.
(riscv_set_current_function): Check interrupt attribute args and
set interrupt_mode field.
* config/riscv/riscv.md (UNSPECV_SRET, UNSPECV_URET): New.
(riscv_sret, riscv_uret): New.
* doc/extend.texi (RISC-V Function Attributes) <interrupt>: Document
new arguments to interrupt attribute.
gcc/testsuite/
* gcc.target/riscv/interrupt-5.c (sub3): Add new test.
* gcc.target/riscv/interrupt-mmode.c: New.
* gcc.target/riscv/interrupt-smode.c: New.
* gcc.target/riscv/interrupt-umode.c: New.
From-SVN: r261244
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e9db1b2..0c1c1b1 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -5147,6 +5147,17 @@ depended upon to work reliably and are not supported. 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. + +You can specify the kind of interrupt to be handled by adding an optional +parameter to the interrupt attribute like this: + +@smallexample +void f (void) __attribute__ ((interrupt ("user"))); +@end smallexample + +Permissible values for this parameter are @code{user}, @code{supervisor}, +and @code{machine}. If there is no parameter, then it defaults to +@code{machine}. @end table @node RL78 Function Attributes |