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/sh | |
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/sh')
-rw-r--r-- | sys/arch/sh/include/cpu.h | 8 | ||||
-rw-r--r-- | sys/arch/sh/sh/trap.c | 3 |
2 files changed, 3 insertions, 8 deletions
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); } |