diff options
author | bsd <bsd@FreeBSD.org> | 2003-07-06 16:52:18 +0000 |
---|---|---|
committer | bsd <bsd@FreeBSD.org> | 2003-07-06 16:52:18 +0000 |
commit | b0b3ec0fe6da6bf1103c53ec5a0ba5e5f6fdd235 (patch) | |
tree | bb8d652fb70432fa5880b29c2dcbfc7ef609def3 /sys/i386 | |
parent | ba870ee95abb577b043d605edcc99c76dd2e77af (diff) | |
download | FreeBSD-src-b0b3ec0fe6da6bf1103c53ec5a0ba5e5f6fdd235.zip FreeBSD-src-b0b3ec0fe6da6bf1103c53ec5a0ba5e5f6fdd235.tar.gz |
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
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 10d9714..2cf8e01 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -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; } |