Is there an attribute I can use to make a function as an interrupt handler ?

120 views
Skip to first unread message

Karim Hasebou

unread,
Jan 5, 2018, 10:36:00 AM1/5/18
to RISC-V SW Dev
I am porting an RTOS for RISC - V32 and when I writing a macro for interrupt handling I tried using the naked attribute to stop gcc from generating any code in that method but the compiler issued a warning attribute ignored. 
So is their an alternative attribute I can use ?

Karim Hasebou

unread,
Jan 5, 2018, 10:38:20 AM1/5/18
to RISC-V SW Dev
As in am looking for a way to stop the compiler from generating prolog and epilog code code

Jim Wilson

unread,
Jan 5, 2018, 11:13:38 AM1/5/18
to Karim Hasebou, RISC-V SW Dev
On Fri, Jan 5, 2018 at 7:38 AM, Karim Hasebou <karim....@gmail.com> wrote:
> As in am looking for a way to stop the compiler from generating prolog and
> epilog code code

See
https://github.com/riscv/riscv-gcc/pull/117

It will probably end up on the riscv-next branch within a week, and
then in the FSF GCC tree for the gcc-8 release in the spring.

See also the issue you opened
https://github.com/riscv/riscv-gnu-toolchain/issues/313
which has a pointer to the above patch.

Jim

Hesham Almatary

unread,
Jan 5, 2018, 7:06:18 PM1/5/18
to Karim Hasebou, RISC-V SW Dev
On Sat, 6 Jan 2018 at 2:38 am, Karim Hasebou <karim....@gmail.com> wrote:
As in am looking for a way to stop the compiler from generating prolog and epilog code code
If you don’t wanna wait, you can also use __attribute__((optimize("O3"))) or #pragma GCC optimize (3).

On Friday, January 5, 2018 at 5:36:00 PM UTC+2, Karim Hasebou wrote:
I am porting an RTOS for RISC - V32 and when I writing a macro for interrupt handling I tried using the naked attribute to stop gcc from generating any code in that method but the compiler issued a warning attribute ignored. 
So is their an alternative attribute I can use ?

--
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/13edfd08-a64c-4d6a-8f1c-be5cc3fd69e9%40groups.riscv.org.
--
Hesham
Reply all
Reply to author
Forward
0 new messages