aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2000-11-28 23:15:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2000-11-28 23:15:44 +0000
commitbf8bfade992616d46bb6ad88a61cf4a715d34fcb (patch)
treee771251c363c580447bcf7f8fb33c09418c6a83b /sys
parent9a51cfcde1180b005bd235fdcc8ac6f85ba8b474 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/db_interface.c7
-rw-r--r--sys/i386/i386/db_interface.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c
index a801301a79cc..a2d07cb90e6d 100644
--- a/sys/amd64/amd64/db_interface.c
+++ b/sys/amd64/amd64/db_interface.c
@@ -306,7 +306,7 @@ void
Debugger(msg)
const char *msg;
{
- static volatile u_char in_Debugger;
+ static volatile u_int in_Debugger;
int flags;
/*
* XXX
@@ -317,14 +317,13 @@ Debugger(msg)
if (cons_unavail && !(boothowto & RB_GDB))
return;
- if (!in_Debugger) {
+ if (atomic_cmpset_int(&in_Debugger, 0, 1)) {
flags = save_intr();
disable_intr();
- in_Debugger = 1;
db_printf("Debugger(\"%s\")\n", msg);
breakpoint();
- in_Debugger = 0;
restore_intr(flags);
+ in_Debugger = 0;
}
}
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index a801301a79cc..a2d07cb90e6d 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -306,7 +306,7 @@ void
Debugger(msg)
const char *msg;
{
- static volatile u_char in_Debugger;
+ static volatile u_int in_Debugger;
int flags;
/*
* XXX
@@ -317,14 +317,13 @@ Debugger(msg)
if (cons_unavail && !(boothowto & RB_GDB))
return;
- if (!in_Debugger) {
+ if (atomic_cmpset_int(&in_Debugger, 0, 1)) {
flags = save_intr();
disable_intr();
- in_Debugger = 1;
db_printf("Debugger(\"%s\")\n", msg);
breakpoint();
- in_Debugger = 0;
restore_intr(flags);
+ in_Debugger = 0;
}
}