-/*
- * NOTE: There is no prototype for the following in BSD. It, and the definitions
- * of the defines for cppvPsrc, cppvPsnk, cppvFsnk, and cppvFsrc will be found in
- * osfmk/ppc/mappings.h. They are not included here because there appears to be no
- * way to do so without exporting them to kexts as well.
- */
- if (flags & CL_READ)
-// copypv(ubc_paddr, usr_paddr, xsize, cppvPsrc | cppvPsnk | cppvFsnk); /* Copy physical to physical and flush the destination */
- copypv(ubc_paddr, usr_paddr, xsize, 2 | 1 | 4); /* Copy physical to physical and flush the destination */
- else
-// copypv(ubc_paddr, usr_paddr, xsize, cppvPsrc | cppvPsnk | cppvFsrc); /* Copy physical to physical and flush the source */
- copypv(ubc_paddr, usr_paddr, xsize, 2 | 1 | 8); /* Copy physical to physical and flush the source */
-
- if ( !(flags & CL_READ) || upl_dirty_page(pl, 0)) {
- /*
- * issue a synchronous write to cluster_io
- */
- error = cluster_io(vp, upl, 0, uio->uio_offset & ~PAGE_MASK_64, PAGE_SIZE, devblocksize,
- 0, (struct buf *)0, (struct clios *)0);
- }
- if (error == 0) {
- uio->uio_offset += xsize;
- iov->iov_base += xsize;
- iov->iov_len -= xsize;
- uio->uio_resid -= xsize;
- }
- ubc_upl_abort_range(upl, 0, PAGE_SIZE, UPL_ABORT_DUMP_PAGES | UPL_ABORT_FREE_ON_EMPTY);
-
- return (error);
+ if (flags & CL_READ)
+ copyp2p(ubc_paddr, usr_paddr, xsize, 2);
+ else
+ copyp2p(usr_paddr, ubc_paddr, xsize, 1);
+
+ if ( !(flags & CL_READ) || upl_dirty_page(pl, 0)) {
+ /*
+ * issue a synchronous write to cluster_io
+ */
+ error = cluster_io(vp, upl, 0, uio->uio_offset & ~PAGE_MASK_64, PAGE_SIZE, devblocksize,
+ 0, (struct buf *)0, (struct clios *)0);
+ }
+ if (error == 0) {
+ uio->uio_offset += xsize;
+ iov->iov_base += xsize;
+ iov->iov_len -= xsize;
+ uio->uio_resid -= xsize;
+ }
+ ubc_upl_abort_range(upl, 0, PAGE_SIZE, UPL_ABORT_DUMP_PAGES | UPL_ABORT_FREE_ON_EMPTY);
+
+ return (error);