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
3 changes: 2 additions & 1 deletion src/riscv/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ impl FpState {
// after saving, we set the FP state to clean
self.fs = FS::Clean;
}
// set the FP state to the next task's FP state
unsafe { sstatus::set_fs(next_fp_state.fs) };
// restore the next task's FP state
match next_fp_state.fs {
FS::Clean => next_fp_state.restore(), // the next task's FP state is clean, we should restore it
FS::Initial => FpState::clear(), // restore the FP state as constant values(all 0)
FS::Off => {} // do nothing
FS::Dirty => unreachable!("FP state of the next task should not be dirty"),
}
unsafe { sstatus::set_fs(next_fp_state.fs) }; // set the FP state to the next task's FP state
}
}

Expand Down
Loading