Skip to content

Commit 1afdb21

Browse files
committed
Add rnmi interrupt mode
A new interrupt attribute mode has been added: `rnmi`. The `rnmi` mode (resumable non-maskable interrupt) can be used with the `Smrnmi` extension. Spec: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/rnmi.adoc Signed-off-by: Gergely Futo <[email protected]>
1 parent 3fb949c commit 1afdb21

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/c-api.adoc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ This attribute is incompatible with the `interrupt` attribute.
183183
NOTE: Be aware that compilers might have further restrictions on naked
184184
functions. Please consult your compiler's manual for more information.
185185

186-
=== `+__attribute__((interrupt))+`, `+__attribute__((interrupt("supervisor")))+`, `+__attribute__((interrupt("machine")))+`
186+
=== `+__attribute__((interrupt))+`, `+__attribute__((interrupt("supervisor")))+`, `+__attribute__((interrupt("machine")))+`, `+__attribute__((interrupt("rnmi")))+`
187187

188188
The interrupt attribute specifies that a function is an interrupt handler.
189189
The compiler will save/restore all used registers in the prologue/epilogue
@@ -193,12 +193,18 @@ V CSRs may be modified by an interrupt function, they must be saved by the
193193
compiler.
194194

195195
The interrupt attribute can have optional parameters to specify the mode.
196-
The possible values are `supervisor`, or `machine`, or vendor-specific values.
196+
The possible values are `supervisor`, `machine`, `rnmi` (`Smrnmi` extension) or
197+
vendor-specific values.
197198
The default value `machine` is used, if the mode is not specified.
198199

199-
The compiler should raise an error if a function declares incompatible modes, or
200-
an undefined mode. The `supervisor` mode is incompatible with the `machine`
201-
mode.
200+
The `rnmi` mode (resumable non-maskable interrupt) can be used only with
201+
the `Smrnmi` extension.
202+
203+
The compiler should raise an error if a function declares incompatible,
204+
unavailable (e.g. `rnmi` mode is only available with the `Smrnmi` extension) or
205+
undefined modes. The modes are incompatible with each other, i.e. the attribute
206+
should be used either without the mode specified, or with only one of the
207+
modes specified.
202208

203209
This attribute is incompatible with the `naked` attribute.
204210

0 commit comments

Comments
 (0)