summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-05 17:41:56 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-05 17:41:56 +0000
commit571d2e3efb4b81ca444d485a56e04579b1894b54 (patch)
tree979693c9e408f851588cc75bb1303ba7cc34a6e3 /sys/arch
parent1d0172aa638760dac8ca8e2bdc719ac4efbd0e6d (diff)
One ddb interface is enough for ppc.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/conf/files.macppc3
-rw-r--r--sys/arch/macppc/include/db_machdep.h3
-rw-r--r--sys/arch/powerpc/conf/files.powerpc3
-rw-r--r--sys/arch/powerpc/ddb/db_interface.c (renamed from sys/arch/macppc/macppc/db_interface.c)14
-rw-r--r--sys/arch/powerpc/include/db_machdep.h7
-rw-r--r--sys/arch/socppc/conf/files.socppc3
-rw-r--r--sys/arch/socppc/socppc/db_interface.c44
7 files changed, 18 insertions, 59 deletions
diff --git a/sys/arch/macppc/conf/files.macppc b/sys/arch/macppc/conf/files.macppc
index eb3f72230d7..af17c4a7adc 100644
--- a/sys/arch/macppc/conf/files.macppc
+++ b/sys/arch/macppc/conf/files.macppc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.macppc,v 1.85 2016/01/08 15:54:13 jcs Exp $
+# $OpenBSD: files.macppc,v 1.86 2016/03/05 17:41:55 mpi Exp $
#
# macppc-specific configuration info
@@ -19,7 +19,6 @@ file arch/macppc/macppc/openfirm.c
file arch/macppc/macppc/openprom.c
file dev/cninit.c
file arch/macppc/macppc/ofwreal.S
-file arch/macppc/macppc/db_interface.c ddb
#
# Media Independent Interface (mii)
diff --git a/sys/arch/macppc/include/db_machdep.h b/sys/arch/macppc/include/db_machdep.h
index 7b718faf031..5e917a89ae7 100644
--- a/sys/arch/macppc/include/db_machdep.h
+++ b/sys/arch/macppc/include/db_machdep.h
@@ -1,4 +1,3 @@
-/* $OpenBSD: db_machdep.h,v 1.6 2008/09/16 04:20:42 drahn Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.7 2016/03/05 17:41:55 mpi Exp $ */
-#define DB_MACHINE_COMMANDS
#include <powerpc/db_machdep.h>
diff --git a/sys/arch/powerpc/conf/files.powerpc b/sys/arch/powerpc/conf/files.powerpc
index 58212d1e670..3762f7997a9 100644
--- a/sys/arch/powerpc/conf/files.powerpc
+++ b/sys/arch/powerpc/conf/files.powerpc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.powerpc,v 1.53 2015/08/14 06:14:19 dlg Exp $
+# $OpenBSD: files.powerpc,v 1.54 2016/03/05 17:41:55 mpi Exp $
#
file arch/powerpc/powerpc/setjmp.S ddb
@@ -21,6 +21,7 @@ file arch/powerpc/powerpc/softintr.c
file arch/powerpc/ddb/db_memrw.c ddb
file arch/powerpc/ddb/db_disasm.c ddb
file arch/powerpc/ddb/db_trace.c ddb
+file arch/powerpc/ddb/db_interface.c ddb
# quad support is necessary for 32 bit architectures
file lib/libkern/adddi3.c
diff --git a/sys/arch/macppc/macppc/db_interface.c b/sys/arch/powerpc/ddb/db_interface.c
index e56d3424f6d..595b13c974d 100644
--- a/sys/arch/macppc/macppc/db_interface.c
+++ b/sys/arch/powerpc/ddb/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.12 2016/03/05 17:24:27 mpi Exp $ */
+/* $OpenBSD: db_interface.c,v 1.1 2016/03/05 17:41:55 mpi Exp $ */
/* $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
/*
@@ -231,17 +231,17 @@ struct db_command db_machine_command_table[] = {
{ "startcpu", db_startproc_cmd, 0, NULL },
{ "stopcpu", db_stopproc_cmd, 0, NULL },
{ "ddbcpu", db_ddbproc_cmd, 0, NULL },
-#endif
+#endif
{ (char *)NULL }
};
void
-db_machine_init(void)
+db_machine_init(void)
{
#ifdef MULTIPROCESSOR
int i;
#endif
-
+
db_machine_commands_install(db_machine_command_table);
#ifdef MULTIPROCESSOR
for (i = 0; i < ncpus; i++) {
@@ -296,7 +296,7 @@ void
db_stopproc_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
int cpu_n;
-
+
if (have_addr) {
cpu_n = addr;
if (cpu_n >= 0 && cpu_n < ncpus &&
@@ -321,7 +321,7 @@ db_startcpu(int cpu)
cpu_info[cpu].ci_ddb_paused = CI_DDB_RUNNING;
mtx_leave(&ddb_mp_mutex);
}
-}
+}
void
db_stopcpu(int cpu)
@@ -329,7 +329,7 @@ db_stopcpu(int cpu)
mtx_enter(&ddb_mp_mutex);
if (cpu != cpu_number() && cpu < ncpus &&
cpu_info[cpu].ci_ddb_paused != CI_DDB_STOPPED) {
- cpu_info[cpu].ci_ddb_paused = CI_DDB_SHOULDSTOP;
+ cpu_info[cpu].ci_ddb_paused = CI_DDB_SHOULDSTOP;
mtx_leave(&ddb_mp_mutex);
ppc_send_ipi(&cpu_info[cpu], PPC_IPI_DDB);
} else {
diff --git a/sys/arch/powerpc/include/db_machdep.h b/sys/arch/powerpc/include/db_machdep.h
index 1c8030e6d44..91be2456923 100644
--- a/sys/arch/powerpc/include/db_machdep.h
+++ b/sys/arch/powerpc/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.h,v 1.27 2016/03/05 17:24:27 mpi Exp $*/
+/* $OpenBSD: db_machdep.h,v 1.28 2016/03/05 17:41:55 mpi Exp $*/
/* $NetBSD: db_machdep.h,v 1.13 1996/04/29 20:50:08 leo Exp $ */
/*
@@ -98,6 +98,11 @@ extern struct mutex ddb_mp_mutex;
#define DDB_STATE_RUNNING 1
#define DDB_STATE_EXITING 2
+/*
+ * We define some of our own commands
+ */
+#define DB_MACHINE_COMMANDS
+
#endif /* _KERNEL */
#endif /* _POWERPC_DB_MACHDEP_H_ */
diff --git a/sys/arch/socppc/conf/files.socppc b/sys/arch/socppc/conf/files.socppc
index 745c5b006d5..4aa95261b02 100644
--- a/sys/arch/socppc/conf/files.socppc
+++ b/sys/arch/socppc/conf/files.socppc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.socppc,v 1.15 2016/03/03 02:42:16 bmercer Exp $
+# $OpenBSD: files.socppc,v 1.16 2016/03/05 17:41:55 mpi Exp $
#
# macppc-specific configuration info
@@ -14,7 +14,6 @@ file arch/socppc/socppc/disksubr.c disk
file arch/socppc/socppc/machdep.c
file arch/socppc/socppc/mem.c
file dev/cninit.c
-file arch/socppc/socppc/db_interface.c ddb
file dev/ofw/fdt.c
file arch/socppc/socppc/n1200_dts.S
diff --git a/sys/arch/socppc/socppc/db_interface.c b/sys/arch/socppc/socppc/db_interface.c
deleted file mode 100644
index 6772076584b..00000000000
--- a/sys/arch/socppc/socppc/db_interface.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $OpenBSD: db_interface.c,v 1.3 2016/03/05 17:24:27 mpi Exp $ */
-/* $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-
-#include <dev/cons.h>
-
-#include <machine/db_machdep.h>
-#include <ddb/db_extern.h>
-
-int db_trap_glue(struct trapframe *frame); /* called from locore */
-
-void
-Debugger()
-{
- ddb_trap();
-}
-
-int
-db_trap_glue(struct trapframe *frame)
-{
- if (!(frame->srr1 & PSL_PR)
- && (frame->exc == EXC_TRC
- || (frame->exc == EXC_PGM && (frame->srr1 & 0x20000))
- || frame->exc == EXC_BPT)) {
-
- bcopy(frame->fixreg, DDB_REGS->fixreg,
- 32 * sizeof(u_int32_t));
- DDB_REGS->srr0 = frame->srr0;
- DDB_REGS->srr1 = frame->srr1;
-
- cnpollc(TRUE);
- db_trap(T_BREAKPOINT, 0);
- cnpollc(FALSE);
-
- bcopy(DDB_REGS->fixreg, frame->fixreg,
- 32 * sizeof(u_int32_t));
-
- return 1;
- }
- return 0;
-}