From e950a585b9a90fca9a491bc5fe19a986ebe64965 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 May 2012 12:32:48 +0000 Subject: [PATCH] Implement __HAVE_RAS. Unlike most implementation, this is done in userret instead of cpu_switchto since we already accessing the proc structure so the additional overhead of check p_raslist is minimal. --- sys/arch/vax/include/types.h | 5 ++++- sys/arch/vax/include/userret.h | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/arch/vax/include/types.h b/sys/arch/vax/include/types.h index 25eee4fb0aa6..46bae323484e 100644 --- a/sys/arch/vax/include/types.h +++ b/sys/arch/vax/include/types.h @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.44 2012/01/17 20:34:57 joerg Exp $ */ +/* $NetBSD: types.h,v 1.45 2012/05/25 12:32:48 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -78,6 +78,9 @@ typedef volatile char __cpu_simple_lock_t; #define __HAVE_CPU_DATA_FIRST #define __HAVE_MM_MD_READWRITE #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS +#ifdef _KERNEL +#define __HAVE_RAS +#endif #define __HAVE___LWP_GETPRIVATE_FAST #define __HAVE_NO___THREAD diff --git a/sys/arch/vax/include/userret.h b/sys/arch/vax/include/userret.h index abb425fda8aa..b63dc7e79bb5 100644 --- a/sys/arch/vax/include/userret.h +++ b/sys/arch/vax/include/userret.h @@ -1,4 +1,4 @@ -/* $NetBSD: userret.h,v 1.13 2011/07/03 02:18:20 matt Exp $ */ +/* $NetBSD: userret.h,v 1.14 2012/05/25 12:32:48 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -31,6 +31,7 @@ */ #include +#include /* * Common code used by various exception handlers to @@ -43,6 +44,15 @@ userret(struct lwp *l, struct trapframe *tf, u_quad_t oticks) mi_userret(l); + /* + * Check to see if a RAS was interrupted and restart it if it was. + */ + if (__predict_false(p->p_raslist != NULL)) { + void * const ras_pc = ras_lookup(p, (void *) tf->tf_pc); + if (ras_pc != (void *) -1) + tf->tf_pc = (vaddr_t) ras_pc; + } + /* * If profiling, charge system time to the trapped pc. */