Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Add support for restartable atomic sequences on 26-...



details:   https://anonhg.NetBSD.org/src/rev/04b19bc5910f
branches:  trunk
changeset: 537872:04b19bc5910f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Oct 07 02:48:38 2002 +0000

description:
Add support for restartable atomic sequences on 26-bit ARM.  Compile
tested only.

Now that all ARM systems have RAS, move __HAVE_RAS from arm/arm32/types.h
to arm/types.h.

diffstat:

 sys/arch/acorn26/acorn26/Locore.c  |  17 +++++++++++++++--
 sys/arch/arm/include/arm32/types.h |   3 +--
 sys/arch/arm/include/types.h       |   3 ++-
 3 files changed, 18 insertions(+), 5 deletions(-)

diffs (79 lines):

diff -r d9ec52df71bc -r 04b19bc5910f sys/arch/acorn26/acorn26/Locore.c
--- a/sys/arch/acorn26/acorn26/Locore.c Mon Oct 07 02:38:41 2002 +0000
+++ b/sys/arch/acorn26/acorn26/Locore.c Mon Oct 07 02:48:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: Locore.c,v 1.4 2002/09/22 05:43:25 gmcgarry Exp $      */
+/*     $NetBSD: Locore.c,v 1.5 2002/10/07 02:48:38 thorpej Exp $       */
 
 /*
  * Copyright (c) 2000 Ben Harris.
@@ -41,15 +41,17 @@
 
 #include <sys/param.h>
 
-__RCSID("$NetBSD: Locore.c,v 1.4 2002/09/22 05:43:25 gmcgarry Exp $");
+__RCSID("$NetBSD: Locore.c,v 1.5 2002/10/07 02:48:38 thorpej Exp $");
 
 #include <sys/proc.h>
 #include <sys/sched.h>
 #include <sys/systm.h>
 #include <sys/user.h>
+#include <sys/ras.h>
 
 #include <uvm/uvm_extern.h>
 
+#include <machine/frame.h>
 #include <machine/machdep.h>
 
 void idle(void);
@@ -163,6 +165,17 @@
                return;
        pmap_deactivate(p1);
        pmap_activate(p2);
+
+       /* Check for Restartable Atomic Sequences. */
+       if (p2->p_nras != 0) {
+               struct trapframe *tf = p2->p_addr->u_pcb.pcb_tf;
+               caddr_t pc;
+
+               pc = ras_lookup(p2, (caddr_t) tf->tf_pc);
+               if (pc != (caddr_t) -1)
+                       tf->tf_pc = (register_t) pc;
+       }
+
        cpu_loswitch(&p1->p_addr->u_pcb.pcb_sf, p2->p_addr->u_pcb.pcb_sf);
        /* We only get back here after the other process has run. */
 }
diff -r d9ec52df71bc -r 04b19bc5910f sys/arch/arm/include/arm32/types.h
--- a/sys/arch/arm/include/arm32/types.h        Mon Oct 07 02:38:41 2002 +0000
+++ b/sys/arch/arm/include/arm32/types.h        Mon Oct 07 02:48:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.4 2002/09/22 05:56:32 simonb Exp $ */
+/*     $NetBSD: types.h,v 1.5 2002/10/07 02:48:38 thorpej Exp $        */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -44,7 +44,6 @@
 
 #include <arm/types.h>         /* pull in generic ARM definitions */
 
-#define        __HAVE_RAS
 #define __HAVE_MD_RUNQUEUE
 
 #endif /* _ARM_ARM32_TYPES_H_ */
diff -r d9ec52df71bc -r 04b19bc5910f sys/arch/arm/include/types.h
--- a/sys/arch/arm/include/types.h      Mon Oct 07 02:38:41 2002 +0000
+++ b/sys/arch/arm/include/types.h      Mon Oct 07 02:48:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.5 2002/08/07 05:15:00 briggs Exp $ */
+/*     $NetBSD: types.h,v 1.6 2002/10/07 02:48:38 thorpej Exp $        */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -65,5 +65,6 @@
 typedef int            register_t;
 
 #define        __HAVE_MINIMAL_EMUL
+#define        __HAVE_RAS
 
 #endif /* _ARM_TYPES_H_ */



Home | Main Index | Thread Index | Old Index