Yes, I did try it. The compiler issued a warning, "attribute directive ignored", and generated code as normal:
timer.c:27:1: warning: 'interrupt' attribute directive
ignored [-Wattributes]
void __attribute__ ((interrupt)) timer_isr() {
^~~~
Since I couldn't find any docs on RISC-V target attributes, I guessed that it would follow the MIPS interrupt attribute. If that's not the case, what should it be, and is it documented? Many thanks.
Cheers,
PA
Did you try compiling a function with and without the interrupt attribute to compare the generated assembly code?
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/b5d0fd66-ac6d-4440-b0fe-6880663c04b9%40groups.riscv.org.
-- Peter Ashenden, CTO IC Design, ASTC
Yes, I did try it. The compiler issued a warning, "attribute directive ignored", and generated code as normal:
timer.c:27:1: warning: 'interrupt' attribute directive ignored [-Wattributes]
void __attribute__ ((interrupt)) timer_isr() {
^~~~
Since I couldn't find any docs on RISC-V target attributes, I guessed that it would follow the MIPS interrupt attribute. If that's not the case, what should it be, and is it documented? Many thanks.
Thanks Bruce. I understand that's what the compiler must generate for an interrupt routine. My question is whether it's implemented in RISC-V gcc yet or not.
Cheers,
PA