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/kern/kern_lock.c | |
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/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 1701c0ce7f2..d0b418a7b1f 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.24 2007/02/14 00:53:48 jsg Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.25 2007/03/15 10:22:30 art Exp $ */ /* * Copyright (c) 1995 @@ -900,13 +900,13 @@ _kernel_proc_lock(struct proc *p) { SCHED_ASSERT_UNLOCKED(); __mp_lock(&kernel_lock); - p->p_flag |= P_BIGLOCK; + atomic_setbits_int(&p->p_flag, P_BIGLOCK); } void _kernel_proc_unlock(struct proc *p) { - p->p_flag &= ~P_BIGLOCK; + atomic_clearbits_int(&p->p_flag, P_BIGLOCK); __mp_unlock(&kernel_lock); } |