Support RAS for 32bit kernels too.

This commit is contained in:
martin 2004-01-18 19:41:06 +00:00
parent 3d2a90fb95
commit b7fcfc0137
3 changed files with 12 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.190 2004/01/16 12:43:43 martin Exp $ */
/* $NetBSD: locore.s,v 1.191 2004/01/18 19:41:06 martin Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
@ -8315,24 +8315,22 @@ Lsw_havectx:
1:
#endif
#ifdef __arch64__
/*
* Check for restartable atomic sequences (RAS)
*/
mov %l4, %o0 ! p is first arg to ras_lookup
ldx [%o0 + P_RASLIST], %o1 ! any RAS in p?
LDPTR [%o0 + P_RASLIST], %o1 ! any RAS in p?
brz,pt %o1, Lsw_noras ! no, skip RAS check
ldx [%l3 + L_TF], %l3 ! pointer to trap frame
LDPTR [%l3 + L_TF], %l3 ! pointer to trap frame
call _C_LABEL(ras_lookup)
ldx [%l3 + TF_PC], %o1
LDPTR [%l3 + TF_PC], %o1
cmp %o0, -1
be,pt %xcc, Lsw_noras
add %o0, 4, %o1
stx %o0, [%l3 + TF_PC] ! store rewound %pc
stx %o1, [%l3 + TF_NPC] ! and %npc
STPTR %o0, [%l3 + TF_PC] ! store rewound %pc
STPTR %o1, [%l3 + TF_NPC] ! and %npc
Lsw_noras:
#endif
Lsw_sameproc:
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.161 2004/01/06 21:35:18 martin Exp $ */
/* $NetBSD: machdep.c,v 1.162 2004/01/18 19:41:06 martin Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.161 2004/01/06 21:35:18 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.162 2004/01/18 19:41:06 martin Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@ -1798,9 +1798,7 @@ cpu_getmcontext(l, mcp, flags)
unsigned int *flags;
{
__greg_t *gr = mcp->__gregs;
#ifdef __arch64__
__greg_t ras_pc;
#endif
const struct trapframe64 *tf = l->l_md.md_tf;
/* First ensure consistent stack state (see sendsig). */ /* XXX? */
@ -1840,15 +1838,14 @@ cpu_getmcontext(l, mcp, flags)
#if 0 /* not yet supported */
gr[_REG_FPRS] = ;
#endif
#endif /* __arch64__ */
/* only sparc64 has RAS support */
if ((ras_pc = (__greg_t)ras_lookup(l->l_proc,
(caddr_t) gr[_REG_PC])) != -1) {
gr[_REG_PC] = ras_pc;
gr[_REG_nPC] = ras_pc + 4;
}
#endif /* __arch64__ */
*flags |= _UC_CPU;
mcp->__gwins = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.113 2004/01/18 17:14:46 martin Exp $ */
/* $NetBSD: trap.c,v 1.114 2004/01/18 19:41:07 martin Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2004/01/18 17:14:46 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.114 2004/01/18 19:41:07 martin Exp $");
#define NEW_FPSTATE
@ -860,18 +860,14 @@ badtrap:
break;
case T_BREAKPOINT:
#ifdef __HAVE_RAS
if (LIST_EMPTY(&p->p_raslist) ||
(ras_lookup(p, (caddr_t)tf->tf_pc) == (caddr_t)-1)) {
#endif
(ras_lookup(p, (caddr_t)(intptr_t)tf->tf_pc) == (caddr_t)-1)) {
sig = SIGTRAP;
KSI_INIT_TRAP(&ksi);
ksi.ksi_trap = type;
ksi.ksi_code = TRAP_BRKPT;
ksi.ksi_addr = (void *)pc;
#ifdef __HAVE_RAS
}
#endif
break;
case T_IDIV0: