Module Name: src Committed By: uebayasi Date: Fri Feb 12 13:39:10 UTC 2010
Modified Files: src/sys/uvm [uebayasi-xip]: uvm_loan.c Log Message: Teach device page handling. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.77.2.1 src/sys/uvm/uvm_loan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm_loan.c diff -u src/sys/uvm/uvm_loan.c:1.77 src/sys/uvm/uvm_loan.c:1.77.2.1 --- src/sys/uvm/uvm_loan.c:1.77 Wed Feb 3 14:02:49 2010 +++ src/sys/uvm/uvm_loan.c Fri Feb 12 13:39:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_loan.c,v 1.77 2010/02/03 14:02:49 uebayasi Exp $ */ +/* $NetBSD: uvm_loan.c,v 1.77.2.1 2010/02/12 13:39:10 uebayasi Exp $ */ /* * @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77 2010/02/03 14:02:49 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.77.2.1 2010/02/12 13:39:10 uebayasi Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -540,6 +540,10 @@ } if (error) goto fail; + if (uvm_pageisdevice_p(pgpp[0])) { + error = EBUSY; + goto fail2; + } KASSERT(npages > 0); @@ -606,6 +610,7 @@ fail: uvm_unloan(origpgpp, ndone, UVM_LOAN_TOPAGE); +fail2: return error; } @@ -657,7 +662,7 @@ * then we fail the loan. */ - if (error && error != EBUSY) { + if ((error && error != EBUSY) || uvm_pageisdevice_p(pg)) { uvmfault_unlockall(ufi, amap, uobj, NULL); return (-1); }