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.
This commit is contained in:
parent
168dbd282b
commit
7bbf61fd89
@ -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 @@ cpu_switch(struct proc *p1, struct proc *newp)
|
||||
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. */
|
||||
}
|
||||
|
@ -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_ */
|
||||
|
@ -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 unsigned long pmc_ctr_t;
|
||||
typedef int register_t;
|
||||
|
||||
#define __HAVE_MINIMAL_EMUL
|
||||
#define __HAVE_RAS
|
||||
|
||||
#endif /* _ARM_TYPES_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user