fatal error: asm/sigcontext.h: No such file or directory

Bug-Debian: http://bugs.debian.org/788102

Gbp-Pq: Name kfreebsd-support.patch
This commit is contained in:
Steven Chamberlain 2022-05-14 03:32:49 +08:00 committed by openKylinBot
parent 985d516aa2
commit 9d3df6226f
1 changed files with 14 additions and 1 deletions

View File

@ -264,6 +264,18 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
setMxcsr (ucon.uc_mcontext.fpregs->mxcsr, clearExceptions);
}
#elif defined(__FreeBSD_kernel__)
#include <machine/npx.h>
inline void
restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
{
struct envxmm *ex = (struct envxmm *)(ucon.uc_mcontext.mc_fpstate);
setCw ((ex->en_cw & cwRestoreMask) | cwRestoreVal);
setMxcsr (ex->en_mxcsr, clearExceptions);
}
#else
//
@ -463,8 +475,9 @@ setFpExceptionHandler (FpExceptionHandler handler)
sigemptyset (&action.sa_mask);
action.sa_flags = SA_SIGINFO | SA_NOMASK;
action.sa_sigaction = (void (*) (int, siginfo_t *, void *)) catchSigFpe;
#ifndef __FreeBSD_kernel__
action.sa_restorer = 0;
#endif
sigaction (SIGFPE, &action, 0);
}