diff --git a/sys/arch/acorn26/acorn26/cpuswitch.c b/sys/arch/acorn26/acorn26/cpuswitch.c index f5b31ab5c465..c700cfd3ba0a 100644 --- a/sys/arch/acorn26/acorn26/cpuswitch.c +++ b/sys/arch/acorn26/acorn26/cpuswitch.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpuswitch.c,v 1.3 2003/07/14 22:48:20 lukem Exp $ */ +/* $NetBSD: cpuswitch.c,v 1.4 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (c) 2000 Ben Harris. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpuswitch.c,v 1.3 2003/07/14 22:48:20 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpuswitch.c,v 1.4 2003/11/04 10:33:15 dsl Exp $"); #include "opt_lockdebug.h" @@ -122,7 +122,7 @@ cpu_switch(struct lwp *l1, struct lwp *newl) /* Check for Restartable Atomic Sequences. */ p2 = l2->l_proc; - if (p2->p_nras != 0) { + if (!LIST_EMPTY(&p2->p_raslist) { struct trapframe *tf = l2->l_addr->u_pcb.pcb_tf; caddr_t pc; diff --git a/sys/arch/alpha/alpha/genassym.cf b/sys/arch/alpha/alpha/genassym.cf index 1569afd3c6f1..6812fdfabe06 100644 --- a/sys/arch/alpha/alpha/genassym.cf +++ b/sys/arch/alpha/alpha/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.9 2003/10/07 17:04:18 skd Exp $ +# $NetBSD: genassym.cf,v 1.10 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1994, 1995 Gordon W. Ross @@ -124,7 +124,7 @@ define L_MD_PCBPADDR offsetof(struct lwp, l_md.md_pcbpaddr) define L_MD_TF offsetof(struct lwp, l_md.md_tf) define P_VMSPACE offsetof(struct proc, p_vmspace) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending) define PH_LINK offsetof(struct prochd, ph_link) diff --git a/sys/arch/alpha/alpha/locore.s b/sys/arch/alpha/alpha/locore.s index b140b830a859..60ea59604ea0 100644 --- a/sys/arch/alpha/alpha/locore.s +++ b/sys/arch/alpha/alpha/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.104 2003/10/07 17:04:18 skd Exp $ */ +/* $NetBSD: locore.s,v 1.105 2003/11/04 10:33:16 dsl Exp $ */ /*- * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.104 2003/10/07 17:04:18 skd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.105 2003/11/04 10:33:16 dsl Exp $"); #include "assym.h" @@ -910,8 +910,8 @@ switch_resume: * Check for restartable atomic sequences (RAS). */ ldq a0, L_PROC(s2) /* first ras_lookup() arg */ - ldl t0, P_NRAS(a0) /* p->p_nras == 0? */ - beq t0, 1f /* yes, skip */ + ldq t0, P_RASLIST(a0) /* any RAS entries? */ + beq t0, 1f /* no, skip */ ldq s1, L_MD_TF(s2) /* s1 = l->l_md.md_tf */ ldq a1, (FRAME_PC*8)(s1) /* second ras_lookup() arg */ CALL(ras_lookup) /* ras_lookup(p, PC) */ diff --git a/sys/arch/amd64/amd64/genassym.cf b/sys/arch/amd64/amd64/genassym.cf index 69afb552e20d..e64607bb8e09 100644 --- a/sys/arch/amd64/amd64/genassym.cf +++ b/sys/arch/amd64/amd64/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.2 2003/05/04 23:46:41 fvdl Exp $ +# $NetBSD: genassym.cf,v 1.3 2003/11/04 10:33:15 dsl Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -149,7 +149,7 @@ define PAGE_SIZE PAGE_SIZE define MDP_IRET MDP_IRET define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define P_MD_FLAGS offsetof(struct proc, p_md.md_flags) define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending) diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index e270422404a7..8321b0787c49 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.6 2003/08/20 21:48:47 fvdl Exp $ */ +/* $NetBSD: locore.S,v 1.7 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright-o-rama! @@ -1024,7 +1024,7 @@ switch_restored: */ movq CPUVAR(CURLWP),%r12 movq L_PROC(%r12),%rdi - cmpl $0,P_NRAS(%rdi) + cmpq $0,P_RASLIST(%rdi) je 1f movq L_MD_REGS(%r12),%rbx movq TF_RIP(%rbx),%rsi diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index f9e8617c48c8..7e9913efc6d7 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.13 2003/10/21 00:46:09 fvdl Exp $ */ +/* $NetBSD: trap.c,v 1.14 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.13 2003/10/21 00:46:09 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.14 2003/11/04 10:33:15 dsl Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -563,7 +563,7 @@ faultcommon: #ifdef MATH_EMULATE trace: #endif - if ((p->p_nras == 0) || + if (LIST_EMPTY((&p->p_raslist) || (ras_lookup(p, (caddr_t)frame->tf_rip) == (caddr_t)-1)) { KSI_INIT_TRAP(&ksi); ksi.ksi_signo = SIGTRAP; diff --git a/sys/arch/amiga/amiga/genassym.cf b/sys/arch/amiga/amiga/genassym.cf index bed65925c12d..f90a1513515f 100644 --- a/sys/arch/amiga/amiga/genassym.cf +++ b/sys/arch/amiga/amiga/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.19 2003/09/22 14:27:00 cl Exp $ +# $NetBSD: genassym.cf,v 1.20 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -111,7 +111,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/arm/arm32/cpuswitch.S b/sys/arch/arm/arm32/cpuswitch.S index b583c1ac4872..162f8e5bb6a3 100644 --- a/sys/arch/arm/arm32/cpuswitch.S +++ b/sys/arch/arm/arm32/cpuswitch.S @@ -1,4 +1,4 @@ -/* $NetBSD: cpuswitch.S,v 1.38 2003/10/23 08:59:10 scw Exp $ */ +/* $NetBSD: cpuswitch.S,v 1.39 2003/11/04 10:33:16 dsl Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -746,7 +746,7 @@ ENTRY(cpu_switch) * Check for restartable atomic sequences (RAS). */ - ldr r2, [r5, #(P_NRAS)] + ldr r2, [r5, #(P_RASLIST)] ldr r1, [r7, #(PCB_TF)] /* r1 = trapframe (used below) */ teq r2, #0 /* p->p_nras == 0? */ bne .Lswitch_do_ras /* no, check for one */ diff --git a/sys/arch/arm/arm32/genassym.cf b/sys/arch/arm/arm32/genassym.cf index 8325d4e17e40..6b8be7d7b701 100644 --- a/sys/arch/arm/arm32/genassym.cf +++ b/sys/arch/arm/arm32/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.26 2003/10/25 19:44:42 scw Exp $ +# $NetBSD: genassym.cf,v 1.27 2003/11/04 10:33:16 dsl Exp $ # Copyright (c) 1982, 1990 The Regents of the University of California. # All rights reserved. @@ -88,7 +88,7 @@ define L_PRIORITY offsetof(struct lwp, l_priority) define L_WCHAN offsetof(struct lwp, l_wchan) define L_STAT offsetof(struct lwp, l_stat) define L_PROC offsetof(struct lwp, l_proc) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) # Process status constants define LSONPROC LSONPROC diff --git a/sys/arch/atari/atari/genassym.cf b/sys/arch/atari/atari/genassym.cf index 852e25e4deed..0a341a80afab 100644 --- a/sys/arch/atari/atari/genassym.cf +++ b/sys/arch/atari/atari/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.21 2003/09/22 14:27:03 cl Exp $ +# $NetBSD: genassym.cf,v 1.22 2003/11/04 10:33:16 dsl Exp $ #- # Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/cesfic/cesfic/genassym.cf b/sys/arch/cesfic/cesfic/genassym.cf index 4b42faf41e95..82cadf3d4012 100644 --- a/sys/arch/cesfic/cesfic/genassym.cf +++ b/sys/arch/cesfic/cesfic/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.5 2003/09/22 14:27:04 cl Exp $ +# $NetBSD: genassym.cf,v 1.6 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -111,7 +111,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/hp300/hp300/genassym.cf b/sys/arch/hp300/hp300/genassym.cf index 7e7e032383a4..3818bab4ed68 100644 --- a/sys/arch/hp300/hp300/genassym.cf +++ b/sys/arch/hp300/hp300/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.30 2003/09/22 14:26:57 cl Exp $ +# $NetBSD: genassym.cf,v 1.31 2003/11/04 10:33:15 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -161,7 +161,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index 7ec3277f65dc..557bcd4dc470 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.106 2003/11/02 16:49:38 cl Exp $ */ +/* $NetBSD: trap.c,v 1.107 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.106 2003/11/02 16:49:38 cl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.107 2003/11/04 10:33:15 dsl Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -558,7 +558,7 @@ trap(type, code, v, frame) /* * Don't go stepping into a RAS. */ - if ((p->p_nras != 0) && + if (!LIST_EMPTY(&p->p_raslist) && (ras_lookup(p, (caddr_t)frame.f_pc) != (caddr_t)-1)) goto out; frame.f_sr &= ~PSL_T; diff --git a/sys/arch/i386/i386/genassym.cf b/sys/arch/i386/i386/genassym.cf index 062aaba58e2b..aea58d4667e9 100644 --- a/sys/arch/i386/i386/genassym.cf +++ b/sys/arch/i386/i386/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.38 2003/07/03 21:25:45 christos Exp $ +# $NetBSD: genassym.cf,v 1.39 2003/11/04 10:33:15 dsl Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -167,7 +167,7 @@ define L_MD_TSS_SEL offsetof(struct lwp, l_md.md_tss_sel) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_CPU offsetof(struct lwp, l_cpu) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending) diff --git a/sys/arch/i386/i386/locore.S b/sys/arch/i386/i386/locore.S index 28651950ace6..a883a19416ba 100644 --- a/sys/arch/i386/i386/locore.S +++ b/sys/arch/i386/i386/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.19 2003/09/12 16:51:04 christos Exp $ */ +/* $NetBSD: locore.S,v 1.20 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -1951,17 +1951,8 @@ switch_restored: */ movl CPUVAR(CURLWP),%edi movl L_PROC(%edi),%esi - cmpl $0,P_NRAS(%esi) - je 1f - movl L_MD_REGS(%edi),%ebx - movl TF_EIP(%ebx),%eax - pushl %eax - pushl %esi - call _C_LABEL(ras_lookup) - addl $8,%esp - cmpl $-1,%eax - je 1f - movl %eax,TF_EIP(%ebx) + cmpl $0,P_RASLIST(%esi) + jne 2f 1: movl $1,%ebx @@ -1981,6 +1972,18 @@ switch_return: popl %ebx ret +2: # check RAS list + movl L_MD_REGS(%edi),%ebx + movl TF_EIP(%ebx),%eax + pushl %eax + pushl %esi + call _C_LABEL(ras_lookup) + addl $8,%esp + cmpl $-1,%eax + je 1b + movl %eax,TF_EIP(%ebx) + jmp 1b + /* * void cpu_switchto(struct lwp *current, struct lwp *next) * Switch to the specified next LWP. diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 26ca2399e125..fbc5e16e2b16 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.193 2003/10/27 14:11:47 junyoung Exp $ */ +/* $NetBSD: trap.c,v 1.194 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.193 2003/10/27 14:11:47 junyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.194 2003/11/04 10:33:15 dsl Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -672,7 +672,7 @@ copyfault: /* * Don't go single-stepping into a RAS. */ - if ((p->p_nras == 0) || + if (LIST_EMPTY(&p->p_raslist) || (ras_lookup(p, (caddr_t)frame->tf_eip) == (caddr_t)-1)) { KSI_INIT_TRAP(&ksi); ksi.ksi_signo = SIGTRAP; diff --git a/sys/arch/luna68k/luna68k/genassym.cf b/sys/arch/luna68k/luna68k/genassym.cf index fa10936559b4..46cc286742e6 100644 --- a/sys/arch/luna68k/luna68k/genassym.cf +++ b/sys/arch/luna68k/luna68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.9 2003/09/22 14:27:06 cl Exp $ +# $NetBSD: genassym.cf,v 1.10 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -111,7 +111,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/m68k/m68k/switch_subr.s b/sys/arch/m68k/m68k/switch_subr.s index c588814439e3..9683eeeb82fd 100644 --- a/sys/arch/m68k/m68k/switch_subr.s +++ b/sys/arch/m68k/m68k/switch_subr.s @@ -1,4 +1,4 @@ -/* $NetBSD: switch_subr.s,v 1.7 2003/10/30 05:12:28 mycroft Exp $ */ +/* $NetBSD: switch_subr.s,v 1.8 2003/11/04 10:33:16 dsl Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -392,7 +392,7 @@ Lsame_mmuctx: */ movl _C_LABEL(curlwp),%a0 movl %a0@(L_PROC),%a2 - tstl %a2@(P_NRAS) + tstl %a2@(P_RASLIST) jeq 1f movl %a0@(L_MD_REGS),%a1 movl %a1@(TF_PC),%sp@- diff --git a/sys/arch/mac68k/mac68k/genassym.cf b/sys/arch/mac68k/mac68k/genassym.cf index 0a1e81e695f1..00bbb76b2e66 100644 --- a/sys/arch/mac68k/mac68k/genassym.cf +++ b/sys/arch/mac68k/mac68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.26 2003/09/22 14:27:07 cl Exp $ +# $NetBSD: genassym.cf,v 1.27 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1990 The Regents of the University of California. @@ -101,7 +101,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/mips/mips/genassym.cf b/sys/arch/mips/mips/genassym.cf index 965cc39dbe5a..0539ae0db8fd 100644 --- a/sys/arch/mips/mips/genassym.cf +++ b/sys/arch/mips/mips/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.35 2003/09/29 14:34:44 tsutsui Exp $ +# $NetBSD: genassym.cf,v 1.36 2003/11/04 10:33:15 dsl Exp $ # # Copyright (c) 1997 # Jonathan Stone. All rights reserved. @@ -72,7 +72,7 @@ define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_UPTE_0 offsetof(struct lwp, l_md.md_upte[0]) define L_MD_UPTE_1 offsetof(struct lwp, l_md.md_upte[1]) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) diff --git a/sys/arch/mips/mips/locore.S b/sys/arch/mips/mips/locore.S index 226665f93452..e801b33b17e8 100644 --- a/sys/arch/mips/mips/locore.S +++ b/sys/arch/mips/mips/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.156 2003/08/07 16:28:32 agc Exp $ */ +/* $NetBSD: locore.S,v 1.157 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (c) 1992, 1993 @@ -354,7 +354,7 @@ cpu_switch_queuescan: */ lw t1, L_PROC(s7) lw a0, L_ADDR(s7) - lw v1, P_NRAS(t1) + lw v1, P_RASLIST(t1) addu t0, a0, USPACE - FRAME_SIZ beq v1, zero, 1f diff --git a/sys/arch/mips/mips/trap.c b/sys/arch/mips/mips/trap.c index cee3b2999973..96e28cf4661f 100644 --- a/sys/arch/mips/mips/trap.c +++ b/sys/arch/mips/mips/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.186 2003/11/02 08:27:41 christos Exp $ */ +/* $NetBSD: trap.c,v 1.187 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (c) 1992, 1993 @@ -78,7 +78,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.186 2003/11/02 08:27:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.187 2003/11/04 10:33:15 dsl Exp $"); #include "opt_cputype.h" /* which mips CPU levels do we support? */ #include "opt_ktrace.h" @@ -688,7 +688,7 @@ mips_singlestep(l) * We can't single-step into a RAS. Check if we're in * a RAS, and set the breakpoint just past it. */ - if (p->p_nras != 0) { + if (!LIST_EMPTY(&p->p_raslist) { while (ras_lookup(p, (caddr_t)va) != (caddr_t)-1) va += sizeof(int); } diff --git a/sys/arch/mvme68k/mvme68k/genassym.cf b/sys/arch/mvme68k/mvme68k/genassym.cf index 25ce907a71ea..1378d3c1995d 100644 --- a/sys/arch/mvme68k/mvme68k/genassym.cf +++ b/sys/arch/mvme68k/mvme68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.26 2003/09/22 14:27:09 cl Exp $ +# $NetBSD: genassym.cf,v 1.27 2003/11/04 10:33:16 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -138,7 +138,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/news68k/news68k/genassym.cf b/sys/arch/news68k/news68k/genassym.cf index 59dbc7214c3a..5e3675601468 100644 --- a/sys/arch/news68k/news68k/genassym.cf +++ b/sys/arch/news68k/news68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.13 2003/09/22 14:27:10 cl Exp $ +# $NetBSD: genassym.cf,v 1.14 2003/11/04 10:33:17 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -114,7 +114,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/next68k/next68k/genassym.cf b/sys/arch/next68k/next68k/genassym.cf index 5c2e0d68e321..b5871dfa6837 100644 --- a/sys/arch/next68k/next68k/genassym.cf +++ b/sys/arch/next68k/next68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.17 2003/09/22 14:27:11 cl Exp $ +# $NetBSD: genassym.cf,v 1.18 2003/11/04 10:33:17 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -135,7 +135,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index 00f99c6d3520..de7459f9391f 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.93 2003/10/25 16:31:39 chs Exp $ */ +/* $NetBSD: trap.c,v 1.94 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.93 2003/10/25 16:31:39 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.94 2003/11/04 10:33:15 dsl Exp $"); #include "opt_altivec.h" #include "opt_ddb.h" @@ -104,7 +104,7 @@ trap(struct trapframe *frame) /* FALLTHROUGH */ case EXC_TRC|EXC_USER: frame->srr1 &= ~PSL_SE; - if (p->p_nras == 0 || + if (LIST_EMPTY(&p->p_raslist) || ras_lookup(p, (caddr_t)frame->srr0) == (caddr_t) -1) { KSI_INIT_TRAP(&ksi); ksi.ksi_signo = SIGTRAP; diff --git a/sys/arch/sh3/sh3/locore_c.c b/sys/arch/sh3/sh3/locore_c.c index 0b12962ea1d7..a42fcb357c04 100644 --- a/sys/arch/sh3/sh3/locore_c.c +++ b/sys/arch/sh3/sh3/locore_c.c @@ -1,4 +1,4 @@ -/* $NetBSD: locore_c.c,v 1.4 2003/10/22 21:13:44 uwe Exp $ */ +/* $NetBSD: locore_c.c,v 1.5 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. @@ -111,7 +111,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore_c.c,v 1.4 2003/10/22 21:13:44 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore_c.c,v 1.5 2003/11/04 10:33:15 dsl Exp $"); #include "opt_lockdebug.h" @@ -177,7 +177,7 @@ cpu_switch_search(struct lwp *oldlwp) pmap_activate(l); /* Check for Restartable Atomic Sequences. */ - if (p->p_nras != 0) { + if (!LIST_EMPTY(&p->p_raslist) { caddr_t pc; pc = ras_lookup(p, (caddr_t) l->l_md.md_regs->tf_spc); diff --git a/sys/arch/sh5/sh5/cpu_switch.S b/sys/arch/sh5/sh5/cpu_switch.S index 1d98f54abca2..5dab43eae0be 100644 --- a/sys/arch/sh5/sh5/cpu_switch.S +++ b/sys/arch/sh5/sh5/cpu_switch.S @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_switch.S,v 1.18 2003/10/05 09:57:47 scw Exp $ */ +/* $NetBSD: cpu_switch.S,v 1.19 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -394,7 +394,7 @@ Lsw3: */ pta/l 2f, tr0 LDPTR r31, L_PROC, r2 - ld.l r2, P_NRAS, r0 + LDPTR r2, P_RASLIST, r0 beq/l r0, r63, tr0 /* Skip if no RAS registered for proc */ LEAF(_C_LABEL(ras_lookup), r0) ptabs/l r0, tr0 diff --git a/sys/arch/sh5/sh5/genassym.cf b/sys/arch/sh5/sh5/genassym.cf index 45f82fd070da..0c91338d167e 100644 --- a/sys/arch/sh5/sh5/genassym.cf +++ b/sys/arch/sh5/sh5/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.15 2003/03/13 13:44:19 scw Exp $ +# $NetBSD: genassym.cf,v 1.16 2003/11/04 10:33:15 dsl Exp $ # Copyright 2002 Wasabi Systems, Inc. # All rights reserved. @@ -255,7 +255,7 @@ define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define PH_LINK offsetof(struct prochd, ph_link) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending) diff --git a/sys/arch/sun2/sun2/genassym.cf b/sys/arch/sun2/sun2/genassym.cf index e4a6b59f5aca..4e29dbf11a0e 100644 --- a/sys/arch/sun2/sun2/genassym.cf +++ b/sys/arch/sun2/sun2/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.5 2003/09/22 14:27:15 cl Exp $ +# $NetBSD: genassym.cf,v 1.6 2003/11/04 10:33:17 dsl Exp $ # # Copyright (c) 1994, 1995 Gordon W. Ross @@ -138,7 +138,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/arch/x68k/x68k/genassym.cf b/sys/arch/x68k/x68k/genassym.cf index aa5e82d13c0d..25bc994db280 100644 --- a/sys/arch/x68k/x68k/genassym.cf +++ b/sys/arch/x68k/x68k/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.23 2003/09/22 14:27:14 cl Exp $ +# $NetBSD: genassym.cf,v 1.24 2003/11/04 10:33:17 dsl Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -118,7 +118,7 @@ define L_PROC offsetof(struct lwp, l_proc) define L_MD_REGS offsetof(struct lwp, l_md.md_regs) define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) define P_FLAG offsetof(struct proc, p_flag) -define P_NRAS offsetof(struct proc, p_nras) +define P_RASLIST offsetof(struct proc, p_raslist) define P_VMSPACE offsetof(struct proc, p_vmspace) # lwp fields and values diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 4e716ddc7df7..36700d87d5a6 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.225 2003/11/02 16:42:22 jdolecek Exp $ */ +/* $NetBSD: init_main.c,v 1.226 2003/11/04 10:33:15 dsl Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993 @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.225 2003/11/02 16:42:22 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.226 2003/11/04 10:33:15 dsl Exp $"); #include "fs_nfs.h" #include "opt_nfsserver.h" @@ -236,7 +236,6 @@ main(void) * Initialize the current LWP pointer (curlwp) before * any possible traps/probes to simplify trap processing. */ - simple_lock_init(&proc0.p_raslock); l = &lwp0; curlwp = l; l->l_cpu = curcpu(); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 00fe8a7be5e7..92d0b5872446 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_fork.c,v 1.111 2003/09/16 12:06:07 christos Exp $ */ +/* $NetBSD: kern_fork.c,v 1.112 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.111 2003/09/16 12:06:07 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.112 2003/11/04 10:33:15 dsl Exp $"); #include "opt_ktrace.h" #include "opt_systrace.h" @@ -276,7 +276,7 @@ fork1(struct lwp *l1, int flags, int exitsig, void *stack, size_t stacksize, simple_lock_init(&p2->p_sigctx.ps_silock); CIRCLEQ_INIT(&p2->p_sigctx.ps_siginfo); - simple_lock_init(&p2->p_lwplock); + simple_lock_init(&p2->p_lock); LIST_INIT(&p2->p_lwps); /* @@ -296,8 +296,6 @@ fork1(struct lwp *l1, int flags, int exitsig, void *stack, size_t stacksize, crhold(p1->p_ucred); LIST_INIT(&p2->p_raslist); - p2->p_nras = 0; - simple_lock_init(&p2->p_raslock); #if defined(__HAVE_RAS) ras_fork(p1, p2); #endif diff --git a/sys/kern/kern_lwp.c b/sys/kern/kern_lwp.c index 7370e7dec034..c44bfa5b6a08 100644 --- a/sys/kern/kern_lwp.c +++ b/sys/kern/kern_lwp.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lwp.c,v 1.14 2003/10/30 23:31:21 cl Exp $ */ +/* $NetBSD: kern_lwp.c,v 1.15 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.14 2003/10/30 23:31:21 cl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.15 2003/11/04 10:33:15 dsl Exp $"); #include "opt_multiprocessor.h" @@ -110,9 +110,9 @@ sys__lwp_create(struct lwp *l, void *v, register_t *retval) l2->l_stat = LSRUN; setrunqueue(l2); SCHED_UNLOCK(s); - simple_lock(&p->p_lwplock); + simple_lock(&p->p_lock); p->p_nrlwps++; - simple_unlock(&p->p_lwplock); + simple_unlock(&p->p_lock); } else { l2->l_stat = LSSUSPENDED; } @@ -218,9 +218,9 @@ sys__lwp_suspend(struct lwp *l, void *v, register_t *retval) remrunqueue(t); t->l_stat = LSSUSPENDED; SCHED_UNLOCK(s); - simple_lock(&p->p_lwplock); + simple_lock(&p->p_lock); p->p_nrlwps--; - simple_unlock(&p->p_lwplock); + simple_unlock(&p->p_lock); break; case LSSLEEP: t->l_stat = LSSUSPENDED; @@ -397,11 +397,11 @@ lwp_wait1(struct lwp *l, lwpid_t lid, lwpid_t *departed, int flags) LIST_REMOVE(l2, l_zlist); /* off zomblwp */ proclist_unlock_write(s); - simple_lock(&p->p_lwplock); + simple_lock(&p->p_lock); LIST_REMOVE(l2, l_sibling); p->p_nlwps--; p->p_nzlwps--; - simple_unlock(&p->p_lwplock); + simple_unlock(&p->p_lock); /* XXX decrement limits */ pool_put(&lwp_pool, l2); @@ -504,11 +504,11 @@ newlwp(struct lwp *l1, struct proc *p2, vaddr_t uaddr, boolean_t inmem, (arg != NULL) ? arg : l2); - simple_lock(&p2->p_lwplock); + simple_lock(&p2->p_lock); l2->l_lid = ++p2->p_nlwpid; LIST_INSERT_HEAD(&p2->p_lwps, l2, l_sibling); p2->p_nlwps++; - simple_unlock(&p2->p_lwplock); + simple_unlock(&p2->p_lock); /* XXX should be locked differently... */ s = proclist_lock_write(); @@ -555,9 +555,9 @@ lwp_exit(struct lwp *l) } proclist_unlock_write(s); - simple_lock(&p->p_lwplock); + simple_lock(&p->p_lock); p->p_nrlwps--; - simple_unlock(&p->p_lwplock); + simple_unlock(&p->p_lock); l->l_stat = LSDEAD; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 8301ed7962cb..bc1b0b87b4b9 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.66 2003/09/16 12:05:49 christos Exp $ */ +/* $NetBSD: kern_proc.c,v 1.67 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.66 2003/09/16 12:05:49 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.67 2003/11/04 10:33:15 dsl Exp $"); #include "opt_kstack.h" @@ -464,7 +464,7 @@ proc0_insert(struct proc *p, struct lwp *l, struct pgrp *pgrp, { int s; - simple_lock_init(&p->p_lwplock); + simple_lock_init(&p->p_lock); LIST_INIT(&p->p_lwps); LIST_INSERT_HEAD(&p->p_lwps, l, l_sibling); p->p_nlwps = 1; diff --git a/sys/kern/kern_ras.c b/sys/kern/kern_ras.c index 876696db1c4f..ce782ffa0c11 100644 --- a/sys/kern/kern_ras.c +++ b/sys/kern/kern_ras.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_ras.c,v 1.5 2003/06/28 14:52:10 simonb Exp $ */ +/* $NetBSD: kern_ras.c,v 1.6 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_ras.c,v 1.5 2003/06/28 14:52:10 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ras.c,v 1.6 2003/11/04 10:33:15 dsl Exp $"); #include #include @@ -84,18 +84,18 @@ ras_lookup(struct proc *p, caddr_t addr) return ((caddr_t)-1); #endif - simple_lock(&p->p_raslock); + simple_lock(&p->p_lock); LIST_FOREACH(rp, &p->p_raslist, ras_list) { if (addr > rp->ras_startaddr && addr < rp->ras_endaddr) { rp->ras_hits++; - simple_unlock(&p->p_raslock); + simple_unlock(&p->p_lock); #ifdef DIAGNOSTIC DPRINTF(("RAS hit: p=%p %p\n", p, addr)); #endif return (rp->ras_startaddr); } } - simple_unlock(&p->p_raslock); + simple_unlock(&p->p_lock); return ((caddr_t)-1); } @@ -108,20 +108,20 @@ int ras_fork(struct proc *p1, struct proc *p2) { struct ras *rp, *nrp; + int nras = 0; - DPRINTF(("ras_fork: p1=%p, p2=%p, p1->p_nras=%d\n", - p1, p2, p1->p_nras)); - - simple_lock(&p1->p_raslock); + simple_lock(&p1->p_lock); LIST_FOREACH(rp, &p1->p_raslist, ras_list) { + nras++; nrp = pool_get(&ras_pool, PR_NOWAIT); nrp->ras_startaddr = rp->ras_startaddr; nrp->ras_endaddr = rp->ras_endaddr; nrp->ras_hits = 0; LIST_INSERT_HEAD(&p2->p_raslist, nrp, ras_list); } - p2->p_nras = p1->p_nras; - simple_unlock(&p1->p_raslock); + simple_unlock(&p1->p_lock); + + DPRINTF(("ras_fork: p1=%p, p2=%p, nras=%d\n", p1, p2, nras)); return (0); } @@ -134,7 +134,7 @@ ras_purgeall(struct proc *p) { struct ras *rp; - simple_lock(&p->p_raslock); + simple_lock(&p->p_lock); while (!LIST_EMPTY(&p->p_raslist)) { rp = LIST_FIRST(&p->p_raslist); DPRINTF(("RAS %p-%p, hits %d\n", rp->ras_startaddr, @@ -142,8 +142,7 @@ ras_purgeall(struct proc *p) LIST_REMOVE(rp, ras_list); pool_put(&ras_pool, rp); } - p->p_nras = 0; - simple_unlock(&p->p_raslock); + simple_unlock(&p->p_lock); return (0); } @@ -157,24 +156,20 @@ ras_install(struct proc *p, caddr_t addr, size_t len) { struct ras *rp; caddr_t endaddr = addr + len; + int nras = 0; if (addr < (caddr_t)VM_MIN_ADDRESS || - addr > (caddr_t)VM_MAXUSER_ADDRESS) + endaddr > (caddr_t)VM_MAXUSER_ADDRESS) return (EINVAL); if (len <= 0) return (EINVAL); - if (p->p_nras >= ras_per_proc) - return (EINVAL); - - simple_lock(&p->p_raslock); + simple_lock(&p->p_lock); LIST_FOREACH(rp, &p->p_raslist, ras_list) { - if ((addr > rp->ras_startaddr && addr < rp->ras_endaddr) || - (endaddr > rp->ras_startaddr && - endaddr < rp->ras_endaddr) || - (addr < rp->ras_startaddr && endaddr > rp->ras_endaddr)) { - simple_unlock(&p->p_raslock); + if (++nras >= ras_per_proc || + (addr < rp->ras_endaddr && endaddr > rp->ras_startaddr)) { + simple_unlock(&p->p_lock); return (EINVAL); } } @@ -183,8 +178,7 @@ ras_install(struct proc *p, caddr_t addr, size_t len) rp->ras_endaddr = endaddr; rp->ras_hits = 0; LIST_INSERT_HEAD(&p->p_raslist, rp, ras_list); - p->p_nras++; - simple_unlock(&p->p_raslock); + simple_unlock(&p->p_lock); return (0); } @@ -200,17 +194,16 @@ ras_purge(struct proc *p, caddr_t addr, size_t len) caddr_t endaddr = addr + len; int error = ESRCH; - simple_lock(&p->p_raslock); + simple_lock(&p->p_lock); LIST_FOREACH(rp, &p->p_raslist, ras_list) { if (addr == rp->ras_startaddr && endaddr == rp->ras_endaddr) { LIST_REMOVE(rp, ras_list); pool_put(&ras_pool, rp); - p->p_nras--; error = 0; break; } } - simple_unlock(&p->p_raslock); + simple_unlock(&p->p_lock); return (error); } diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index f67cef3f18d9..0a92e17e9532 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.84 2003/08/07 16:31:55 agc Exp $ */ +/* $NetBSD: sys_process.c,v 1.85 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -89,7 +89,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.84 2003/08/07 16:31:55 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.85 2003/11/04 10:33:15 dsl Exp $"); #include #include @@ -296,7 +296,7 @@ sys_ptrace(l, v, retval) /* * Can't write to a RAS */ - if ((t->p_nras != 0) && + if (!LIST_EMPTY(&t->p_raslist) && (ras_lookup(t, SCARG(uap, addr)) != (caddr_t)-1)) { return (EACCES); }