Don't unconditionally reset the hardware debug registers in cpu_exit(),

reset them only if they were previously in use.  Unconditionally
resetting the registers wipes them out frequently, which interferes
with their use for kernel debugging.

While I'm here, be less verbose in the associated comment of a
neighboring function.

Noticed by:	bde
This commit is contained in:
Brian S. Dean 2003-07-06 16:52:18 +00:00
parent 3d6ae7e047
commit 6745e78cee

View File

@ -256,7 +256,11 @@ cpu_exit(struct thread *td)
load_gs(_udatasel);
user_ldt_free(td);
}
reset_dbregs();
if (pcb->pcb_flags & PCB_DBREGS) {
/* disable all hardware breakpoints */
reset_dbregs();
pcb->pcb_flags &= ~PCB_DBREGS;
}
}
void
@ -267,9 +271,7 @@ cpu_thread_exit(struct thread *td)
npxexit(td);
#endif
if (pcb->pcb_flags & PCB_DBREGS) {
/*
* disable all hardware breakpoints
*/
/* disable all hardware breakpoints */
reset_dbregs();
pcb->pcb_flags &= ~PCB_DBREGS;
}