summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-05-21 05:15:27 +0000
committermarcel <marcel@FreeBSD.org>2008-05-21 05:15:27 +0000
commit04349514e926392ffa928ba60b0d8ae92a03ad2a (patch)
tree0a119c7c0c9f0412f50821bfb2414fe56f90af9b /sys/ia64
parent89252b28acf135191f6f8f7c391cec7e048f9504 (diff)
downloadFreeBSD-src-04349514e926392ffa928ba60b0d8ae92a03ad2a.zip
FreeBSD-src-04349514e926392ffa928ba60b0d8ae92a03ad2a.tar.gz
We can call ia64_flush_dirty() when the corresponding process is
locked or not. As such, use PROC_LOCKED() to determine which case it is and lock the process when not.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/machdep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 42b1394..87dc53d 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -1106,7 +1106,7 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
struct iovec iov;
struct uio uio;
uint64_t bspst, kstk, rnat;
- int error;
+ int error, locked;
if (r->ndirty == 0)
return (0);
@@ -1127,7 +1127,9 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
r->rnat = (bspst > kstk && (bspst & 0x1ffL) < (kstk & 0x1ffL))
? *(uint64_t*)(kstk | 0x1f8L) : rnat;
} else {
- PHOLD(td->td_proc);
+ locked = PROC_LOCKED(td->td_proc);
+ if (!locked)
+ PHOLD(td->td_proc);
iov.iov_base = (void*)(uintptr_t)kstk;
iov.iov_len = r->ndirty;
uio.uio_iov = &iov;
@@ -1145,7 +1147,8 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
*/
if (uio.uio_resid != 0 && error == 0)
error = ENOSPC;
- PRELE(td->td_proc);
+ if (!locked)
+ PRELE(td->td_proc);
}
r->bspstore += r->ndirty;
OpenPOWER on IntegriCloud