Module Name: src
Committed By: matt
Date: Sat May 26 00:31:07 UTC 2012
Modified Files:
src/sys/arch/powerpc/include: types.h userret.h
Log Message:
Add __HAVE_RAS support. Do it in userret.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/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/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.46 src/sys/arch/powerpc/include/types.h:1.47
--- src/sys/arch/powerpc/include/types.h:1.46 Sun Jul 17 23:23:54 2011
+++ src/sys/arch/powerpc/include/types.h Sat May 26 00:31:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.46 2011/07/17 23:23:54 dyoung Exp $ */
+/* $NetBSD: types.h,v 1.47 2012/05/26 00:31:07 matt Exp $ */
/*-
* Copyright (C) 1995 Wolfgang Solfrank.
@@ -95,5 +95,8 @@ typedef volatile __uint32_t __cpuset_t;
#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
#define __HAVE_MM_MD_KERNACC
+#if defined(_KERNEL)
+#define __HAVE_RAS
+#endif
#endif /* _MACHTYPES_H_ */
Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.23 src/sys/arch/powerpc/include/userret.h:1.24
--- src/sys/arch/powerpc/include/userret.h:1.23 Thu May 17 16:21:45 2012
+++ src/sys/arch/powerpc/include/userret.h Sat May 26 00:31:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: userret.h,v 1.23 2012/05/17 16:21:45 matt Exp $ */
+/* $NetBSD: userret.h,v 1.24 2012/05/26 00:31:07 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -35,6 +35,7 @@
#include "opt_altivec.h"
#include <sys/userret.h>
+#include <sys/ras.h>
#include <powerpc/fpu.h>
#include <powerpc/psl.h>
@@ -83,4 +84,16 @@ userret(struct lwp *l, struct trapframe
booke_sstep(tf);
}
#endif
+
+#ifdef __HAVE_RAS
+ /*
+ * Check to see if a RAS was interrupted and restart it if it was.
+ */
+ struct proc * const p = l->l_proc;
+ if (__predict_false(p->p_raslist != NULL)) {
+ void * const ras_pc = ras_lookup(p, (void *) tf->tf_srr0);
+ if (ras_pc != (void *) -1)
+ tf->tf_srr0 = (vaddr_t) ras_pc;
+ }
+#endif
}