Separate out checkvectors(), so it can be used elsewhere for debugging.

This commit is contained in:
bjh21 2000-12-16 16:45:11 +00:00
parent d1c538bc2f
commit 3c5709c088
1 changed files with 17 additions and 4 deletions

View File

@ -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 * Copyright (c) 1998, 1999, 2000 Ben Harris
* All rights reserved. * All rights reserved.
@ -32,7 +32,7 @@
#include <sys/param.h> #include <sys/param.h>
__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_cputypes.h"
#include "opt_ddb.h" #include "opt_ddb.h"
@ -70,6 +70,9 @@ static vm_prot_t data_abort_atype(struct trapframe *);
#ifdef DEBUG #ifdef DEBUG
static void printregs(struct trapframe *tf); static void printregs(struct trapframe *tf);
#endif #endif
#ifdef DIAGNOSTIC
void checkvectors();
#endif
int want_resched; int want_resched;
@ -82,7 +85,6 @@ static void
userret(struct proc *p, vaddr_t pc, u_quad_t oticks) userret(struct proc *p, vaddr_t pc, u_quad_t oticks)
{ {
int sig; int sig;
u_int32_t *ptr;
/* take pending signals */ /* take pending signals */
while ((sig = CURSIG(p)) != 0) while ((sig = CURSIG(p)) != 0)
@ -109,12 +111,23 @@ userret(struct proc *p, vaddr_t pc, u_quad_t oticks)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
/* Mark trapframe as invalid. */ /* Mark trapframe as invalid. */
p->p_addr->u_pcb.pcb_tf = (void *)-1; 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 */ /* Check that the vectors are valid */
for (ptr = (u_int32_t *)0; ptr < (u_int32_t *)0x1c; ptr++) for (ptr = (u_int32_t *)0; ptr < (u_int32_t *)0x1c; ptr++)
if (*ptr != 0xe59ff114) if (*ptr != 0xe59ff114)
panic("CPU vectors mangled"); panic("CPU vectors mangled");
#endif
} }
#endif
void void
undefined_handler(struct trapframe *tf) undefined_handler(struct trapframe *tf)