Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/include Add __HAVE_RAS support. Do it in u...



details:   https://anonhg.NetBSD.org/src/rev/bf21e657a15b
branches:  trunk
changeset: 779399:bf21e657a15b
user:      matt <matt%NetBSD.org@localhost>
date:      Sat May 26 00:31:07 2012 +0000

description:
Add __HAVE_RAS support.  Do it in userret.

diffstat:

 sys/arch/powerpc/include/types.h   |   5 ++++-
 sys/arch/powerpc/include/userret.h |  15 ++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r 87bb326c9862 -r bf21e657a15b sys/arch/powerpc/include/types.h
--- a/sys/arch/powerpc/include/types.h  Fri May 25 23:37:37 2012 +0000
+++ b/sys/arch/powerpc/include/types.h  Sat May 26 00:31:07 2012 +0000
@@ -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 @@
 
 #define        __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #define        __HAVE_MM_MD_KERNACC
+#if defined(_KERNEL)
+#define        __HAVE_RAS
+#endif
 
 #endif /* _MACHTYPES_H_ */
diff -r 87bb326c9862 -r bf21e657a15b sys/arch/powerpc/include/userret.h
--- a/sys/arch/powerpc/include/userret.h        Fri May 25 23:37:37 2012 +0000
+++ b/sys/arch/powerpc/include/userret.h        Sat May 26 00:31:07 2012 +0000
@@ -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 @@
                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
 }



Home | Main Index | Thread Index | Old Index