diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sparc64/sparc64/machdep.c | 25 | ||||
-rw-r--r-- | sys/sparc64/sparc64/mp_machdep.c | 9 | ||||
-rw-r--r-- | sys/sparc64/sparc64/trap.c | 15 |
3 files changed, 24 insertions, 25 deletions
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 2bc8329..1671af4 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -45,6 +45,7 @@ #include <sys/systm.h> #include <sys/cons.h> #include <sys/imgact.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/ktr.h> #include <sys/linker.h> @@ -109,6 +110,10 @@ typedef int ofw_vec_t(void *); +#ifdef DDB +extern vm_offset_t ksym_start, ksym_end; +#endif + struct tlb_entry *kernel_tlbs; int kernel_tlb_slots; @@ -305,10 +310,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) cpu_block_zero = bzero; } -#ifdef DDB - kdb_init(); -#endif - #ifdef SMP mp_tramp = mp_tramp_alloc(); #endif @@ -383,9 +384,11 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) OF_getprop(root, "name", sparc64_model, sizeof(sparc64_model) - 1); -#ifdef DDB + kdb_init(); + +#ifdef KDB if (boothowto & RB_KDB) - Debugger("Boot flags requested debugger"); + kdb_enter("Boot flags requested debugger"); #endif } @@ -743,16 +746,6 @@ exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) td->td_retval[1] = tf->tf_out[1]; } -void -Debugger(const char *msg) -{ - - printf("Debugger(\"%s\")\n", msg); - critical_enter(); - breakpoint(); - critical_exit(); -} - int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c index 8625b43..97ef354 100644 --- a/sys/sparc64/sparc64/mp_machdep.c +++ b/sys/sparc64/sparc64/mp_machdep.c @@ -55,11 +55,10 @@ * $FreeBSD$ */ -#include "opt_ddb.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/lock.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/ktr.h> #include <sys/mutex.h> @@ -76,8 +75,6 @@ #include <dev/ofw/openfirm.h> -#include <ddb/ddb.h> - #include <machine/asi.h> #include <machine/atomic.h> #include <machine/bus.h> @@ -446,8 +443,8 @@ cpu_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2) return; } if ( -#ifdef DDB - db_active || +#ifdef KDB + kdb_active || #endif panicstr != NULL) printf("ipi_send: couldn't send ipi to module %u\n", mid); diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c index 0a0dbab..15a7b1e 100644 --- a/sys/sparc64/sparc64/trap.c +++ b/sys/sparc64/sparc64/trap.c @@ -45,6 +45,7 @@ #include "opt_ktrace.h" #include <sys/param.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/bus.h> #include <sys/interrupt.h> @@ -283,7 +284,7 @@ trap(struct trapframe *tf) } if (debugger_on_signal && (sig == 4 || sig == 10 || sig == 11)) - Debugger("trapsig"); + kdb_enter("trapsig"); trapsignal(td, sig, tf->tf_type); } @@ -296,11 +297,19 @@ trap(struct trapframe *tf) KASSERT((tf->tf_type & T_KERNEL) != 0, ("trap: kernel trap isn't")); +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + switch (tf->tf_type & ~T_KERNEL) { -#ifdef DDB +#ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: - error = (kdb_trap(tf) == 0); + error = (kdb_trap(tf->tf_type, 0, tf) == 0); + TF_DONE(tf); break; #ifdef notyet case T_PA_WATCHPOINT: |