1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

Kernel/riscv64: Implement {load,store}_fpu_state

This commit adds two functions which save/restore the entire FPU state.
On RISC-V, you only need to save the floating pointer registers
themselves and the fcsr CSR, which contains the entire state of the F/D
extensions.
This commit is contained in:
Sönke Holz 2024-02-21 17:11:57 +01:00 committed by Andrew Kaster
parent cd389833d4
commit 1429c83942
2 changed files with 85 additions and 0 deletions

View file

@ -16,6 +16,7 @@ namespace Kernel {
// This struct will get pushed on the stack by the signal handling code.
// Therefore, it has to be aligned to a 16-byte boundary.
struct [[gnu::aligned(16)]] FPUState {
// FIXME: Add support for the Q extension.
u64 f[32];
u64 fcsr;
};