CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/04/25 06:14:38
Modified files:
sys/arch/sparc64/sparc64: trap.c
Log message:
Do not clear the dirty upper and lower bits when enabling the FPU in fprs
When handling a FPU disabled trap and the FPU context is still pointing to
curproc then all that needs to be done is enable the FPU but on sparc64 this
needs to be done in two places. In pstate and %fprs.
Writing FPRS_FEF into %fprs clears the DU and DL bits which marks the FPU
state as clean (but it may not be). If the proc only reads the FPU state
and later a lazy FPU switch is forced the FPU context is not correctly saved.
Instead read %fprs and or FPRS_FEF into it, keeping the DU and DL bits intact.
See also rev 1.68 for why %fprs needs to be fumbled with.
This fixes various issues seen during ports bulk builds. Like perl tripping
over "use 5.12.0;" with a -NaN is not a version error, various awk issues
and even cmake failures via 'std::bad_array_new_length'.
OK kettenis@