From 3c5709c08805d20e846ecfb1842907a3438d3de4 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Sat, 16 Dec 2000 16:45:11 +0000 Subject: [PATCH] Separate out checkvectors(), so it can be used elsewhere for debugging. --- sys/arch/arm26/arm26/except.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/arch/arm26/arm26/except.c b/sys/arch/arm26/arm26/except.c index 1c526a9116f9..84953f45ca70 100644 --- a/sys/arch/arm26/arm26/except.c +++ b/sys/arch/arm26/arm26/except.c @@ -1,4 +1,4 @@ -/* $NetBSD: except.c,v 1.18 2000/12/11 23:51:58 bjh21 Exp $ */ +/* $NetBSD: except.c,v 1.19 2000/12/16 16:45:11 bjh21 Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 Ben Harris * All rights reserved. @@ -32,7 +32,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.18 2000/12/11 23:51:58 bjh21 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.19 2000/12/16 16:45:11 bjh21 Exp $"); #include "opt_cputypes.h" #include "opt_ddb.h" @@ -70,6 +70,9 @@ static vm_prot_t data_abort_atype(struct trapframe *); #ifdef DEBUG static void printregs(struct trapframe *tf); #endif +#ifdef DIAGNOSTIC +void checkvectors(); +#endif int want_resched; @@ -82,7 +85,6 @@ static void userret(struct proc *p, vaddr_t pc, u_quad_t oticks) { int sig; - u_int32_t *ptr; /* take pending signals */ while ((sig = CURSIG(p)) != 0) @@ -109,12 +111,23 @@ userret(struct proc *p, vaddr_t pc, u_quad_t oticks) #ifdef DIAGNOSTIC /* Mark trapframe as invalid. */ p->p_addr->u_pcb.pcb_tf = (void *)-1; + checkvectors(); +#endif +} + +#ifdef DIAGNOSTIC +void +checkvectors() +{ + u_int32_t *ptr; + /* Check that the vectors are valid */ for (ptr = (u_int32_t *)0; ptr < (u_int32_t *)0x1c; ptr++) if (*ptr != 0xe59ff114) panic("CPU vectors mangled"); -#endif } +#endif + void undefined_handler(struct trapframe *tf)