Date: Mon, 27 Oct 2014 01:10:41 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273716 - head/sys/sparc64/sparc64 Message-ID: <201410270110.s9R1AfHX038666@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Mon Oct 27 01:10:40 2014 New Revision: 273716 URL: https://svnweb.freebsd.org/changeset/base/273716 Log: Simplify memrw(). MFC after: 10 days Modified: head/sys/sparc64/sparc64/mem.c Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Mon Oct 27 00:47:55 2014 (r273715) +++ head/sys/sparc64/sparc64/mem.c Mon Oct 27 01:10:40 2014 (r273716) @@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/vm_page.h> +#include <vm/vm_phys.h> #include <vm/vm_kern.h> #include <vm/pmap.h> #include <vm/vm_extern.h> #include <machine/cache.h> #include <machine/md_var.h> -#include <machine/pmap.h> #include <machine/tlb.h> #include <machine/memdev.h> @@ -92,7 +92,6 @@ memrw(struct cdev *dev, struct uio *uio, vm_size_t cnt; vm_page_t m; int error; - int i; uint32_t colors; cnt = 0; @@ -124,15 +123,7 @@ memrw(struct cdev *dev, struct uio *uio, cnt = ulmin(cnt, PAGE_SIZE - off); cnt = ulmin(cnt, iov->iov_len); - m = NULL; - for (i = 0; phys_avail[i] != 0; i += 2) { - if (pa >= phys_avail[i] && - pa < phys_avail[i + 1]) { - m = PHYS_TO_VM_PAGE(pa); - break; - } - } - + m = vm_phys_paddr_to_vm_page(pa); if (m != NULL) { if (ova == 0) { if (dcache_color_ignore == 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410270110.s9R1AfHX038666>