Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/c-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ This attribute is incompatible with the `interrupt` attribute.
NOTE: Be aware that compilers might have further restrictions on naked
functions. Please consult your compiler's manual for more information.

=== `+__attribute__((interrupt))+`, `+__attribute__((interrupt("user")))+`, `+__attribute__((interrupt("supervisor")))+`, `+__attribute__((interrupt("machine")))+`
=== `+__attribute__((interrupt))+`, `+__attribute__((interrupt("supervisor")))+`, `+__attribute__((interrupt("machine")))+`

The interrupt attribute specifies that a function is an interrupt handler.
The compiler will save/restore all used registers in the prologue/epilogue
Expand All @@ -192,12 +192,13 @@ register/vector register if `F` extension/vector extension is enabled. If F or
V CSRs may be modified by an interrupt function, they must be saved by the
compiler.

The interrupt attribute can have an optional parameter to specify the mode.
The possible values are `user`, `supervisor`, or `machine`.
The interrupt attribute can have optional parameters to specify the mode.
The possible values are `supervisor`, or `machine`, or vendor-specific values.
The default value `machine` is used, if the mode is not specified.

The function can specify only one mode; the compiler should raise an error if a
function declares more than one mode or an undefined mode.
The compiler should raise an error if a function declares incompatible modes, or
an undefined mode. The `supervisor` mode is incompatible with the `machine`
mode.

This attribute is incompatible with the `naked` attribute.

Expand Down
Loading