summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-11-08 00:43:46 +0000
committeralc <alc@FreeBSD.org>2004-11-08 00:43:46 +0000
commit279c442e7b00039336f35f8337221afc75097719 (patch)
tree9c22bf433a4b1e53785d707539f3ec1a29b480d8 /sys/arm
parentddc1dfe834242dfb57955d438edf435598a4ebeb (diff)
downloadFreeBSD-src-279c442e7b00039336f35f8337221afc75097719.zip
FreeBSD-src-279c442e7b00039336f35f8337221afc75097719.tar.gz
Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new options. Implement the "no wait" option. An implementation of the "CPU private" for i386 will be committed at a later date.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/vm_machdep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index 5c48b2a..2effe82 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -231,7 +231,7 @@ sf_buf_init(void *arg)
* Get an sf_buf from the freelist. Will block if none are available.
*/
struct sf_buf *
-sf_buf_alloc(struct vm_page *m, int pri)
+sf_buf_alloc(struct vm_page *m, int flags)
{
struct sf_head *hash_list;
struct sf_buf *sf;
@@ -251,10 +251,12 @@ sf_buf_alloc(struct vm_page *m, int pri)
}
}
while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) {
+ if (flags & SFB_NOWAIT)
+ goto done;
sf_buf_alloc_want++;
mbstat.sf_allocwait++;
- error = msleep(&sf_buf_freelist, &sf_buf_lock, PVM | pri,
- "sfbufa", 0);
+ error = msleep(&sf_buf_freelist, &sf_buf_lock,
+ (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0);
sf_buf_alloc_want--;
OpenPOWER on IntegriCloud