summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-03-15 10:22:31 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-03-15 10:22:31 +0000
commitbd2b614cddbdb963198fdd15728e067d209f3cf7 (patch)
tree1710a23e5d69760e81f4955e44aac6e49a944b07 /sys/arch/powerpc
parentb93b6840228d38589b6e976f3a325539c4fc9ae0 (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/powerpc')
-rw-r--r--sys/arch/powerpc/include/cpu.h4
-rw-r--r--sys/arch/powerpc/powerpc/trap.c3
2 files changed, 3 insertions, 4 deletions
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)