Add back the i386-specific hack to save and restore the FP state

to/from a ucontext when a thread is interrupted by a signal.
This will be removed when a proper fix is made in the kernel
to save/restore the FP state without breaking the ABI.
This commit is contained in:
Daniel Eischen 2002-09-30 08:45:38 +00:00
parent d294e7fb70
commit cbed250de4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104189
2 changed files with 4 additions and 4 deletions

View File

@ -77,12 +77,12 @@
#define SET_STACK_UC(ucp, stk) (ucp)->uc_mcontext.mc_esp = (int)(stk)
#define FP_SAVE_UC(ucp) do { \
char *fdata; \
fdata = (char *) (ucp)->uc_mcontext.mc_fpregs; \
fdata = (char *) (ucp)->uc_mcontext.mc_fpstate; \
__asm__("fnsave %0": :"m"(*fdata)); \
} while (0)
#define FP_RESTORE_UC(ucp) do { \
char *fdata; \
fdata = (char *) (ucp)->uc_mcontext.mc_fpregs; \
fdata = (char *) (ucp)->uc_mcontext.mc_fpstate; \
__asm__("frstor %0": :"m"(*fdata)); \
} while (0)
#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[0] = (int)(ra)

View File

@ -113,7 +113,7 @@ _thread_kern_sched(ucontext_t *ucp)
/* Check if this function was called from the signal handler: */
if (ucp != NULL) {
#if 0
#if 1
/* XXX - Save FP registers? */
FP_SAVE_UC(ucp);
#endif
@ -158,7 +158,7 @@ _thread_kern_sched(ucontext_t *ucp)
if (ucp == NULL)
return;
else {
#if 0
#if 1
/* XXX - Restore FP registers? */
FP_RESTORE_UC(ucp);
#endif