Module Name: src
Committed By: riz
Date: Wed Jun 13 19:44:11 UTC 2012
Modified Files:
src/sys/arch/powerpc/include [netbsd-6]: types.h userret.h
Log Message:
Pull up following revision(s) (requested by matt in ticket #340):
sys/arch/powerpc/include/types.h: revision 1.47
sys/arch/powerpc/include/userret.h: revision 1.24
Add __HAVE_RAS support. Do it in userret.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.8.1 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.22 -r1.22.8.1 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.46.8.1
--- src/sys/arch/powerpc/include/types.h:1.46 Sun Jul 17 23:23:54 2011
+++ src/sys/arch/powerpc/include/types.h Wed Jun 13 19:44:11 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.46 2011/07/17 23:23:54 dyoung Exp $ */
+/* $NetBSD: types.h,v 1.46.8.1 2012/06/13 19:44:11 riz 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.22 src/sys/arch/powerpc/include/userret.h:1.22.8.1
--- src/sys/arch/powerpc/include/userret.h:1.22 Tue Sep 27 01:02:36 2011
+++ src/sys/arch/powerpc/include/userret.h Wed Jun 13 19:44:11 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: userret.h,v 1.22 2011/09/27 01:02:36 jym Exp $ */
+/* $NetBSD: userret.h,v 1.22.8.1 2012/06/13 19:44:11 riz 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>
@@ -79,4 +80,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
}