Skip to content

Commit 18bfdfe

Browse files
Save CSRs in interrupt functions
Link: https://inbox.sourceware.org/gcc-patches/20230613064126.1323-1-jinma@linux.alibaba.com/ Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent c637e63 commit 18bfdfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

riscv-c-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ functions. Please consult your compiler's manual for more information.
180180
The interrupt attribute specifies that a function is an interrupt handler.
181181
The compiler will save/restore all used registers in the prologue/epilogue
182182
regardless of the ABI, all used registers including floating point
183-
register/vector register if `F` extension/vector extension is enabled.
183+
register/vector register if `F` extension/vector extension is enabled. If F or
184+
V CSRs may be modified by an interrupt function, they must be saved by the
185+
compiler.
184186

185187
The interrupt attribute can have an optional parameter to specify the mode.
186188
The possible values are `user`, `supervisor`, or `machine`.

0 commit comments

Comments
 (0)