diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-03-15 10:22:31 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-03-15 10:22:31 +0000 |
commit | bd2b614cddbdb963198fdd15728e067d209f3cf7 (patch) | |
tree | 1710a23e5d69760e81f4955e44aac6e49a944b07 /sys/arch | |
parent | b93b6840228d38589b6e976f3a325539c4fc9ae0 (diff) |
Since p_flag is often manipulated in interrupts and without biglock
it's a good idea to use atomic.h operations on it. This mechanic
change updates all bit operations on p_flag to atomic_{set,clear}bits_int.
Only exception is that P_OWEUPC is set by MI code before calling
need_proftick and it's automatically cleared by ADDUPC. There's
no reason for MD handling of that flag since everyone handles it the
same way.
kettenis@ ok
Diffstat (limited to 'sys/arch')
33 files changed, 48 insertions, 72 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 99172106797..36babce98c3 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.52 2006/12/24 20:30:33 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.53 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -768,7 +768,6 @@ ast(framep) uvmexp.softs++; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index ef4b6b09503..8f1dcfeeaca 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.26 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.27 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */ /*- @@ -296,13 +296,11 @@ do { \ #ifdef notyet #define need_proftick(p) \ do { \ - (p)->p_flag |= P_OWEUPC; \ aston((p)->p_cpu); \ } while (/*CONSTCOND*/0) #else #define need_proftick(p) \ do { \ - (p)->p_flag |= P_OWEUPC; \ aston(curcpu()); \ } while (/*CONSTCOND*/0) #endif diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 24451f7d6da..358592235d3 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.10 2007/01/15 23:19:05 jsg Exp $ */ +/* $OpenBSD: trap.c,v 1.11 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -334,7 +334,6 @@ copyfault: case T_ASTFLT|T_USER: /* Allow process switch */ uvmexp.softs++; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; KERNEL_PROC_LOCK(p); ADDUPROF(p); KERNEL_PROC_UNLOCK(p); diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 38d4b66ed09..55ef0ec6bd5 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.25 2007/02/17 17:35:43 tom Exp $ */ +/* $OpenBSD: cpu.h,v 1.26 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -227,7 +227,7 @@ extern u_int32_t cpus_attached; * buffer pages are invalid. On the i386, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, aston(p)) +#define need_proftick(p) aston(p) void signotify(struct proc *); diff --git a/sys/arch/arm/arm/ast.c b/sys/arch/arm/arm/ast.c index 8ba315e3687..8bc5c0394bc 100644 --- a/sys/arch/arm/arm/ast.c +++ b/sys/arch/arm/arm/ast.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ast.c,v 1.6 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: ast.c,v 1.7 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: ast.c,v 1.6 2003/10/31 16:44:34 cl Exp $ */ /* @@ -114,7 +114,6 @@ ast(struct trapframe *tf) #endif if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } diff --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h index fa4396b5558..faa66b3cbdb 100644 --- a/sys/arch/arm/include/cpu.h +++ b/sys/arch/arm/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.14 2007/02/11 21:59:32 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.15 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */ /* @@ -260,7 +260,7 @@ extern int want_resched; /* resched() was called */ * buffer pages are invalid. On the i386, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast()) +#define need_proftick(p) setsoftast() #ifndef acorn26 /* diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index 0a8d3b895ae..a408e050cbf 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.49 2007/01/28 16:38:45 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.50 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */ /* @@ -556,7 +556,6 @@ dopanic: } spl0(); if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (type == (T_ASTFLT | T_USER) && want_resched) { diff --git a/sys/arch/hp300/include/cpu.h b/sys/arch/hp300/include/cpu.h index df051c819cc..56d22c6a43e 100644 --- a/sys/arch/hp300/include/cpu.h +++ b/sys/arch/hp300/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.32 2006/11/29 12:26:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.33 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.28 1998/02/13 07:41:51 scottr Exp $ */ /* @@ -96,7 +96,7 @@ extern int want_resched; /* resched() was called */ * buffer pages are invalid. On the hp300, request an ast to send us * through trap, marking the proc as needing a profiling tick. */ -#define need_proftick(p) { (p)->p_flag |= P_OWEUPC; aston(); } +#define need_proftick(p) aston() /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 07e06fc9659..cabcae3e572 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.97 2007/03/05 17:13:59 mickey Exp $ */ +/* $OpenBSD: trap.c,v 1.98 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -139,7 +139,6 @@ userret(struct proc *p) astpending = 0; uvmexp.softs++; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h index 04a70b07691..8ccf039327c 100644 --- a/sys/arch/hppa/include/cpu.h +++ b/sys/arch/hppa/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.47 2007/01/17 19:30:12 mickey Exp $ */ +/* $OpenBSD: cpu.h,v 1.48 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 2000-2004 Michael Shalayeff @@ -128,7 +128,7 @@ extern int cpu_hvers; #define signotify(p) (setsoftast()) #define need_resched(ci) (want_resched = 1, setsoftast()) -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast()) +#define need_proftick(p) setsoftast() #define PROC_PC(p) ((p)->p_md.md_regs->tf_iioq_head) #ifndef _LOCORE diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c index 73ff5be1703..63b57f6886b 100644 --- a/sys/arch/hppa64/hppa64/trap.c +++ b/sys/arch/hppa64/hppa64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.6 2005/10/26 18:35:45 martin Exp $ */ +/* $OpenBSD: trap.c,v 1.7 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -128,7 +128,6 @@ userret(struct proc *p, register_t pc, u_quad_t oticks) if (astpending) { astpending = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } } diff --git a/sys/arch/hppa64/include/cpu.h b/sys/arch/hppa64/include/cpu.h index 43cc46203aa..b88a04dea2b 100644 --- a/sys/arch/hppa64/include/cpu.h +++ b/sys/arch/hppa64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.9 2006/03/12 03:14:37 brad Exp $ */ +/* $OpenBSD: cpu.h,v 1.10 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -196,7 +196,7 @@ extern int cpu_hvers; #define signotify(p) (setsoftast()) #define need_resched(ci) (want_resched = 1, setsoftast()) -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast()) +#define need_proftick(p) setsoftast() #ifndef _LOCORE #ifdef _KERNEL diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 37c2fd28b26..0bea0095d56 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.81 2007/01/09 08:43:25 art Exp $ */ +/* $OpenBSD: trap.c,v 1.82 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -383,7 +383,6 @@ trap(struct trapframe frame) case T_ASTFLT|T_USER: /* Allow process switch */ uvmexp.softs++; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; KERNEL_PROC_LOCK(p); ADDUPROF(p); KERNEL_PROC_UNLOCK(p); diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 153e6f2c608..a066cbea0bb 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.87 2007/02/20 21:15:01 tom Exp $ */ +/* $OpenBSD: cpu.h,v 1.88 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -224,7 +224,7 @@ extern void need_resched(struct cpu_info *); * buffer pages are invalid. On the i386, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast()) +#define need_proftick(p) setsoftast() /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h index 08b797c5372..697cfcfc9af 100644 --- a/sys/arch/m88k/include/cpu.h +++ b/sys/arch/m88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.18 2007/01/12 21:41:53 aoyama Exp $ */ +/* $OpenBSD: cpu.h,v 1.19 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -229,7 +229,7 @@ do { \ * buffer pages are invalid. On the m88k, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, aston(p)) +#define need_proftick(p) aston(p) /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index df5f44870af..4de452d5ebf 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.38 2007/02/11 12:49:37 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.39 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -538,7 +538,6 @@ user_fault: uvmexp.softs++; p->p_md.md_astpending = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; KERNEL_PROC_LOCK(p); ADDUPROF(p); KERNEL_PROC_UNLOCK(p); @@ -1055,7 +1054,6 @@ m88110_user_fault: uvmexp.softs++; p->p_md.md_astpending = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; KERNEL_PROC_LOCK(p); ADDUPROF(p); KERNEL_PROC_UNLOCK(p); diff --git a/sys/arch/mac68k/include/cpu.h b/sys/arch/mac68k/include/cpu.h index b97efff30d5..dec5f7811e2 100644 --- a/sys/arch/mac68k/include/cpu.h +++ b/sys/arch/mac68k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.42 2006/11/29 12:26:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.43 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.45 1997/02/10 22:13:40 scottr Exp $ */ /* @@ -109,7 +109,7 @@ extern int want_resched; /* resched() was called */ * interrupt. Request an ast to send us through trap(), * marking the proc as needing a profiling tick. */ -#define need_proftick(p) ( (p)->p_flag |= P_OWEUPC, aston() ) +#define need_proftick(p) aston() /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index 7d14554196b..bc706b11f63 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.51 2007/01/28 16:38:48 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.52 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */ /* @@ -511,7 +511,6 @@ copyfault: } spl0(); if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (type == (T_ASTFLT | T_USER) && want_resched) { diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index def5c9e20c4..d24ef984e32 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.14 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.15 2007/03/15 10:22:29 art Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -349,7 +349,7 @@ extern int int_nest_cntr; * buffer pages are invalid. On the PICA, request an ast to send us * through trap, marking the proc as needing a profiling tick. */ -#define need_proftick(p) { (p)->p_flag |= P_OWEUPC; aston(); } +#define need_proftick(p) aston() /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index 59d1aed120d..0cf196762fa 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.22 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.23 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -267,7 +267,6 @@ softintr() astpending = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/mvme68k/include/cpu.h b/sys/arch/mvme68k/include/cpu.h index 11e0a01ed04..a7caae93d53 100644 --- a/sys/arch/mvme68k/include/cpu.h +++ b/sys/arch/mvme68k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.25 2006/11/29 12:26:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.26 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -121,7 +121,7 @@ extern int want_resched; * buffer pages are invalid. On the m68k, request an ast to send us * through trap, marking the proc as needing a profiling tick. */ -#define need_proftick(p) { (p)->p_flag |= P_OWEUPC; aston(); } +#define need_proftick(p) aston() /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index cb72380c5a2..41fbfcc4b7c 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.64 2007/01/28 16:38:48 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.65 2007/03/15 10:22:29 art Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -491,7 +491,6 @@ copyfault: } spl0(); if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (type == (T_ASTFLT | T_USER) && want_resched) { diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index d6c4026e087..d89ed88c158 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.28 2006/11/29 12:26:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.29 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ /* @@ -51,7 +51,7 @@ extern volatile int want_resched; extern volatile int astpending; #define need_resched(ci) (want_resched = 1, astpending = 1) -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, astpending = 1) +#define need_proftick(p) do { astpending = 1; } while (0) #define signotify(p) (astpending = 1) extern char *bootpath; diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index a5548f62226..c5c67b3f456 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.73 2006/12/24 20:29:19 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.74 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */ /* @@ -644,7 +644,6 @@ for (i = 0; i < errnum; i++) { uvmexp.softs++; astpending = 0; /* we are about to do it */ if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h index a4906007317..61f0faf3f89 100644 --- a/sys/arch/sh/include/cpu.h +++ b/sys/arch/sh/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.6 2007/03/03 21:37:27 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.7 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */ /*- @@ -88,11 +88,7 @@ do { \ * buffer pages are invalid. On the MIPS, request an ast to send us * through trap, marking the proc as needing a profiling tick. */ -#define need_proftick(p) \ -do { \ - (p)->p_flag |= P_OWEUPC; \ - aston(p); \ -} while (/*CONSTCOND*/0) +#define need_proftick(p) aston(p) /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index dd8a510e078..d5b503d17c3 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.11 2007/03/13 19:29:33 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.12 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */ /* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */ @@ -488,7 +488,6 @@ ast(struct proc *p, struct trapframe *tf) p->p_md.md_astpending = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index e2ac576e8ad..345ff5525d5 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.8 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.9 2007/03/15 10:22:29 art Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -348,7 +348,6 @@ badtrap: case T_AST: want_ast = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h index 6cab3d88eab..c866f1d4803 100644 --- a/sys/arch/sparc/include/cpu.h +++ b/sys/arch/sparc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.27 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.28 2007/03/15 10:22:29 art Exp $ */ /* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */ /* @@ -141,7 +141,7 @@ extern int want_ast; * buffer pages are invalid. On the sparc, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, want_ast = 1) +#define need_proftick(p) do { want_ast = 1; } while (0) /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 7ea961d5ecb..01aa8002472 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.50 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.51 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -341,7 +341,6 @@ badtrap: case T_AST: want_ast = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index 66d66500796..d5a6400e7ac 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.37 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.38 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -174,7 +174,7 @@ extern int want_resched; /* resched() was called */ * buffer pages are invalid. On the sparc, request an ast to send us * through trap(), marking the proc as needing a profiling tick. */ -#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, want_ast = 1) +#define need_proftick(p) do { want_ast = 1; } while (0) /* * Notify the current process (p) that it has a signal pending, diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 00e590f3c32..a7761e289c9 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.46 2007/02/27 22:46:32 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.47 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -498,7 +498,6 @@ badtrap: case T_AST: want_ast = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index 0191390c8cf..bc291df29e6 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.22 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.23 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */ /* @@ -112,7 +112,7 @@ extern int want_resched; /* resched() was called */ * buffer pages are invalid. On the vax, request an ast to send us * through trap, marking the proc as needing a profiling tick. */ -#define need_proftick(p) {(p)->p_flag |= P_OWEUPC; mtpr(AST_OK,PR_ASTLVL); } +#define need_proftick(p) mtpr(AST_OK,PR_ASTLVL) /* * This defines the I/O device register space size in pages. diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 37f901282f6..c32a9f7a8d3 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.36 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.37 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -291,7 +291,6 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n", mtpr(AST_NO,PR_ASTLVL); trapsig = 0; if (p->p_flag & P_OWEUPC) { - p->p_flag &= ~P_OWEUPC; ADDUPROF(p); } if (want_resched) |