aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit via Bug reports for the GNU Hurd <bug-hurd@gnu.org>2024-12-05 07:49:41 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-05 09:01:05 +0100
commitfa27b31ec185999826894496faac629bd1716b8d (patch)
tree1559b7dfeb0d6084bd30958b5424915192d745a8
parent5cf496bf46566c5b6d7fe616ca3be23807a60691 (diff)
downloadgnumach-fa27b31ec185999826894496faac629bd1716b8d.tar.gz
gnumach-fa27b31ec185999826894496faac629bd1716b8d.tar.bz2
gnumach-fa27b31ec185999826894496faac629bd1716b8d.zip
fpu: Fix for cpus that have no fxsave instruction
Fallthrough was incorrectly using fxsave() instead of xsave() or xsaveopt(). TESTED: on AMD fam15h: no longer throws "No coprocessor" exception. Message-ID: <20241205074929.704111-1-damien@zamaudio.com>
-rw-r--r--i386/i386/fpu.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 3d146f71..5bbad541 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -278,24 +278,8 @@ fpu_module_init(void)
/* Get default state from CPU. */
clear_ts();
fninit();
- switch (fp_save_kind) {
- case FP_XSAVEC:
- case FP_XSAVES:
- /* XRSTORS requires compact format, a bit faster anyway */
- fp_default_state->xfp_save_state.header.xcomp_bv = XSAVE_XCOMP_BV_COMPACT;
- /* Fallthrough */
- case FP_XSAVE:
- case FP_XSAVEOPT:
- case FP_FXSAVE:
- fxsave(&fp_default_state->xfp_save_state);
- break;
- case FP_FNSAVE:
- fnsave(&fp_default_state->fp_save_state);
- break;
- }
+ fpu_save(fp_default_state);
set_ts();
-
- fp_default_state->fp_valid = TRUE;
}
/*