mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Support eagerly FPU state save/restore
Co-authored-by: Shaowei Song <songshaowei.ssw@antgroup.com>
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
69c1db772a
commit
5e35704e38
@ -414,7 +414,7 @@ fn clone_cpu_context(
|
||||
tls: u64,
|
||||
clone_flags: CloneFlags,
|
||||
) -> UserContext {
|
||||
let mut child_context = *parent_context;
|
||||
let mut child_context = parent_context.clone();
|
||||
// The return value of child thread is zero
|
||||
child_context.set_syscall_ret(0);
|
||||
|
||||
@ -436,6 +436,10 @@ fn clone_cpu_context(
|
||||
child_context.set_tls_pointer(tls as usize);
|
||||
}
|
||||
|
||||
// New threads inherit the FPU state of the parent thread and
|
||||
// the state is private to the thread thereafter.
|
||||
child_context.fpu_state().save();
|
||||
|
||||
child_context
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user