Module Name: src
Committed By: matt
Date: Fri May 25 12:32:49 UTC 2012
Modified Files:
src/sys/arch/vax/include: types.h userret.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/vax/include/types.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/vax/include/userret.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/vax/include/types.h
diff -u src/sys/arch/vax/include/types.h:1.44 src/sys/arch/vax/include/types.h:1.45
--- src/sys/arch/vax/include/types.h:1.44 Tue Jan 17 20:34:57 2012
+++ src/sys/arch/vax/include/types.h Fri May 25 12:32:48 2012
@@ -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_
#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
Index: src/sys/arch/vax/include/userret.h
diff -u src/sys/arch/vax/include/userret.h:1.13 src/sys/arch/vax/include/userret.h:1.14
--- src/sys/arch/vax/include/userret.h:1.13 Sun Jul 3 02:18:20 2011
+++ src/sys/arch/vax/include/userret.h Fri May 25 12:32:48 2012
@@ -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 <sys/userret.h>
+#include <sys/ras.h>
/*
* Common code used by various exception handlers to
@@ -44,6 +45,15 @@ userret(struct lwp *l, struct trapframe
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.
*/
if ((p->p_stflag & PST_PROFIL) != 0) {