print kernel stacktrace for exceptions in kernel

fpu alignment check feature, checksum feature
This commit is contained in:
Ben Gras
2011-07-21 00:48:35 +02:00
parent 7ee78ffb82
commit eff1369cab
11 changed files with 59 additions and 11 deletions

View File

@@ -65,10 +65,13 @@ PUBLIC int do_fork(struct proc * caller, message * m_ptr)
#if (_MINIX_CHIP == _CHIP_INTEL)
rpc->p_seg.p_ldt_sel = old_ldt_sel; /* restore descriptors */
rpc->p_fpu_state.fpu_save_area_p = old_fpu_save_area_p;
if(proc_used_fpu(rpp))
if(proc_used_fpu(rpp)) {
fpu_verifychecksum(rpp);
memcpy(rpc->p_fpu_state.fpu_save_area_p,
rpp->p_fpu_state.fpu_save_area_p,
FPU_XFP_SIZE);
fpu_verifychecksum(rpc);
}
#endif
if(++gen >= _ENDPOINT_MAX_GENERATION) /* increase generation */
gen = 1; /* generation number wraparound */

View File

@@ -86,6 +86,7 @@ PUBLIC int do_setmcontext(struct proc * caller, message * m_ptr)
rp->p_misc_flags |= MF_FPU_INITIALIZED;
memcpy(rp->p_fpu_state.fpu_save_area_p, &(mc.mc_fpu_state),
FPU_XFP_SIZE);
fpu_makechecksum(rp);
} else
rp->p_misc_flags &= ~MF_FPU_INITIALIZED;
/* force reloading FPU in either case */

View File

@@ -56,8 +56,10 @@ PUBLIC int do_sigreturn(struct proc * caller, message * m_ptr)
#if (_MINIX_CHIP == _CHIP_INTEL)
if(sc.sc_flags & MF_FPU_INITIALIZED)
{
fpu_verifychecksum(rp);
memcpy(rp->p_fpu_state.fpu_save_area_p, &sc.sc_fpu_state,
FPU_XFP_SIZE);
fpu_makechecksum(rp);
rp->p_misc_flags |= MF_FPU_INITIALIZED; /* Restore math usage flag. */
/* force reloading FPU */
release_fpu(rp);