diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2023-10-11 21:32:06 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2023-10-11 21:32:06 +0000 |
| commit | cc1cb9ea0c5607931fa9b7ecf786468d38fb8491 (patch) | |
| tree | e3ba60669ee819e6bee10bcb86779923c885741c /sys/x86 | |
| parent | e839ebfc0dc5851d383ac38740f32e96f7bd5186 (diff) | |
Diffstat (limited to 'sys/x86')
| -rw-r--r-- | sys/x86/include/fpu.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/x86/include/fpu.h b/sys/x86/include/fpu.h index e1ec6a592d21..0debf65d6fb9 100644 --- a/sys/x86/include/fpu.h +++ b/sys/x86/include/fpu.h @@ -213,4 +213,13 @@ struct savefpu_ymm { */ #define X86_XSTATE_XCR0_OFFSET 464 +#ifdef _KERNEL +/* + * CR0_MP and CR0_EM are always set. Use CR0_TS to force traps when + * FPU access is disabled. + */ +#define fpu_enable() clts() +#define fpu_disable() load_cr0(rcr0() | CR0_TS) +#endif + #endif /* !_X86_FPU_H_ */ |
