Module Name: src
Committed By: cliff
Date: Tue Feb 8 22:42:32 UTC 2011
Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: db_interface.c
Log Message:
- cpu index variables (ddb_cpu, cpu_me) are now type u_int
- can now cpu_number() instead of cpu_index(curcpu())
since they are the same.
To generate a diff of this commit:
cvs rdiff -u -r1.64.16.20 -r1.64.16.21 src/sys/arch/mips/mips/db_interface.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.64.16.20 src/sys/arch/mips/mips/db_interface.c:1.64.16.21
--- src/sys/arch/mips/mips/db_interface.c:1.64.16.20 Tue Feb 8 19:18:22 2011
+++ src/sys/arch/mips/mips/db_interface.c Tue Feb 8 22:42:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.64.16.20 2011/02/08 19:18:22 cliff Exp $ */
+/* $NetBSD: db_interface.c,v 1.64.16.21 2011/02/08 22:42:32 cliff Exp $ */
/*
* Mach Operating System
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.64.16.20 2011/02/08 19:18:22 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.64.16.21 2011/02/08 22:42:32 cliff Exp $");
#include "opt_multiprocessor.h"
#include "opt_cputype.h" /* which mips CPUs do we support? */
@@ -67,8 +67,8 @@
#include <ddb/db_run.h> /* for db_continue_cmd() proto */
#endif
-#define NOCPU -1
-int ddb_cpu = NOCPU;
+#define NOCPU ~0
+u_int ddb_cpu = NOCPU;
int db_active = 0;
db_regs_t ddb_regs;
@@ -211,8 +211,9 @@
#ifdef MULTIPROCESSOR
bool first_in_ddb = false;
- int cpu_me = cpu_index(curcpu());
- int old_ddb_cpu = atomic_cas_32(&ddb_cpu, NOCPU, cpu_me);
+ u_int cpu_me = cpu_number();
+ u_int old_ddb_cpu =
+ atomic_cas_uint(&ddb_cpu, NOCPU, cpu_me);
if (old_ddb_cpu == NOCPU) {
first_in_ddb = true;
cpu_pause_others();
@@ -1081,7 +1082,7 @@
bool
ddb_running_on_this_cpu_p(void)
{
- return ddb_cpu == cpu_index(curcpu());
+ return ddb_cpu == cpu_number();
}
bool
@@ -1093,9 +1094,9 @@
void
db_resume_others(void)
{
- int cpu_me = cpu_index(curcpu());
+ u_int cpu_me = cpu_number();
- if (atomic_cas_32(&ddb_cpu, cpu_me, NOCPU) == cpu_me)
+ if (atomic_cas_uint(&ddb_cpu, cpu_me, NOCPU) == cpu_me)
cpu_resume_others();
}