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/miscfs | |
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/miscfs')
-rw-r--r-- | sys/miscfs/procfs/procfs_ctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/miscfs/procfs/procfs_ctl.c b/sys/miscfs/procfs/procfs_ctl.c index 917691eb0f9..6644edb495b 100644 --- a/sys/miscfs/procfs/procfs_ctl.c +++ b/sys/miscfs/procfs/procfs_ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_ctl.c,v 1.19 2006/11/29 12:24:18 miod Exp $ */ +/* $OpenBSD: procfs_ctl.c,v 1.20 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: procfs_ctl.c,v 1.14 1996/02/09 22:40:48 christos Exp $ */ /* @@ -137,7 +137,7 @@ procfs_control(curp, p, op) * proc gets to see all the action. * Stop the target. */ - p->p_flag |= P_TRACED; + atomic_setbits_int(&p->p_flag, P_TRACED); p->p_xstat = 0; /* XXX ? */ if (p->p_pptr != curp) { p->p_oppid = p->p_pptr->p_pid; @@ -186,7 +186,7 @@ procfs_control(curp, p, op) return (0); /* not being traced any more */ - CLR(p->p_flag, P_TRACED); + atomic_clearbits_int(&p->p_flag, P_TRACED); /* give process back to original parent */ if (p->p_oppid != p->p_pptr->p_pid) { @@ -198,7 +198,7 @@ procfs_control(curp, p, op) } p->p_oppid = 0; - CLR(p->p_flag, P_WAITED); /* XXX ? */ + atomic_clearbits_int(&p->p_flag, P_WAITED); wakeup(curp); /* XXX for CTL_WAIT below ? */ break; |