summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c7
-rw-r--r--sys/arch/sparc64/sparc64/db_interface.c92
-rw-r--r--sys/arch/sparc64/sparc64/locore.s17
-rw-r--r--sys/arch/sparc64/sparc64/trap.c22
4 files changed, 4 insertions, 134 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c
index 0278a81c1fd..a4bc40bcad2 100644
--- a/sys/arch/sparc64/sparc64/autoconf.c
+++ b/sys/arch/sparc64/sparc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.126 2016/06/08 17:24:44 tedu Exp $ */
+/* $OpenBSD: autoconf.c,v 1.127 2016/10/18 00:43:57 guenther Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
@@ -586,11 +586,6 @@ bootpath_build(void)
#else
printf("kernel has no debugger\n");
#endif
- } else if (*cp == 't') {
- /* turn on traptrace w/o breaking into kdb */
- extern int trap_trace_dis;
-
- trap_trace_dis = 0;
}
}
}
diff --git a/sys/arch/sparc64/sparc64/db_interface.c b/sys/arch/sparc64/sparc64/db_interface.c
index a312f37264d..039da18b58e 100644
--- a/sys/arch/sparc64/sparc64/db_interface.c
+++ b/sys/arch/sparc64/sparc64/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.45 2016/10/08 05:49:09 guenther Exp $ */
+/* $OpenBSD: db_interface.c,v 1.46 2016/10/18 00:43:57 guenther Exp $ */
/* $NetBSD: db_interface.c,v 1.61 2001/07/31 06:55:47 eeh Exp $ */
/*
@@ -73,17 +73,6 @@ db_regs_t ddb_regs; /* register state */
extern void OF_enter(void);
-extern struct traptrace {
- unsigned short tl:3, /* Trap level */
- ns:4, /* PCB nsaved */
- tt:9; /* Trap type */
- unsigned short pid; /* PID */
- u_int tstate; /* tstate */
- u_int tsp; /* sp */
- u_int tpc; /* pc */
- u_int tfault; /* MMU tag access */
-} trap_trace[], trap_trace_end[];
-
static long nil;
static int
@@ -231,14 +220,12 @@ void db_pmap_kernel(db_expr_t, int, db_expr_t, char *);
void db_pload_cmd(db_expr_t, int, db_expr_t, char *);
void db_pmap_cmd(db_expr_t, int, db_expr_t, char *);
void db_lock(db_expr_t, int, db_expr_t, char *);
-void db_traptrace(db_expr_t, int, db_expr_t, char *);
void db_dump_buf(db_expr_t, int, db_expr_t, char *);
void db_dump_espcmd(db_expr_t, int, db_expr_t, char *);
void db_watch(db_expr_t, int, db_expr_t, char *);
void db_xir(db_expr_t, int, db_expr_t, char *);
static void db_dump_pmap(struct pmap*);
-static void db_print_trace_entry(struct traptrace *, int);
#ifdef MULTIPROCESSOR
void db_cpuinfo_cmd(db_expr_t, int, db_expr_t, char *);
@@ -272,9 +259,6 @@ db_ktrap(type, tf)
struct trapstate *ts = &ddb_regs.ddb_ts[0];
extern int savetstate(struct trapstate *ts);
extern void restoretstate(int tl, struct trapstate *ts);
- extern int trap_trace_dis;
-
- trap_trace_dis++;
#if NTDA > 0
tda_full_blast();
@@ -336,7 +320,6 @@ db_ktrap(type, tf)
*(struct frame *)tf->tf_out[6] = ddb_regs.ddb_fr;
#endif
*tf = ddb_regs.ddb_tf;
- trap_trace_dis--;
#ifdef MULTIPROCESSOR
if (!db_switch_cpu)
@@ -1098,78 +1081,6 @@ db_setpcb(addr, have_addr, count, modif)
db_printf("PID %ld not found.\n", addr);
}
-static void
-db_print_trace_entry(te, i)
- struct traptrace *te;
- int i;
-{
- db_printf("%d:%d p:%d tt:%d:%llx:%llx %llx:%llx ", i,
- (int)te->tl, (int)te->pid,
- (int)te->tt, (unsigned long long)te->tstate,
- (unsigned long long)te->tfault, (unsigned long long)te->tsp,
- (unsigned long long)te->tpc);
- db_printsym((u_long)te->tpc, DB_STGY_PROC, db_printf);
- db_printf(": ");
- if ((te->tpc && !(te->tpc&0x3)) &&
- curproc &&
- (curproc->p_pid == te->pid)) {
- db_disasm((u_long)te->tpc, 0);
- } else db_printf("\n");
-}
-
-void
-db_traptrace(addr, have_addr, count, modif)
- db_expr_t addr;
- int have_addr;
- db_expr_t count;
- char *modif;
-{
- int i, start = 0, full = 0, reverse = 0;
- struct traptrace *end;
-
- start = 0;
- end = &trap_trace_end[0];
-
- {
- register char c, *cp = modif;
- if (modif)
- while ((c = *cp++) != 0) {
- if (c == 'f')
- full = 1;
- if (c == 'r')
- reverse = 1;
- }
- }
-
- if (have_addr) {
- start = addr / (sizeof (struct traptrace));
- if (&trap_trace[start] > &trap_trace_end[0]) {
- db_printf("Address out of range.\n");
- return;
- }
- if (!full) end = &trap_trace[start+1];
- }
-
- db_printf("#:tl p:pid tt:tt:tstate:tfault sp:pc\n");
- if (reverse) {
- if (full && start)
- for (i=start; --i;) {
- db_print_trace_entry(&trap_trace[i], i);
- }
- i = (end - &trap_trace[0]);
- while(--i > start) {
- db_print_trace_entry(&trap_trace[i], i);
- }
- } else {
- for (i=start; &trap_trace[i] < end ; i++) {
- db_print_trace_entry(&trap_trace[i], i);
- }
- if (full && start)
- for (i=0; i < start ; i++) {
- db_print_trace_entry(&trap_trace[i], i);
- }
- }
-}
/*
* Use physical or virtual watchpoint registers -- ugh
@@ -1285,7 +1196,6 @@ struct db_command db_machine_command_table[] = {
{ "stack", db_dump_stack, 0, 0 },
{ "tf", db_dump_trap, 0, 0 },
{ "ts", db_dump_ts, 0, 0 },
- { "traptrace", db_traptrace, 0, 0 },
{ "watch", db_watch, 0, 0 },
{ "window", db_dump_window, 0, 0 },
{ "xir", db_xir, 0, 0 },
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index 729bb1a8fe4..3ae0dadbb1b 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.183 2016/05/23 20:11:49 deraadt Exp $ */
+/* $OpenBSD: locore.s,v 1.184 2016/10/18 00:43:57 guenther Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -1345,21 +1345,6 @@ panic_red:
.endm
#endif /* DEBUG_NOTDEF */
-#define TRACESIZ 0x01000
- .globl _C_LABEL(trap_trace)
- .globl _C_LABEL(trap_trace_ptr)
- .globl _C_LABEL(trap_trace_end)
- .globl _C_LABEL(trap_trace_dis)
- .data
-_C_LABEL(trap_trace_dis):
- .word 1, 1 ! Starts disabled. DDB turns it on.
-_C_LABEL(trap_trace_ptr):
- .word 0, 0, 0, 0
-_C_LABEL(trap_trace):
- .space TRACESIZ
-_C_LABEL(trap_trace_end):
- .space 0x20 ! safety margin
-
/*
* v9 machines do not have a trap window.
*
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index 5fd423b77a8..c4d460e3536 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.94 2016/10/08 05:49:09 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.95 2016/10/18 00:43:57 guenther Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
@@ -431,10 +431,7 @@ trap(struct trapframe64 *tf, unsigned type, vaddr_t pc, long tstate)
default:
if (type < 0x100) {
- extern int trap_trace_dis;
dopanic:
- trap_trace_dis = 1;
-
panic("trap type 0x%x (%s): pc=%lx npc=%lx pstate=%b",
type, type < N_TRAP_TYPES ? trap_type[type] : T,
pc, (long)tf->tf_npc, pstate, PSTATE_BITS);
@@ -851,8 +848,6 @@ data_access_fault(struct trapframe64 *tf, unsigned type, vaddr_t pc,
kfault:
onfault = (long)p->p_addr->u_pcb.pcb_onfault;
if (!onfault) {
- extern int trap_trace_dis;
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("kernel data fault: pc=%lx addr=%lx",
pc, addr);
@@ -934,9 +929,6 @@ data_access_error(struct trapframe64 *tf, unsigned type, vaddr_t afva,
if (tstate & TSTATE_PRIV) {
if (!onfault) {
- extern int trap_trace_dis;
-
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("data fault: pc=%lx addr=%lx sfsr=%lb",
(u_long)pc, (long)sfva, sfsr, SFSR_BITS);
@@ -998,8 +990,6 @@ text_access_fault(struct trapframe64 *tf, unsigned type, vaddr_t pc,
access_type = PROT_EXEC;
if (tstate & TSTATE_PRIV) {
- extern int trap_trace_dis;
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("kernel text_access_fault: pc=%lx va=%lx", pc, va);
/* NOTREACHED */
@@ -1031,8 +1021,6 @@ text_access_fault(struct trapframe64 *tf, unsigned type, vaddr_t pc,
* fault, deliver SIGSEGV.
*/
if (tstate & TSTATE_PRIV) {
- extern int trap_trace_dis;
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("kernel text fault: pc=%llx", (unsigned long long)pc);
/* NOTREACHED */
@@ -1076,13 +1064,9 @@ text_access_error(struct trapframe64 *tf, unsigned type, vaddr_t pc,
tstate = tf->tf_tstate;
if ((afsr) != 0) {
- extern int trap_trace_dis;
-
- trap_trace_dis++; /* Disable traptrace for printf */
printf("text_access_error: memory error...\n");
printf("text memory error type %d sfsr=%lx sfva=%lx afsr=%lx afva=%lx tf=%p\n",
type, sfsr, pc, afsr, afva, tf);
- trap_trace_dis--; /* Reenable traptrace for printf */
if (tstate & TSTATE_PRIV)
panic("text_access_error: kernel memory error");
@@ -1101,8 +1085,6 @@ text_access_error(struct trapframe64 *tf, unsigned type, vaddr_t pc,
/* Now munch on protections... */
access_type = PROT_EXEC;
if (tstate & TSTATE_PRIV) {
- extern int trap_trace_dis;
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("kernel text error: pc=%lx sfsr=%lb", pc,
sfsr, SFSR_BITS);
@@ -1136,8 +1118,6 @@ text_access_error(struct trapframe64 *tf, unsigned type, vaddr_t pc,
* fault, deliver SIGSEGV.
*/
if (tstate & TSTATE_PRIV) {
- extern int trap_trace_dis;
- trap_trace_dis = 1; /* Disable traptrace for printf */
(void) splhigh();
panic("kernel text error: pc=%lx sfsr=%lb", pc,
sfsr, SFSR_BITS);