diff --git a/sys/arch/hp300/hp300/genassym.cf b/sys/arch/hp300/hp300/genassym.cf index b2b088ec9cad..eaa3e71b6103 100644 --- a/sys/arch/hp300/hp300/genassym.cf +++ b/sys/arch/hp300/hp300/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.24 2002/05/11 09:39:26 jdolecek Exp $ +# $NetBSD: genassym.cf,v 1.25 2002/08/28 08:57:00 gmcgarry Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -57,6 +57,7 @@ endif include include +include include include include @@ -156,6 +157,7 @@ define P_ADDR offsetof(struct proc, p_addr) define P_PRIORITY offsetof(struct proc, p_priority) define P_STAT offsetof(struct proc, p_stat) define P_WCHAN offsetof(struct proc, p_wchan) +define P_NRAS offsetof(struct proc, p_nras) define P_MD_FLAGS offsetof(struct proc, p_md.md_flags) define P_MD_REGS offsetof(struct proc, p_md.md_regs) define SSLEEP SSLEEP @@ -219,6 +221,9 @@ define SG_RW SG_RW define SG_FRAME SG_FRAME define SG_ISHIFT SG_ISHIFT +# frame fields +define TF_PC offsetof(struct frame, f_pc) + # pcb fields define PCB_PS offsetof(struct pcb, pcb_ps) define PCB_USP offsetof(struct pcb, pcb_usp) diff --git a/sys/arch/hp300/hp300/locore.s b/sys/arch/hp300/hp300/locore.s index a255ab9fa228..efa674bbc302 100644 --- a/sys/arch/hp300/hp300/locore.s +++ b/sys/arch/hp300/hp300/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.123 2002/06/27 08:45:25 gmcgarry Exp $ */ +/* $NetBSD: locore.s,v 1.124 2002/08/28 08:57:00 gmcgarry Exp $ */ /* * Copyright (c) 1994, 1995 Gordon W. Ross @@ -1380,8 +1380,26 @@ Lswnofpsave: pea %a0@ | push proc jbsr _C_LABEL(pmap_activate) | pmap_activate(p) addql #4,%sp - movl _C_LABEL(curpcb),%a1 | restore p_addr +/* + * Check for restartable atomic sequences (RAS) + */ + movl _C_LABEL(curproc),%a0 + tstl %a0@(P_NRAS) + jeq 1f + movl %a0@(P_MD_REGS),%a1 + movl %a1@(TF_PC),%sp@- + movl %a0,%sp@- + jbsr _C_LABEL(ras_lookup) + addql #8,%sp + movql #-1,%d0 + cmpl %a0,%d0 + jeq 1f + movl _C_LABEL(curproc),%a1 + movl %a1@(P_MD_REGS),%a1 + movel %a0,%a1@(TF_PC) +1: + movl _C_LABEL(curpcb),%a1 | restore p_addr lea _ASM_LABEL(tmpstk),%sp | now goto a tmp stack for NMI moveml %a1@(PCB_REGS),#0xFCFC | and registers diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index f1a2b7fd85d7..2cabde780a29 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.95 2002/03/15 05:55:39 gmcgarry Exp $ */ +/* $NetBSD: trap.c,v 1.96 2002/08/28 08:57:01 gmcgarry Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.95 2002/03/15 05:55:39 gmcgarry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.96 2002/08/28 08:57:01 gmcgarry Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.95 2002/03/15 05:55:39 gmcgarry Exp $"); #include #include #include +#include #include #include #include @@ -502,6 +503,12 @@ trap(type, code, v, frame) /* FALLTHROUGH */ case T_TRACE: /* tracing a trap instruction */ case T_TRAP15|T_USER: /* SUN user trace trap */ + /* + * Don't go stepping into a RAS. + */ + if ((p->p_nras != 0) && + (ras_lookup(p, (caddr_t)frame.f_pc) != (caddr_t)-1)) + goto out; frame.f_sr &= ~PSL_T; i = SIGTRAP; break; diff --git a/sys/arch/hp300/include/types.h b/sys/arch/hp300/include/types.h index d0175b0c62fe..0453eb2e7e9b 100644 --- a/sys/arch/hp300/include/types.h +++ b/sys/arch/hp300/include/types.h @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.11 2002/02/28 03:17:33 simonb Exp $ */ +/* $NetBSD: types.h,v 1.12 2002/08/28 08:56:59 gmcgarry Exp $ */ #ifndef _MACHINE_TYPES_H_ #define _MACHINE_TYPES_H_ @@ -7,5 +7,6 @@ #define __HAVE_DEVICE_REGISTER #define __HAVE_GENERIC_SOFT_INTERRUPTS +#define __HAVE_RAS #endif