diff options
author | 2007-03-15 10:22:29 +0000 | |
---|---|---|
committer | 2007-03-15 10:22:29 +0000 | |
commit | 29514732ed7d204db854b589692b0fd90dc452d0 (patch) | |
tree | 5e8143a1e45a8ca7a90bc7199927c179bed99d96 /sys/kern/sys_process.c | |
parent | regen (diff) | |
download | wireguard-openbsd-29514732ed7d204db854b589692b0fd90dc452d0.tar.xz wireguard-openbsd-29514732ed7d204db854b589692b0fd90dc452d0.zip |
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/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index e60ff8b7ef7..188c581983d 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.37 2006/11/29 12:24:18 miod Exp $ */ +/* $OpenBSD: sys_process.c,v 1.38 2007/03/15 10:22:30 art Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -231,7 +231,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) switch (SCARG(uap, req)) { case PT_TRACE_ME: /* Just set the trace flag. */ - SET(t->p_flag, P_TRACED); + atomic_setbits_int(&t->p_flag, P_TRACED); t->p_oppid = t->p_pptr->p_pid; if (t->p_ptstat == NULL) t->p_ptstat = malloc(sizeof(*t->p_ptstat), @@ -373,7 +373,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) /* not being traced any more */ t->p_oppid = 0; - CLR(t->p_flag, P_TRACED|P_WAITED); + atomic_clearbits_int(&t->p_flag, P_TRACED|P_WAITED); sendsig: bzero(t->p_ptstat, sizeof(*t->p_ptstat)); @@ -408,7 +408,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) * proc gets to see all the action. * Stop the target. */ - SET(t->p_flag, P_TRACED); + atomic_setbits_int(&t->p_flag, P_TRACED); t->p_oppid = t->p_pptr->p_pid; if (t->p_pptr != p) proc_reparent(t, p); |