kernel: trap-dependent state restore, trace fixes

. restore state depends on how saving of state was done;
	  also remember trap style in sig context
	. actually set and restore TRACEBIT with new trap styles;
	  have to remove it once process enters kernel though, done
	  in debug trap exception handler
	. introduce MF_STEP that makes arch-specific code
	  turn on trace bit instead of setting TRACEBIT directly,
	  a bit more arch-friendly and avoids keeping precious
	  state in per-process PSW arch-dependently
This commit is contained in:
Ben Gras
2013-01-06 18:18:41 +00:00
parent b258ab0e66
commit 604046faf3
12 changed files with 64 additions and 22 deletions

View File

@@ -71,11 +71,8 @@ int do_fork(struct proc * caller, message * m_ptr)
rpc->p_user_time = 0; /* set all the accounting times to 0 */
rpc->p_sys_time = 0;
#if defined(__i386__)
rpc->p_reg.psw &= ~TRACEBIT; /* clear trace bit */
#endif
rpc->p_misc_flags &=
~(MF_VIRT_TIMER | MF_PROF_TIMER | MF_SC_TRACE | MF_SPROF_SEEN);
~(MF_VIRT_TIMER | MF_PROF_TIMER | MF_SC_TRACE | MF_SPROF_SEEN | MF_STEP);
rpc->p_virt_left = 0; /* disable, clear the process-virtual timers */
rpc->p_prof_left = 0;