Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/sparc db_cpu_cmd is DDB specific; move it int...



details:   https://anonhg.NetBSD.org/src/rev/67fe7c72e534
branches:  trunk
changeset: 511950:67fe7c72e534
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Jun 30 20:16:49 2001 +0000

description:
db_cpu_cmd is DDB specific; move it into the DDB specific portions of this file.  KGDB compiles again.

diffstat:

 sys/arch/sparc/sparc/db_interface.c |  85 +++++++++++++++++++-----------------
 1 files changed, 44 insertions(+), 41 deletions(-)

diffs (111 lines):

diff -r 8dedc786053c -r 67fe7c72e534 sys/arch/sparc/sparc/db_interface.c
--- a/sys/arch/sparc/sparc/db_interface.c       Sat Jun 30 20:15:02 2001 +0000
+++ b/sys/arch/sparc/sparc/db_interface.c       Sat Jun 30 20:16:49 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.42 2001/06/08 09:49:28 mrg Exp $ */
+/*     $NetBSD: db_interface.c,v 1.43 2001/06/30 20:16:49 mrg Exp $ */
 
 /*
  * Mach Operating System
@@ -201,7 +201,9 @@
 void db_lock_cmd __P((db_expr_t, int, db_expr_t, char *));
 void db_simple_lock_cmd __P((db_expr_t, int, db_expr_t, char *));
 void db_uvmhistdump __P((db_expr_t, int, db_expr_t, char *));
+#ifdef MULTIPROCESSOR
 void db_cpu_cmd __P((db_expr_t, int, db_expr_t, char *));
+#endif
 void db_page_cmd __P((db_expr_t, int, db_expr_t, char *));
 
 /*
@@ -492,6 +494,47 @@
        db_printf("\n");
 }
 
+#if defined(MULTIPROCESSOR)
+extern void cpu_debug_dump(void); /* XXX */
+
+void
+db_cpu_cmd(addr, have_addr, count, modif)
+       db_expr_t       addr;
+       int             have_addr;
+       db_expr_t       count;
+       char *          modif;
+{
+       struct cpu_info *ci;
+       if (!have_addr) {
+               cpu_debug_dump();
+               return;
+       }
+       
+       if ((addr < 0) || (addr >= ncpu)) {
+               db_printf("%ld: cpu out of range\n", addr);
+               return;
+       }
+       ci = cpus[addr];
+       if (ci == NULL) {
+               db_printf("cpu %ld not configured\n", addr);
+               return;
+       }
+       if (ci != curcpu()) {
+               if (!(ci->flags & CPUFLG_PAUSED)) {
+                       db_printf("cpu %ld not paused\n", addr);
+                       return;
+               }
+       }
+       if (ci->ci_ddb_regs == 0) {
+               db_printf("cpu %ld has no saved regs\n", addr);
+               return;
+       }
+       db_printf("using cpu %ld", addr);
+       ddb_regp = ci->ci_ddb_regs;
+}
+
+#endif /* MULTIPROCESSOR */
+
 #include <uvm/uvm.h>
 
 extern void uvmhist_dump __P((struct uvm_history *));
@@ -755,43 +798,3 @@
        return 0;
     }
 }
-
-#ifdef MULTIPROCESSOR
-extern void cpu_debug_dump(void); /* XXX */
-
-void
-db_cpu_cmd(addr, have_addr, count, modif)
-       db_expr_t       addr;
-       int             have_addr;
-       db_expr_t       count;
-       char *          modif;
-{
-       struct cpu_info *ci;
-       if (!have_addr) {
-               cpu_debug_dump();
-               return;
-       }
-       
-       if ((addr < 0) || (addr >= ncpu)) {
-               db_printf("%ld: cpu out of range\n", addr);
-               return;
-       }
-       ci = cpus[addr];
-       if (ci == NULL) {
-               db_printf("cpu %ld not configured\n", addr);
-               return;
-       }
-       if (ci != curcpu()) {
-               if (!(ci->flags & CPUFLG_PAUSED)) {
-                       db_printf("cpu %ld not paused\n", addr);
-                       return;
-               }
-       }
-       if (ci->ci_ddb_regs == 0) {
-               db_printf("cpu %ld has no saved regs\n", addr);
-               return;
-       }
-       db_printf("using cpu %ld", addr);
-       ddb_regp = ci->ci_ddb_regs;
-}
-#endif



Home | Main Index | Thread Index | Old Index