summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2007-09-22 23:32:27 +0000
committermartin <martin@NetBSD.org>2007-09-22 23:32:27 +0000
commiteebdcf6078353ee85d2d4da7fbff6240d9f6cfa5 (patch)
tree8ca4ae1c0cf4a8cf5327059d4724dff452abe149 /sys/dev/sbus
parentb2e87907f288699f2fb3e31d297ea38c30865586 (diff)
Add a ddb command table at first attach to register "mach esp".
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/esp_sbus.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/sys/dev/sbus/esp_sbus.c b/sys/dev/sbus/esp_sbus.c
index 6a64eae01ad..34e583153f4 100644
--- a/sys/dev/sbus/esp_sbus.c
+++ b/sys/dev/sbus/esp_sbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_sbus.c,v 1.36 2007/03/04 06:02:40 christos Exp $ */
+/* $NetBSD: esp_sbus.c,v 1.37 2007/09/22 23:32:27 martin Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.36 2007/03/04 06:02:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.37 2007/09/22 23:32:27 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,6 +63,8 @@ __KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.36 2007/03/04 06:02:40 christos Exp $
#include <dev/sbus/sbusvar.h>
+#include "opt_ddb.h"
+
/* #define ESP_SBUS_DEBUG */
struct esp_softc {
@@ -105,6 +107,10 @@ static void esp_dma_go(struct ncr53c9x_softc *);
static void esp_dma_stop(struct ncr53c9x_softc *);
static int esp_dma_isactive(struct ncr53c9x_softc *);
+#ifdef DDB
+static void esp_init_ddb_cmds(void);
+#endif
+
static struct ncr53c9x_glue esp_sbus_glue = {
esp_read_reg,
esp_write_reg,
@@ -161,6 +167,10 @@ espattach_sbus(parent, self, aux)
struct lsi64854_softc *lsc;
int burst, sbusburst;
+#ifdef DDB
+ esp_init_ddb_cmds();
+#endif
+
esc->sc_bustag = sa->sa_bustag;
esc->sc_dmatag = sa->sa_dmatag;
@@ -716,19 +726,32 @@ esp_dma_isactive(sc)
return (DMA_ISACTIVE(esc->sc_dma));
}
-#include "opt_ddb.h"
#ifdef DDB
#include <machine/db_machdep.h>
#include <ddb/db_output.h>
+#include <ddb/db_command.h>
+
+void db_esp(db_expr_t, bool, db_expr_t, const char*);
+
+const struct db_command db_esp_command_table[] = {
+ { DDB_ADD_CMD("esp", db_esp, 0,
+ "display status of all esp SCSI controllers and their devices",
+ NULL, NULL) },
+ { DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) }
+};
-void db_esp(db_expr_t, int, db_expr_t, const char*);
+static void
+esp_init_ddb_cmds()
+{
+ static int db_cmds_initialized = 0;
+
+ if (db_cmds_initialized) return;
+ db_cmds_initialized = 1;
+ (void)db_register_tbl(DDB_MACH_CMD, db_esp_command_table);
+}
void
-db_esp(addr, have_addr, count, modif)
- db_expr_t addr;
- int have_addr;
- db_expr_t count;
- const char *modif;
+db_esp(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
{
struct ncr53c9x_softc *sc;
struct ncr53c9x_ecb *ecb;