Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 port to userspace. this needs db_u...



details:   https://anonhg.NetBSD.org/src/rev/a9c97fe3dd27
branches:  trunk
changeset: 764167:a9c97fe3dd27
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Apr 13 03:34:37 2011 +0000

description:
port to userspace.  this needs db_user.h, stddef.h, stdbool.h and not
promlib.h.  put db_read/write_bytes() under _KERNEL.

XXX: for now, provide an empty db_machine_command_table[].

XXX2: this file puts a lot of it under #ifdef DDB, but i'm not sure
why this is done.  for now it makes it easier to port to userspace :)

diffstat:

 sys/arch/sparc64/sparc64/db_interface.c |  27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diffs (92 lines):

diff -r e2175530388b -r a9c97fe3dd27 sys/arch/sparc64/sparc64/db_interface.c
--- a/sys/arch/sparc64/sparc64/db_interface.c   Wed Apr 13 03:32:28 2011 +0000
+++ b/sys/arch/sparc64/sparc64/db_interface.c   Wed Apr 13 03:34:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $ */
+/*     $NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,10 +34,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -53,6 +55,7 @@
 #include <ddb/db_command.h>
 #include <ddb/db_sym.h>
 #include <ddb/db_variables.h>
+#include <ddb/db_user.h>
 #include <ddb/db_extern.h>
 #include <ddb/db_access.h>
 #include <ddb/db_output.h>
@@ -61,12 +64,20 @@
 
 #include <machine/instr.h>
 #include <machine/cpu.h>
+#ifdef _KERNEL
 #include <machine/promlib.h>
+#endif
 #include <machine/ctlreg.h>
 #include <machine/pmap.h>
 #include <machine/intr.h>
+#include <machine/vmparam.h>
 
+#ifdef _KERNEL
 #include "fb.h"
+#else
+#include <stddef.h>
+#include <stdbool.h>
+#endif
 
 extern struct traptrace {
        unsigned short tl:3,    /* Trap level */
@@ -515,6 +526,7 @@
 }
 #endif /* DDB */
 
+#ifdef _KERNEL
 /*
  * Read bytes from kernel address space for debugger.
  */
@@ -556,6 +568,7 @@
        }
 
 }
+#endif
 
 #ifdef DDB
 void
@@ -1306,6 +1319,13 @@
        { DDB_ADD_CMD(NULL,     NULL,           0,      NULL,NULL,NULL) }
 };
 
+#else  /* DDB */
+
+/* XXX */
+const struct db_command db_machine_command_table[] = {
+       { DDB_ADD_CMD(NULL,     NULL,           0,      NULL,NULL,NULL) }
+};
+
 #endif /* DDB */
 
 /*
@@ -1358,7 +1378,8 @@
 
       default:
        /* not a branch */
-       panic("branch_taken() on non-branch");
+       printf("branch_taken() on non-branch");
+       return pc;
     }
 }
 



Home | Main Index | Thread Index | Old Index